[Devel] [PATCH RHEL8 COMMIT] ploop: Introduce rb_root_for_each_md_page()

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 429952e96b3e068775b3952d6cf0dfe3c62d3ba0
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Jul 2 22:51:53 2021 +0300

    ploop: Introduce rb_root_for_each_md_page()
    
    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 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 48ad2be49468..972f91b97c62 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -283,13 +283,16 @@ struct ploop_cow {
 extern bool ignore_signature_disk_in_use;
 extern struct kmem_cache *cow_cache;
 
-#define ploop_for_each_md_page(ploop, md, node)		\
-	for (node = rb_first(&ploop->bat_entries),	\
+#define rb_root_for_each_md_page(rb_root, md, node)	\
+	for (node = rb_first(rb_root),			\
 	     md = rb_entry(node, struct md_page, node); \
 	     node != NULL;				\
 	     node = rb_next(node),			\
 	     md = rb_entry(node, struct md_page, node))
 
+#define ploop_for_each_md_page(ploop, md, node)	\
+	rb_root_for_each_md_page(&ploop->bat_entries, md, node)
+
 static inline bool ploop_is_ro(struct ploop *ploop)
 {
 	return (dm_table_get_mode(ploop->ti->table) & FMODE_WRITE) == 0;


More information about the Devel mailing list