]> Git Repo - linux.git/commit
btrfs: Separate space_info create/update
authorNikolay Borisov <[email protected]>
Mon, 22 May 2017 06:35:49 +0000 (09:35 +0300)
committerDavid Sterba <[email protected]>
Mon, 19 Jun 2017 16:26:00 +0000 (18:26 +0200)
commit2be12ef79fe9f5333cb9fadc85ef20b6832a56d7
treece415bb63e2db297a99d78d2242bce5404e985aa
parent555ba411aa33c9241e78ff37afc40f6a33721620
btrfs: Separate space_info create/update

Currently the struct space_info creation code is intermixed in the
udpate_space_info function. There are well-defined points at which the
we actually want to create brand-new space_info structs (e.g. during
mount of the filesystem as well as sometimes when adding/initialising
new chunks). In such cases update_space_info is called with 0 as the
bytes parameter. All of this makes for spaghetti code.

Fix it by factoring out the creation code in a separate
create_space_info structure. This also allows to simplify the internals.
Also remove BUG_ON from do_alloc_chunk since the callers handle errors.
Furthermore it will make the update_space_info function not fail,
allowing us to remove error handling in callers. This will come in a
follow up patch.

Signed-off-by: Nikolay Borisov <[email protected]>
Reviewed-by: Jeff Mahoney <[email protected]>
Reviewed-by: Liu Bo <[email protected]>
Signed-off-by: David Sterba <[email protected]>
fs/btrfs/extent-tree.c
This page took 0.053764 seconds and 4 git commands to generate.