summaryrefslogtreecommitdiff
path: root/fs/btrfs/delayed-inode.h
diff options
context:
space:
mode:
authorLiu Bo <bo.liu@linux.alibaba.com>2018-08-22 22:51:51 +0300
committerDavid Sterba <dsterba@suse.com>2018-10-15 18:23:33 +0300
commit03a1d4c891634dd5b98da865fb783e8b22d4d027 (patch)
tree13f08f751243f45acad6274532bc959e2ab37c55 /fs/btrfs/delayed-inode.h
parente3d039656384288bbe952413d8d404b3035fe7d7 (diff)
downloadlinux-03a1d4c891634dd5b98da865fb783e8b22d4d027.tar.xz
Btrfs: delayed-inode: use rb_first_cached for ins_root and del_root
rb_first_cached() trades an extra pointer "leftmost" for doing the same job as rb_first() but in O(1). Functions manipulating delayed_item need to get the first entry, this converts it 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-inode.h')
-rw-r--r--fs/btrfs/delayed-inode.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
index 33536cd681d4..74ae226ffaf0 100644
--- a/fs/btrfs/delayed-inode.h
+++ b/fs/btrfs/delayed-inode.h
@@ -50,8 +50,8 @@ struct btrfs_delayed_node {
* is waiting to be dealt with by the async worker.
*/
struct list_head p_list;
- struct rb_root ins_root;
- struct rb_root del_root;
+ struct rb_root_cached ins_root;
+ struct rb_root_cached del_root;
struct mutex mutex;
struct btrfs_inode_item inode_item;
refcount_t refs;