]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/btrfs/delayed-ref.h
btrfs: improve delayed refs iterations
[mirror_ubuntu-artful-kernel.git] / fs / btrfs / delayed-ref.h
index 43f3629760e90f186730842b0b1c609f799ae256..dba97842b47a18d387eb5d8c01c9199b499cacdf 100644 (file)
@@ -42,6 +42,12 @@ struct btrfs_delayed_ref_node {
 
        /*data/tree ref use list, stored in ref_head->ref_list. */
        struct list_head list;
+       /*
+        * If action is BTRFS_ADD_DELAYED_REF, also link this node to
+        * ref_head->ref_add_list, then we do not need to iterate the
+        * whole ref_head->ref_list to find BTRFS_ADD_DELAYED_REF nodes.
+        */
+       struct list_head add_list;
 
        /* the starting bytenr of the extent */
        u64 bytenr;
@@ -99,6 +105,8 @@ struct btrfs_delayed_ref_head {
 
        spinlock_t lock;
        struct list_head ref_list;
+       /* accumulate add BTRFS_ADD_DELAYED_REF nodes to this ref_add_list. */
+       struct list_head ref_add_list;
 
        struct rb_node href_node;