+/* Iterate through each @child dentry of the @parent inode,
+ * in sorted order (by case sensitive name). */
+#define for_inode_child(child, parent) \
+ for (struct rb_node *_tmp = rb_first(&parent->i_children); \
+ _tmp && \
+ ((child = rb_entry(_tmp, struct wim_dentry, rb_node)), 1); \
+ _tmp = rb_next(_tmp))
+
+/* Iterate through each @child dentry of the @parent dentry,
+ * in sorted order (by case sensitive name). */
+#define for_dentry_child(child, parent) \
+ for_inode_child(child, parent->d_inode)
+
+/* Iterate through each @child dentry of the @parent inode,
+ * in postorder (safe for freeing). */
+#define for_inode_child_postorder(child, parent) \
+ for (struct rb_node *_tmp = rb_first_postorder(&parent->i_children), *_parent; \
+ _tmp && \
+ ((child = rb_entry(_tmp, struct wim_dentry, rb_node)), 1) && \
+ ((_parent = rb_parent(_tmp)), 1); \
+ _tmp = rb_next_postorder(_tmp, _parent))
+
+/* Iterate through each @child dentry of the @parent dentry,
+ * in postorder (safe for freeing). */
+#define for_dentry_child_postorder(child, parent) \
+ for_inode_child_postorder(child, parent->d_inode)
+