linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: linux-fsdevel@vger.kernel.org, hch@lst.de, darrick.wong@oracle.com
Subject: Re: [PATCH RFC 8/9] Use FIEMAP for FIBMAP calls
Date: Wed, 20 Feb 2019 09:37:12 +0100	[thread overview]
Message-ID: <20190220083712.kuhlibbybrtr3sds@hades.usersys.redhat.com> (raw)
In-Reply-To: <53A529CE-E363-443E-AC2D-30EDE4A50A97@dilger.ca>

> > Comments are much appreciated.
> > 
> > Cheers
> 
> Looks pretty reasonable.  A few minor nits, but nothing serious.

Thanks for the review...

> 
> > diff --git a/fs/inode.c b/fs/inode.c
> > index db681d310465..323dfe3d26fd 100644
> > --- a/fs/inode.c
> > +++ b/fs/inode.c
> > 
> > +static int fiemap_fill_kernel_extent(struct fiemap_extent_info *fieinfo,
> > +			u64 logical, u64 phys, u64 len, u32 flags)
> > +{
> > +
> > +out:
> > +	if (flags & FIEMAP_EXTENT_LAST)
> > +		return 1;
> > +	return 0;
> 
> Why not just the straight return:
> 
>         return !!(flags & FIEMAP_EXTENT_LAST);
> 
> or if this function is only returning 0 or 1 then it could return bool and be:
> 
>         return flags & FIEMAP_EXTENT_LAST;

Christoph asked to leave it on the good if () style :P

> 
> > @@ -1594,10 +1666,14 @@ EXPORT_SYMBOL(iput);
> >  */
> > int bmap(struct inode *inode, sector_t *block)
> > {
> > -	if (!inode->i_mapping->a_ops->bmap)
> > +	if (inode->i_op->fiemap)
> > +		return bmap_fiemap(inode, block);
> > +	else if (inode->i_mapping->a_ops->bmap)
> > +		*block = inode->i_mapping->a_ops->bmap(inode->i_mapping,
> > +						       *block);
> 
> Typically there is no "else" after return.

Makes sense.

> 
> > @@ -113,7 +110,11 @@ int fiemap_fill_user_extent(struct fiemap_extent_info *fieinfo, u64 logical,
> > 	fieinfo->fi_extents_mapped++;
> > 	if (fieinfo->fi_extents_mapped == fieinfo->fi_extents_max)
> > 		return 1;
> > -	return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0;
> > +
> > +out:
> > +	if (flags & FIEMAP_EXTENT_LAST)
> > +		return 1;
> > +	return 0;
> > }
> 
> As above, the simpler code would be:
> 
>         return !!(flags & FIEMAP_EXTENT_LAST);

Same here, discussed on the last thread (I guess)

> 
> Cheers, Andreas

Thanks again for the review



-- 
Carlos

  reply	other threads:[~2019-02-20  8:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 13:03 [PATCH 0/9 V3] New ->fiemap infrastructure and ->bmap removal Carlos Maiolino
2019-02-18 13:03 ` [PATCH 1/9] fs: Enable bmap() function to properly return errors Carlos Maiolino
2019-02-18 13:03 ` [PATCH 2/9] cachefiles: drop direct usage of ->bmap method Carlos Maiolino
2019-02-18 13:03 ` [PATCH 3/9] ecryptfs: drop direct calls to ->bmap Carlos Maiolino
2019-02-18 13:03 ` [PATCH 4/9 V3] fibmap: Use bmap instead of ->bmap method in ioctl_fibmap Carlos Maiolino
2019-02-18 13:03 ` [PATCH 5/9] fs: Move start and length fiemap fields into fiemap_extent_info Carlos Maiolino
2019-02-18 13:03 ` [PATCH 6/9] iomap: Remove length and start fields from iomap_fiemap Carlos Maiolino
2019-02-18 13:03 ` [PATCH 7/9 V3] fiemap: Use a callback to fill fiemap extents Carlos Maiolino
2019-02-18 13:03 ` [PATCH RFC 8/9] Use FIEMAP for FIBMAP calls Carlos Maiolino
2019-02-20  7:01   ` Andreas Dilger
2019-02-20  8:37     ` Carlos Maiolino [this message]
2019-02-18 13:03 ` [PATCH 9/9 V2] xfs: Get rid of ->bmap Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190220083712.kuhlibbybrtr3sds@hades.usersys.redhat.com \
    --to=cmaiolino@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).