[Devel] [PATCH RHEL8 COMMIT] ploop: Introduce md helpers

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jul 2 22:51:53 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.51
------>
commit a7277ac202c86961a80dd207380f24fc20d16eeb
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Jul 2 22:51:53 2021 +0300

    ploop: Introduce md helpers
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    ==========================
    ploop: Stop using kvec
    
    We can't read using kvec from file open with O_DIRECT.
    This makes ploop to stop use it.
    
    Kirill Tkhai (8):
          ploop: Read metadata page-aligned
          ploop: RAW image does not have header
          ploop: Introduce ploop_init_be_iter()
          ploop: Introduce rb_root_for_each_md_page()
          ploop: Introduce md helpers
          ploop: Stop using kvec
          ploop: Kill dead check
          ploop: Shorten delta_bat_entries
---
 drivers/md/dm-ploop.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 972f91b97c62..c26641ce4e2b 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -400,6 +400,17 @@ static inline u32 page_clu_idx_to_bat_clu(u32 page_id, u32 cluster_rel)
 	return off + cluster_rel;
 }
 
+static inline struct md_page *md_first_entry(struct rb_root *md_root)
+{
+	struct rb_node *node = rb_first(md_root);
+	return rb_entry(node, struct md_page, node);
+}
+static inline struct md_page *md_next_entry(struct md_page *md)
+{
+	return rb_entry(rb_next(&md->node), struct md_page, node);
+}
+
+
 extern struct md_page * md_page_find(struct ploop *ploop, u32 id);
 
 /*


More information about the Devel mailing list