On Fri, Aug 30, 2019 at 12:24:11PM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig <hch@xxxxxx> Looks ok, Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --D > --- > fs/xfs/libxfs/xfs_alloc.h | 7 +++---- > fs/xfs/libxfs/xfs_bmap.c | 8 ++------ > 2 files changed, 5 insertions(+), 10 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h > index d6ed5d2c07c2..58fa85cec325 100644 > --- a/fs/xfs/libxfs/xfs_alloc.h > +++ b/fs/xfs/libxfs/xfs_alloc.h > @@ -81,10 +81,9 @@ typedef struct xfs_alloc_arg { > /* > * Defines for datatype > */ > -#define XFS_ALLOC_USERDATA (1 << 0)/* allocation is for user data*/ > -#define XFS_ALLOC_INITIAL_USER_DATA (1 << 1)/* special case start of file */ > -#define XFS_ALLOC_USERDATA_ZERO (1 << 2)/* zero extent on allocation */ > -#define XFS_ALLOC_NOBUSY (1 << 3)/* Busy extents not allowed */ > +#define XFS_ALLOC_INITIAL_USER_DATA (1 << 0)/* special case start of file */ > +#define XFS_ALLOC_USERDATA_ZERO (1 << 1)/* zero extent on allocation */ > +#define XFS_ALLOC_NOBUSY (1 << 2)/* Busy extents not allowed */ > > static inline bool > xfs_alloc_is_userdata(int datatype) > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c > index 80b25e21e708..054b4ce30033 100644 > --- a/fs/xfs/libxfs/xfs_bmap.c > +++ b/fs/xfs/libxfs/xfs_bmap.c > @@ -4042,12 +4042,8 @@ xfs_bmapi_allocate( > */ > if (!(bma->flags & XFS_BMAPI_METADATA)) { > bma->datatype = XFS_ALLOC_NOBUSY; > - if (whichfork == XFS_DATA_FORK) { > - if (bma->offset == 0) > - bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA; > - else > - bma->datatype |= XFS_ALLOC_USERDATA; > - } > + if (whichfork == XFS_DATA_FORK && bma->offset == 0) > + bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA; > if (bma->flags & XFS_BMAPI_ZERO) > bma->datatype |= XFS_ALLOC_USERDATA_ZERO; > } > -- > 2.20.1 >