summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-ref.h
diff options
context:
space:
mode:
authorLiu Bo2018-08-22 21:51:50 +0200
committerDavid Sterba2018-10-15 17:23:33 +0200
commite3d039656384288bbe952413d8d404b3035fe7d7 (patch)
tree0a1f7bfe1f829f2ba99c938ab0ffb03eb27fa6ac /fs/btrfs/delayed-ref.h
parentBtrfs: delayed-refs: use rb_first_cached for href_root (diff)
downloadkernel-qcow2-linux-e3d039656384288bbe952413d8d404b3035fe7d7.tar.gz
kernel-qcow2-linux-e3d039656384288bbe952413d8d404b3035fe7d7.tar.xz
kernel-qcow2-linux-e3d039656384288bbe952413d8d404b3035fe7d7.zip
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.h2
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;