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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user