btrfs: Refactor btrfs_check_super_valid
authorQu Wenruo <wqu@suse.com>
Fri, 11 May 2018 05:35:26 +0000 (13:35 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:36 +0000 (18:07 +0200)
commit069ec957c35e03ba3beb40973379899cfdbf1ee1
treed70836a06d9d96d1877b5de23747ac04e918be46
parent21a852b01820bdb543df2728cf2f39ecf565255d
btrfs: Refactor btrfs_check_super_valid

Refactor btrfs_check_super_valid:

1) Rename it to btrfs_validate_mount_super()
   Now it's more obvious when the function should be called.

2) Extract core check routine into validate_super()
   Later write time check can reuse it, and if needed, we could also
   use validate_super() to check each super block.

3) Add more comments about btrfs_validate_mount_super()
   Mostly about what it doesn't check and when it should be called.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ rename to validate_super ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c