]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove dead create_space_info calls
authorJeff Mahoney <jeffm@suse.com>
Tue, 20 Mar 2018 19:25:25 +0000 (15:25 -0400)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Mar 2018 23:41:12 +0000 (01:41 +0200)
commit738c4de0c6f98a55e5b4058d05f94d66361ec9ba
tree87f3f93eeae85aa11b53f6e8d26652c27d4632e2
parent1d189be1e7f486de7c981b9ebefb23ccaef6af80
btrfs: remove dead create_space_info calls

Since commit 8b8c6ba7e (btrfs: Separate space_info create/update), we've
separated out the creation and updating of the space info structures.
That commit was a straightforward refactoring of the two parts of
update_space_info, but we can go a step further.  Since commits
7d596be05 (Btrfs: fix OOPS of empty filesystem after balance) and
b58bc2536 (Btrfs: Link block groups of different raid types), we know
that the space_info structures will be created at mount and there will
only ever be, at most, three of them.

This patch cleans out the create_space_info calls after __find_space_info
returns NULL since __find_space_info *can't* return NULL.

The initial cause for reviewing this was the kobject_add calls from
create_space_info occuring in sites where fs-reclaim wasn't allowed.  Now
we are certain they occur only early in the mount process and are safe.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c