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

Commit 9bb54cb5 authored by Dave Chinner's avatar Dave Chinner Committed by Darrick J. Wong
Browse files

xfs: clean up MIN/MAX



Get rid of the MIN/MAX macros and just use the native min/max macros
directly in the XFS code.

Signed-Off-By: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 86210fbe
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -465,7 +465,7 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes)
	 * A data fork btree root must have space for at least
	 * A data fork btree root must have space for at least
	 * MINDBTPTRS key/ptr pairs if the data fork is small or empty.
	 * MINDBTPTRS key/ptr pairs if the data fork is small or empty.
	 */
	 */
	minforkoff = MAX(dsize, XFS_BMDR_SPACE_CALC(MINDBTPTRS));
	minforkoff = max(dsize, XFS_BMDR_SPACE_CALC(MINDBTPTRS));
	minforkoff = roundup(minforkoff, 8) >> 3;
	minforkoff = roundup(minforkoff, 8) >> 3;


	/* attr fork btree root can have at least this many key/ptr pairs */
	/* attr fork btree root can have at least this many key/ptr pairs */
+1 −1
Original line number Original line Diff line number Diff line
@@ -3467,7 +3467,7 @@ xfs_bmap_btalloc(
	xfs_rmap_skip_owner_update(&args.oinfo);
	xfs_rmap_skip_owner_update(&args.oinfo);


	/* Trim the allocation back to the maximum an AG can fit. */
	/* Trim the allocation back to the maximum an AG can fit. */
	args.maxlen = MIN(ap->length, mp->m_ag_max_usable);
	args.maxlen = min(ap->length, mp->m_ag_max_usable);
	args.firstblock = *ap->firstblock;
	args.firstblock = *ap->firstblock;
	blen = 0;
	blen = 0;
	if (nullfb) {
	if (nullfb) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -2081,7 +2081,7 @@ xfs_da_grow_inode_int(
		 */
		 */
		mapp = kmem_alloc(sizeof(*mapp) * count, KM_SLEEP);
		mapp = kmem_alloc(sizeof(*mapp) * count, KM_SLEEP);
		for (b = *bno, mapi = 0; b < *bno + count; ) {
		for (b = *bno, mapi = 0; b < *bno + count; ) {
			nmap = MIN(XFS_BMAP_MAX_NMAP, count);
			nmap = min(XFS_BMAP_MAX_NMAP, count);
			c = (int)(*bno + count - b);
			c = (int)(*bno + count - b);
			error = xfs_bmapi_write(tp, dp, b, c,
			error = xfs_bmapi_write(tp, dp, b, c,
					xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
					xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
+4 −4
Original line number Original line Diff line number Diff line
@@ -502,8 +502,8 @@ xfs_dir2_block_addname(
			if (mid - lowstale)
			if (mid - lowstale)
				memmove(&blp[lowstale], &blp[lowstale + 1],
				memmove(&blp[lowstale], &blp[lowstale + 1],
					(mid - lowstale) * sizeof(*blp));
					(mid - lowstale) * sizeof(*blp));
			lfloglow = MIN(lowstale, lfloglow);
			lfloglow = min(lowstale, lfloglow);
			lfloghigh = MAX(mid, lfloghigh);
			lfloghigh = max(mid, lfloghigh);
		}
		}
		/*
		/*
		 * Move entries toward the high-numbered stale entry.
		 * Move entries toward the high-numbered stale entry.
@@ -514,8 +514,8 @@ xfs_dir2_block_addname(
			if (highstale - mid)
			if (highstale - mid)
				memmove(&blp[mid + 1], &blp[mid],
				memmove(&blp[mid + 1], &blp[mid],
					(highstale - mid) * sizeof(*blp));
					(highstale - mid) * sizeof(*blp));
			lfloglow = MIN(mid, lfloglow);
			lfloglow = min(mid, lfloglow);
			lfloghigh = MAX(highstale, lfloghigh);
			lfloghigh = max(highstale, lfloghigh);
		}
		}
		be32_add_cpu(&btp->stale, -1);
		be32_add_cpu(&btp->stale, -1);
	}
	}
+4 −4
Original line number Original line Diff line number Diff line
@@ -590,8 +590,8 @@ xfs_dir3_leaf_find_entry(
				(index - lowstale - 1) *
				(index - lowstale - 1) *
					sizeof(xfs_dir2_leaf_entry_t));
					sizeof(xfs_dir2_leaf_entry_t));
		}
		}
		*lfloglow = MIN(lowstale, *lfloglow);
		*lfloglow = min(lowstale, *lfloglow);
		*lfloghigh = MAX(index - 1, *lfloghigh);
		*lfloghigh = max(index - 1, *lfloghigh);
		leafhdr->stale--;
		leafhdr->stale--;
		return &ents[index - 1];
		return &ents[index - 1];
	}
	}
@@ -610,8 +610,8 @@ xfs_dir3_leaf_find_entry(
		memmove(&ents[index + 1], &ents[index],
		memmove(&ents[index + 1], &ents[index],
			(highstale - index) * sizeof(xfs_dir2_leaf_entry_t));
			(highstale - index) * sizeof(xfs_dir2_leaf_entry_t));
	}
	}
	*lfloglow = MIN(index, *lfloglow);
	*lfloglow = min(index, *lfloglow);
	*lfloghigh = MAX(highstale, *lfloghigh);
	*lfloghigh = max(highstale, *lfloghigh);
	leafhdr->stale--;
	leafhdr->stale--;
	return &ents[index];
	return &ents[index];
}
}
Loading