Skip to content

Commit f9ddfd0

Browse files
liubogithubkdave
authored andcommitted
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 <wqu@suse.com> Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent d80bb3f commit f9ddfd0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/btrfs/ctree.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,8 +2619,11 @@ static struct extent_buffer *btrfs_search_slot_get_root(struct btrfs_root *root,
26192619
level = btrfs_header_level(b);
26202620
if (p->need_commit_sem)
26212621
up_read(&fs_info->commit_root_sem);
2622-
if (!p->skip_locking)
2623-
btrfs_tree_read_lock(b);
2622+
/*
2623+
* Ensure that all callers have set skip_locking when
2624+
* p->search_commit_root = 1.
2625+
*/
2626+
ASSERT(p->skip_locking == 1);
26242627

26252628
goto out;
26262629
}

0 commit comments

Comments
 (0)