提交 922f0518 编写于 作者: N Nikolay Borisov 提交者: David Sterba

btrfs: streamline code in run_delalloc_nocow in case of inline extents

The extent range check right after the "out_check" label is redundant,
because the only way it can trigger is if we have an inline extent. In
this case it makes more sense to actually move it in the branch
explictly dealing with inlines extents.

What's more, the nested 'if (nocow)' can never be true because for
inline extents we always do COW and there is no chance 'nocow' can be
true, just remove that check.
Signed-off-by: NNikolay Borisov <nborisov@suse.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 bb55f626
......@@ -1507,17 +1507,15 @@ static noinline int run_delalloc_nocow(struct inode *inode,
btrfs_file_extent_ram_bytes(leaf, fi);
extent_end = ALIGN(extent_end,
fs_info->sectorsize);
/* Skip extents outside of our requested range */
if (extent_end <= start) {
path->slots[0]++;
goto next_slot;
}
} else {
BUG();
}
out_check:
/* Skip extents outside of our requested range */
if (extent_end <= start) {
path->slots[0]++;
if (nocow)
btrfs_dec_nocow_writers(fs_info, disk_bytenr);
goto next_slot;
}
/*
* If nocow is false then record the beginning of the range
* that needs to be COWed
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册