[Devel] [PATCH RH8 4/8] ploop: Introduce rb_root_for_each_md_page()

Kirill Tkhai ktkhai at virtuozzo.com
Thu Jul 1 18:14:36 MSK 2021


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 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