diff options
author | Liu Bo <bo.liu@linux.alibaba.com> | 2018-08-22 22:51:50 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-10-15 18:23:33 +0300 |
commit | e3d039656384288bbe952413d8d404b3035fe7d7 (patch) | |
tree | 0a1f7bfe1f829f2ba99c938ab0ffb03eb27fa6ac /fs/btrfs/delayed-ref.h | |
parent | 5c9d028b3b174e5cf3678a7b0c14e21e51665793 (diff) | |
download | linux-e3d039656384288bbe952413d8d404b3035fe7d7.tar.xz |
Btrfs: delayed-refs: use rb_first_cached for ref_tree
rb_first_cached() trades an extra pointer "leftmost" for doing the same
job as rb_first() but in O(1).
Functions manipulating href->ref_tree need to get the first entry, this
converts href->ref_tree to use rb_first_cached().
For more details about the optimization see patch "Btrfs: delayed-refs:
use rb_first_cached for href_root".
Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delayed-ref.h')
-rw-r--r-- | fs/btrfs/delayed-ref.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h index 88438b6cee45..c3e3486a126c 100644 --- a/fs/btrfs/delayed-ref.h +++ b/fs/btrfs/delayed-ref.h @@ -79,7 +79,7 @@ struct btrfs_delayed_ref_head { struct mutex mutex; spinlock_t lock; - struct rb_root ref_tree; + struct rb_root_cached ref_tree; /* accumulate add BTRFS_ADD_DELAYED_REF nodes to this ref_add_list. */ struct list_head ref_add_list; |