All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: rename struct xfs_eofblocks to xfs_icwalk
Date: Thu, 3 Jun 2021 14:18:02 -0700	[thread overview]
Message-ID: <20210603211802.GD26380@locust> (raw)
In-Reply-To: <20210603045531.GS664593@dread.disaster.area>

On Thu, Jun 03, 2021 at 02:55:31PM +1000, Dave Chinner wrote:
> On Wed, Jun 02, 2021 at 08:13:05PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > The xfs_eofblocks structure is no longer well-named -- nowadays it
> > provides optional filtering criteria to any walk of the incore inode
> > cache.  Only one of the cache walk goals has anything to do with
> > clearing of speculative post-EOF preallocations, so change the name to
> > be more appropriate.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  fs/xfs/xfs_file.c   |    6 +-
> >  fs/xfs/xfs_icache.c |  154 ++++++++++++++++++++++++++-------------------------
> >  fs/xfs/xfs_icache.h |   14 ++---
> >  fs/xfs/xfs_ioctl.c  |   30 +++++-----
> >  fs/xfs/xfs_trace.h  |   36 ++++++------
> >  5 files changed, 120 insertions(+), 120 deletions(-)
> .....
> > diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> > index 1fe4c1fc0aea..a0fcadb1a04f 100644
> > --- a/fs/xfs/xfs_ioctl.c
> > +++ b/fs/xfs/xfs_ioctl.c
> > @@ -1875,7 +1875,7 @@ xfs_ioc_setlabel(
> >  static inline int
> >  xfs_fs_eofblocks_from_user(
> >  	struct xfs_fs_eofblocks		*src,
> > -	struct xfs_eofblocks		*dst)
> > +	struct xfs_icwalk		*dst)
> >  {
> >  	if (src->eof_version != XFS_EOFBLOCKS_VERSION)
> >  		return -EINVAL;
> > @@ -1887,21 +1887,21 @@ xfs_fs_eofblocks_from_user(
> >  	    memchr_inv(src->pad64, 0, sizeof(src->pad64)))
> >  		return -EINVAL;
> >  
> > -	dst->eof_flags = src->eof_flags;
> > -	dst->eof_prid = src->eof_prid;
> > -	dst->eof_min_file_size = src->eof_min_file_size;
> > +	dst->icw_flags = src->eof_flags;
> > +	dst->icw_prid = src->eof_prid;
> > +	dst->icw_min_file_size = src->eof_min_file_size;
> 
> Ah, ok, that's why the flags were encoded to have the same values as
> the user API - it's just a straight value copy of the field.
> 
> Hmmmm. What happens in future if we've added new internal flags and
> then add a new API flag and they overlap in value? That seems like
> a bit of landmine?

As mentioned in the previous reply, I'll separate them completely then.

	dst->icw_flags = 0;
	if (src->eof_flags & XFS_EOF_FLAGS_SYNC)
		dst->icw_flags |= XFS_ICWALK_FLAG_SYNC;
	if (src->eof_flags & XFS_EOF_FLAGS_UID)
		dst->icw_flags |= XFS_ICWALK_FLAG_UID;
	if (src->eof_flags & XFS_EOF_FLAGS_GID)
		dst->icw_flags |= XFS_ICWALK_FLAG_GID;
	if (src->eof_flags & XFS_EOF_FLAGS_PRID)
		dst->icw_flags |= XFS_ICWALK_FLAG_PRID;
	if (src->eof_flags & XFS_EOF_FLAGS_MINFILESIZE)
		dst->icw_flags |= XFS_ICWALK_FLAG_MINFILESIZE;

--D

> 
> Otherwise the change looks good.
> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

  reply	other threads:[~2021-06-03 21:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  3:12 [PATCHSET 0/2] xfs: rename struct xfs_eofblocks Darrick J. Wong
2021-06-03  3:12 ` [PATCH 1/2] xfs: change the prefix of XFS_EOF_FLAGS_* to XFS_ICWALK_FLAG_ Darrick J. Wong
2021-06-03  4:46   ` Dave Chinner
2021-06-03 21:14     ` Darrick J. Wong
2021-06-03  3:13 ` [PATCH 2/2] xfs: rename struct xfs_eofblocks to xfs_icwalk Darrick J. Wong
2021-06-03  4:55   ` Dave Chinner
2021-06-03 21:18     ` Darrick J. Wong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-06-06 17:54 [PATCHSET v2 0/2] xfs: rename struct xfs_eofblocks Darrick J. Wong
2021-06-06 17:54 ` [PATCH 2/2] xfs: rename struct xfs_eofblocks to xfs_icwalk Darrick J. Wong
2021-06-07  1:47   ` Dave Chinner

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=20210603211802.GD26380@locust \
    --to=djwong@kernel.org \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.