From: Nikolay Borisov Date: Wed, 15 Aug 2018 15:26:53 +0000 (+0300) Subject: btrfs: Remove redundant extent_buffer_get in get_old_root X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6c122e2a0c515cfb3f3a9cefb5dad4cb62109c78;p=linux.git btrfs: Remove redundant extent_buffer_get in get_old_root get_old_root used used only by btrfs_search_old_slot to initialise the path structure. The old root is always a cloned buffer (either via alloc dummy or via btrfs_clone_extent_buffer) and its reference count is 2: 1 from allocation, 1 from extent_buffer_get call in get_old_root. This latter explicit ref count acquire operation is in fact unnecessary since the semantic is such that the newly allocated buffer is handed over to the btrfs_path for lifetime management. Considering this just remove the extra extent_buffer_get in get_old_root. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 539901fb51650..0c5ece3fe7412 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1362,7 +1362,6 @@ get_old_root(struct btrfs_root *root, u64 time_seq) if (!eb) return NULL; - extent_buffer_get(eb); btrfs_tree_read_lock(eb); if (old_root) { btrfs_set_header_bytenr(eb, eb->start);