Re: [PATCH 2/2] xfs: rename struct xfs_eofblocks to xfs_icwalk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> > 
> > 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@xxxxxxxxxx>
> > ---
> >  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@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux