From: Liu Bo Date: Tue, 29 May 2018 13:27:06 +0000 (+0800) Subject: Btrfs: remove unused check of skip_locking X-Git-Tag: v4.18-rc1~176^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9ddfd0592acf9bf01814e7d1d60134af7fd0a4d;p=thirdparty%2Flinux.git Btrfs: remove unused check of skip_locking The check is superfluous since all callers who set search_for_commit also have skip_locking set. ASSERT() is put in place to ensure skip_locking is set by new callers. Reviewed-by: Qu Wenruo Signed-off-by: Liu Bo Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 973912ec89928..4bc326df472ef 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2619,8 +2619,11 @@ static struct extent_buffer *btrfs_search_slot_get_root(struct btrfs_root *root, level = btrfs_header_level(b); if (p->need_commit_sem) up_read(&fs_info->commit_root_sem); - if (!p->skip_locking) - btrfs_tree_read_lock(b); + /* + * Ensure that all callers have set skip_locking when + * p->search_commit_root = 1. + */ + ASSERT(p->skip_locking == 1); goto out; }