On Tue, May 21, 2019 at 04:01:36PM +0300, Nikolay Borisov wrote:
>
>
> On 16.05.19 г. 11:47 ч., Johannes Thumshirn wrote:
> > Now that we have already checked for a valid checksum type before calling
> > btrfs_check_super_csum(), it can be simplified even further.
> >
> > While at it get rid of the implicit size assumption of the resulting
> > checksum as well.
> >
> > Signed-off-by: Johannes Thumshirn <jthumshirn@xxxxxxx>
> > Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx>
> >
> > ---
> > Changes to v1:
> > - Check for disk_sb->csum instead of raw buffer (Nikolay)
> > ---
> > fs/btrfs/disk-io.c | 37 +++++++++++++------------------------
> > 1 file changed, 13 insertions(+), 24 deletions(-)
> >
> > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> > index 74937effaed4..edb8bc79b01b 100644
> > --- a/fs/btrfs/disk-io.c
> > +++ b/fs/btrfs/disk-io.c
> > @@ -375,33 +375,22 @@ static int btrfs_check_super_csum(struct btrfs_fs_info *fs_info,
> > {
>
> This function no longer requires the btrfs_fs_info argument so it should
> be removed. While on the topic of refactoring this function - why not
> change it's return type to bool since it can't return anything other
> than 0/1 ?
Patch 11/13 will need fs_info again.
--
Johannes Thumshirn SUSE Labs Filesystems
jthumshirn@xxxxxxx +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850