Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce840429 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: revert 1baa2800 ("xfs: remove the unused XFS_ALLOC_USERDATA flag")

Revert this commit, as it caused periodic regressions in xfs/173 w/
1k blocks.

[1] https://lore.kernel.org/lkml/20190919014602.GN15734@shao2-debian/



Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 583e4eff
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -81,9 +81,10 @@ typedef struct xfs_alloc_arg {
/*
 * Defines for datatype
 */
#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 */
#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 */

static inline bool
xfs_alloc_is_userdata(int datatype)
+6 −2
Original line number Diff line number Diff line
@@ -4042,8 +4042,12 @@ xfs_bmapi_allocate(
	 */
	if (!(bma->flags & XFS_BMAPI_METADATA)) {
		bma->datatype = XFS_ALLOC_NOBUSY;
		if (whichfork == XFS_DATA_FORK && bma->offset == 0)
		if (whichfork == XFS_DATA_FORK) {
			if (bma->offset == 0)
				bma->datatype |= XFS_ALLOC_INITIAL_USER_DATA;
			else
				bma->datatype |= XFS_ALLOC_USERDATA;
		}
		if (bma->flags & XFS_BMAPI_ZERO)
			bma->datatype |= XFS_ALLOC_USERDATA_ZERO;
	}