Btrfs: delayed-inode: use rb_first_cached for ins_root and del_root
authorLiu Bo <bo.liu@linux.alibaba.com>
Wed, 22 Aug 2018 19:51:51 +0000 (03:51 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:33 +0000 (17:23 +0200)
commit03a1d4c891634dd5b98da865fb783e8b22d4d027
tree13f08f751243f45acad6274532bc959e2ab37c55
parente3d039656384288bbe952413d8d404b3035fe7d7
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>
fs/btrfs/delayed-inode.c
fs/btrfs/delayed-inode.h