[Devel] [PATCH RHEL8 COMMIT] ploop: Cache delta file size

Konstantin Khorenko khorenko at virtuozzo.com
Mon May 24 12:57:20 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.31
------>
commit c9dfea9d0a5c1d98e1e5c59750b00b42877e3c71
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Mon May 24 12:57:20 2021 +0300

    ploop: Cache delta file size
    
    Also introduce a variable, which will show preallocations
    in next patches.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    ploop: Truncate top delta from kernel
    
    and refactoring at tail.
    
    https://jira.sw.ru/browse/PSBM-129278
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-bat.c | 2 ++
 drivers/md/dm-ploop.h     | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/md/dm-ploop-bat.c b/drivers/md/dm-ploop-bat.c
index ffdd82cbc98e..10126ce12473 100644
--- a/drivers/md/dm-ploop-bat.c
+++ b/drivers/md/dm-ploop-bat.c
@@ -542,6 +542,8 @@ int ploop_add_delta(struct ploop *ploop, u32 level, struct file *file, bool is_r
 	apply_delta_mappings(ploop, deltas, level, (void *)hdr, size_in_clus);
 
 	deltas[level].file = file;
+	deltas[level].file_size = file_size;
+	deltas[level].file_preallocated_area_start = file_size;
 	deltas[level].size_in_clus = size_in_clus;
 	deltas[level].is_raw = is_raw;
 	ret = 0;
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 06dec66a7d62..5e73bed446a5 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -34,6 +34,8 @@ struct ploop_pvd_header {
 
 struct ploop_delta {
 	struct file *file;
+	loff_t file_size;
+	loff_t file_preallocated_area_start;
 	u32 size_in_clus;
 	bool is_raw;
 };


More information about the Devel mailing list