diff options
author | Dave Chinner <dchinner@redhat.com> | 2018-06-07 10:54:02 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-08 13:07:52 -0400 |
commit | 9bb54cb56ae8498d35392745f8f050112cec5dcb (patch) | |
tree | 166233a63916ee1c4c38a5470f61f864a2df3ddd | |
parent | 86210fbebae6e60b1158ccd6b47ee7ae1abf5b2c (diff) |
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: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/libxfs/xfs_attr_leaf.c | 2 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 2 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_da_btree.c | 2 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_block.c | 8 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_leaf.c | 8 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_sb.c | 2 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_trans_resv.c | 16 | ||||
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_iomap.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_itable.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_linux.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_super.c | 2 |
15 files changed, 32 insertions, 34 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index cf1504208811..99e0f5749dba 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c | |||
@@ -465,7 +465,7 @@ xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes) | |||
465 | * A data fork btree root must have space for at least | 465 | * A data fork btree root must have space for at least |
466 | * MINDBTPTRS key/ptr pairs if the data fork is small or empty. | 466 | * MINDBTPTRS key/ptr pairs if the data fork is small or empty. |
467 | */ | 467 | */ |
468 | minforkoff = MAX(dsize, XFS_BMDR_SPACE_CALC(MINDBTPTRS)); | 468 | minforkoff = max(dsize, XFS_BMDR_SPACE_CALC(MINDBTPTRS)); |
469 | minforkoff = roundup(minforkoff, 8) >> 3; | 469 | minforkoff = roundup(minforkoff, 8) >> 3; |
470 | 470 | ||
471 | /* attr fork btree root can have at least this many key/ptr pairs */ | 471 | /* attr fork btree root can have at least this many key/ptr pairs */ |
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 3de047eb8209..6a79a07528cf 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c | |||
@@ -3467,7 +3467,7 @@ xfs_bmap_btalloc( | |||
3467 | xfs_rmap_skip_owner_update(&args.oinfo); | 3467 | xfs_rmap_skip_owner_update(&args.oinfo); |
3468 | 3468 | ||
3469 | /* Trim the allocation back to the maximum an AG can fit. */ | 3469 | /* Trim the allocation back to the maximum an AG can fit. */ |
3470 | args.maxlen = MIN(ap->length, mp->m_ag_max_usable); | 3470 | args.maxlen = min(ap->length, mp->m_ag_max_usable); |
3471 | args.firstblock = *ap->firstblock; | 3471 | args.firstblock = *ap->firstblock; |
3472 | blen = 0; | 3472 | blen = 0; |
3473 | if (nullfb) { | 3473 | if (nullfb) { |
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c index 5d5955d1f775..8a301402bbc4 100644 --- a/fs/xfs/libxfs/xfs_da_btree.c +++ b/fs/xfs/libxfs/xfs_da_btree.c | |||
@@ -2081,7 +2081,7 @@ xfs_da_grow_inode_int( | |||
2081 | */ | 2081 | */ |
2082 | mapp = kmem_alloc(sizeof(*mapp) * count, KM_SLEEP); | 2082 | mapp = kmem_alloc(sizeof(*mapp) * count, KM_SLEEP); |
2083 | for (b = *bno, mapi = 0; b < *bno + count; ) { | 2083 | for (b = *bno, mapi = 0; b < *bno + count; ) { |
2084 | nmap = MIN(XFS_BMAP_MAX_NMAP, count); | 2084 | nmap = min(XFS_BMAP_MAX_NMAP, count); |
2085 | c = (int)(*bno + count - b); | 2085 | c = (int)(*bno + count - b); |
2086 | error = xfs_bmapi_write(tp, dp, b, c, | 2086 | error = xfs_bmapi_write(tp, dp, b, c, |
2087 | xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, | 2087 | xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, |
diff --git a/fs/xfs/libxfs/xfs_dir2_block.c b/fs/xfs/libxfs/xfs_dir2_block.c index bac4c93e6381..30ed5919da72 100644 --- a/fs/xfs/libxfs/xfs_dir2_block.c +++ b/fs/xfs/libxfs/xfs_dir2_block.c | |||
@@ -502,8 +502,8 @@ xfs_dir2_block_addname( | |||
502 | if (mid - lowstale) | 502 | if (mid - lowstale) |
503 | memmove(&blp[lowstale], &blp[lowstale + 1], | 503 | memmove(&blp[lowstale], &blp[lowstale + 1], |
504 | (mid - lowstale) * sizeof(*blp)); | 504 | (mid - lowstale) * sizeof(*blp)); |
505 | lfloglow = MIN(lowstale, lfloglow); | 505 | lfloglow = min(lowstale, lfloglow); |
506 | lfloghigh = MAX(mid, lfloghigh); | 506 | lfloghigh = max(mid, lfloghigh); |
507 | } | 507 | } |
508 | /* | 508 | /* |
509 | * Move entries toward the high-numbered stale entry. | 509 | * Move entries toward the high-numbered stale entry. |
@@ -514,8 +514,8 @@ xfs_dir2_block_addname( | |||
514 | if (highstale - mid) | 514 | if (highstale - mid) |
515 | memmove(&blp[mid + 1], &blp[mid], | 515 | memmove(&blp[mid + 1], &blp[mid], |
516 | (highstale - mid) * sizeof(*blp)); | 516 | (highstale - mid) * sizeof(*blp)); |
517 | lfloglow = MIN(mid, lfloglow); | 517 | lfloglow = min(mid, lfloglow); |
518 | lfloghigh = MAX(highstale, lfloghigh); | 518 | lfloghigh = max(highstale, lfloghigh); |
519 | } | 519 | } |
520 | be32_add_cpu(&btp->stale, -1); | 520 | be32_add_cpu(&btp->stale, -1); |
521 | } | 521 | } |
diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c index 728c3428abe3..1728a3e6f5cf 100644 --- a/fs/xfs/libxfs/xfs_dir2_leaf.c +++ b/fs/xfs/libxfs/xfs_dir2_leaf.c | |||
@@ -590,8 +590,8 @@ xfs_dir3_leaf_find_entry( | |||
590 | (index - lowstale - 1) * | 590 | (index - lowstale - 1) * |
591 | sizeof(xfs_dir2_leaf_entry_t)); | 591 | sizeof(xfs_dir2_leaf_entry_t)); |
592 | } | 592 | } |
593 | *lfloglow = MIN(lowstale, *lfloglow); | 593 | *lfloglow = min(lowstale, *lfloglow); |
594 | *lfloghigh = MAX(index - 1, *lfloghigh); | 594 | *lfloghigh = max(index - 1, *lfloghigh); |
595 | leafhdr->stale--; | 595 | leafhdr->stale--; |
596 | return &ents[index - 1]; | 596 | return &ents[index - 1]; |
597 | } | 597 | } |
@@ -610,8 +610,8 @@ xfs_dir3_leaf_find_entry( | |||
610 | memmove(&ents[index + 1], &ents[index], | 610 | memmove(&ents[index + 1], &ents[index], |
611 | (highstale - index) * sizeof(xfs_dir2_leaf_entry_t)); | 611 | (highstale - index) * sizeof(xfs_dir2_leaf_entry_t)); |
612 | } | 612 | } |
613 | *lfloglow = MIN(index, *lfloglow); | 613 | *lfloglow = min(index, *lfloglow); |
614 | *lfloghigh = MAX(highstale, *lfloghigh); | 614 | *lfloghigh = max(highstale, *lfloghigh); |
615 | leafhdr->stale--; | 615 | leafhdr->stale--; |
616 | return &ents[index]; | 616 | return &ents[index]; |
617 | } | 617 | } |
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index a63788661a4c..350119eeaecb 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c | |||
@@ -771,7 +771,7 @@ xfs_sb_mount_common( | |||
771 | mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2; | 771 | mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2; |
772 | 772 | ||
773 | mp->m_bsize = XFS_FSB_TO_BB(mp, 1); | 773 | mp->m_bsize = XFS_FSB_TO_BB(mp, 1); |
774 | mp->m_ialloc_inos = (int)MAX((uint16_t)XFS_INODES_PER_CHUNK, | 774 | mp->m_ialloc_inos = max_t(uint16_t, XFS_INODES_PER_CHUNK, |
775 | sbp->sb_inopblock); | 775 | sbp->sb_inopblock); |
776 | mp->m_ialloc_blks = mp->m_ialloc_inos >> sbp->sb_inopblog; | 776 | mp->m_ialloc_blks = mp->m_ialloc_inos >> sbp->sb_inopblog; |
777 | 777 | ||
diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c index 50c44e3c0bc5..f99a7aefe418 100644 --- a/fs/xfs/libxfs/xfs_trans_resv.c +++ b/fs/xfs/libxfs/xfs_trans_resv.c | |||
@@ -236,7 +236,7 @@ xfs_calc_write_reservation( | |||
236 | struct xfs_mount *mp) | 236 | struct xfs_mount *mp) |
237 | { | 237 | { |
238 | return XFS_DQUOT_LOGRES(mp) + | 238 | return XFS_DQUOT_LOGRES(mp) + |
239 | MAX((xfs_calc_inode_res(mp, 1) + | 239 | max((xfs_calc_inode_res(mp, 1) + |
240 | xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), | 240 | xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), |
241 | XFS_FSB_TO_B(mp, 1)) + | 241 | XFS_FSB_TO_B(mp, 1)) + |
242 | xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) + | 242 | xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) + |
@@ -263,7 +263,7 @@ xfs_calc_itruncate_reservation( | |||
263 | struct xfs_mount *mp) | 263 | struct xfs_mount *mp) |
264 | { | 264 | { |
265 | return XFS_DQUOT_LOGRES(mp) + | 265 | return XFS_DQUOT_LOGRES(mp) + |
266 | MAX((xfs_calc_inode_res(mp, 1) + | 266 | max((xfs_calc_inode_res(mp, 1) + |
267 | xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + 1, | 267 | xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + 1, |
268 | XFS_FSB_TO_B(mp, 1))), | 268 | XFS_FSB_TO_B(mp, 1))), |
269 | (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) + | 269 | (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) + |
@@ -288,7 +288,7 @@ xfs_calc_rename_reservation( | |||
288 | struct xfs_mount *mp) | 288 | struct xfs_mount *mp) |
289 | { | 289 | { |
290 | return XFS_DQUOT_LOGRES(mp) + | 290 | return XFS_DQUOT_LOGRES(mp) + |
291 | MAX((xfs_calc_inode_res(mp, 4) + | 291 | max((xfs_calc_inode_res(mp, 4) + |
292 | xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp), | 292 | xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp), |
293 | XFS_FSB_TO_B(mp, 1))), | 293 | XFS_FSB_TO_B(mp, 1))), |
294 | (xfs_calc_buf_res(7, mp->m_sb.sb_sectsize) + | 294 | (xfs_calc_buf_res(7, mp->m_sb.sb_sectsize) + |
@@ -328,7 +328,7 @@ xfs_calc_link_reservation( | |||
328 | { | 328 | { |
329 | return XFS_DQUOT_LOGRES(mp) + | 329 | return XFS_DQUOT_LOGRES(mp) + |
330 | xfs_calc_iunlink_remove_reservation(mp) + | 330 | xfs_calc_iunlink_remove_reservation(mp) + |
331 | MAX((xfs_calc_inode_res(mp, 2) + | 331 | max((xfs_calc_inode_res(mp, 2) + |
332 | xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp), | 332 | xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp), |
333 | XFS_FSB_TO_B(mp, 1))), | 333 | XFS_FSB_TO_B(mp, 1))), |
334 | (xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) + | 334 | (xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) + |
@@ -366,7 +366,7 @@ xfs_calc_remove_reservation( | |||
366 | { | 366 | { |
367 | return XFS_DQUOT_LOGRES(mp) + | 367 | return XFS_DQUOT_LOGRES(mp) + |
368 | xfs_calc_iunlink_add_reservation(mp) + | 368 | xfs_calc_iunlink_add_reservation(mp) + |
369 | MAX((xfs_calc_inode_res(mp, 1) + | 369 | max((xfs_calc_inode_res(mp, 1) + |
370 | xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp), | 370 | xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp), |
371 | XFS_FSB_TO_B(mp, 1))), | 371 | XFS_FSB_TO_B(mp, 1))), |
372 | (xfs_calc_buf_res(4, mp->m_sb.sb_sectsize) + | 372 | (xfs_calc_buf_res(4, mp->m_sb.sb_sectsize) + |
@@ -424,7 +424,7 @@ STATIC uint | |||
424 | xfs_calc_icreate_reservation(xfs_mount_t *mp) | 424 | xfs_calc_icreate_reservation(xfs_mount_t *mp) |
425 | { | 425 | { |
426 | return XFS_DQUOT_LOGRES(mp) + | 426 | return XFS_DQUOT_LOGRES(mp) + |
427 | MAX(xfs_calc_icreate_resv_alloc(mp), | 427 | max(xfs_calc_icreate_resv_alloc(mp), |
428 | xfs_calc_create_resv_modify(mp)); | 428 | xfs_calc_create_resv_modify(mp)); |
429 | } | 429 | } |
430 | 430 | ||
@@ -632,7 +632,7 @@ STATIC uint | |||
632 | xfs_calc_attrinval_reservation( | 632 | xfs_calc_attrinval_reservation( |
633 | struct xfs_mount *mp) | 633 | struct xfs_mount *mp) |
634 | { | 634 | { |
635 | return MAX((xfs_calc_inode_res(mp, 1) + | 635 | return max((xfs_calc_inode_res(mp, 1) + |
636 | xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK), | 636 | xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK), |
637 | XFS_FSB_TO_B(mp, 1))), | 637 | XFS_FSB_TO_B(mp, 1))), |
638 | (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) + | 638 | (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) + |
@@ -696,7 +696,7 @@ xfs_calc_attrrm_reservation( | |||
696 | struct xfs_mount *mp) | 696 | struct xfs_mount *mp) |
697 | { | 697 | { |
698 | return XFS_DQUOT_LOGRES(mp) + | 698 | return XFS_DQUOT_LOGRES(mp) + |
699 | MAX((xfs_calc_inode_res(mp, 1) + | 699 | max((xfs_calc_inode_res(mp, 1) + |
700 | xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, | 700 | xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, |
701 | XFS_FSB_TO_B(mp, 1)) + | 701 | XFS_FSB_TO_B(mp, 1)) + |
702 | (uint)XFS_FSB_TO_B(mp, | 702 | (uint)XFS_FSB_TO_B(mp, |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 5d18c8089499..1c9d1398980b 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -830,7 +830,7 @@ xfs_buf_item_log_segment( | |||
830 | * of the last bit to be set in this word plus one. | 830 | * of the last bit to be set in this word plus one. |
831 | */ | 831 | */ |
832 | if (bit) { | 832 | if (bit) { |
833 | end_bit = MIN(bit + bits_to_set, (uint)NBWORD); | 833 | end_bit = min(bit + bits_to_set, (uint)NBWORD); |
834 | mask = ((1U << (end_bit - bit)) - 1) << bit; | 834 | mask = ((1U << (end_bit - bit)) - 1) << bit; |
835 | *wordp |= mask; | 835 | *wordp |= mask; |
836 | wordp++; | 836 | wordp++; |
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 99a1a1052885..49f5492eed3b 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -188,7 +188,7 @@ xfs_iomap_write_direct( | |||
188 | goto out_unlock; | 188 | goto out_unlock; |
189 | } else { | 189 | } else { |
190 | if (nmaps && (imap->br_startblock == HOLESTARTBLOCK)) | 190 | if (nmaps && (imap->br_startblock == HOLESTARTBLOCK)) |
191 | last_fsb = MIN(last_fsb, (xfs_fileoff_t) | 191 | last_fsb = min(last_fsb, (xfs_fileoff_t) |
192 | imap->br_blockcount + | 192 | imap->br_blockcount + |
193 | imap->br_startoff); | 193 | imap->br_startoff); |
194 | } | 194 | } |
@@ -476,8 +476,8 @@ xfs_iomap_prealloc_size( | |||
476 | * The shift throttle value is set to the maximum value as determined by | 476 | * The shift throttle value is set to the maximum value as determined by |
477 | * the global low free space values and per-quota low free space values. | 477 | * the global low free space values and per-quota low free space values. |
478 | */ | 478 | */ |
479 | alloc_blocks = MIN(alloc_blocks, qblocks); | 479 | alloc_blocks = min(alloc_blocks, qblocks); |
480 | shift = MAX(shift, qshift); | 480 | shift = max(shift, qshift); |
481 | 481 | ||
482 | if (shift) | 482 | if (shift) |
483 | alloc_blocks >>= shift; | 483 | alloc_blocks >>= shift; |
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index fa405f3a00dc..24f4f1c555b5 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -559,7 +559,7 @@ xfs_inumbers( | |||
559 | *lastino != XFS_AGINO_TO_INO(mp, agno, agino)) | 559 | *lastino != XFS_AGINO_TO_INO(mp, agno, agino)) |
560 | return error; | 560 | return error; |
561 | 561 | ||
562 | bcount = MIN(left, (int)(PAGE_SIZE / sizeof(*buffer))); | 562 | bcount = min(left, (int)(PAGE_SIZE / sizeof(*buffer))); |
563 | buffer = kmem_zalloc(bcount * sizeof(*buffer), KM_SLEEP); | 563 | buffer = kmem_zalloc(bcount * sizeof(*buffer), KM_SLEEP); |
564 | do { | 564 | do { |
565 | struct xfs_inobt_rec_incore r; | 565 | struct xfs_inobt_rec_incore r; |
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index 1631cf4546f2..0fcb6295aa5d 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h | |||
@@ -140,8 +140,6 @@ typedef __u32 xfs_nlink_t; | |||
140 | 140 | ||
141 | #define XFS_PROJID_DEFAULT 0 | 141 | #define XFS_PROJID_DEFAULT 0 |
142 | 142 | ||
143 | #define MIN(a,b) (min(a,b)) | ||
144 | #define MAX(a,b) (max(a,b)) | ||
145 | #define howmany(x, y) (((x)+((y)-1))/(y)) | 143 | #define howmany(x, y) (((x)+((y)-1))/(y)) |
146 | 144 | ||
147 | static inline void delay(long ticks) | 145 | static inline void delay(long ticks) |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index e630778c08b6..5e56f3b93d4b 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1629,8 +1629,8 @@ xlog_grant_push_ail( | |||
1629 | * log, and 256 blocks. | 1629 | * log, and 256 blocks. |
1630 | */ | 1630 | */ |
1631 | free_threshold = BTOBB(need_bytes); | 1631 | free_threshold = BTOBB(need_bytes); |
1632 | free_threshold = MAX(free_threshold, (log->l_logBBsize >> 2)); | 1632 | free_threshold = max(free_threshold, (log->l_logBBsize >> 2)); |
1633 | free_threshold = MAX(free_threshold, 256); | 1633 | free_threshold = max(free_threshold, 256); |
1634 | if (free_blocks >= free_threshold) | 1634 | if (free_blocks >= free_threshold) |
1635 | return; | 1635 | return; |
1636 | 1636 | ||
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 7d897c58b0c8..b1aedf73d09d 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -1804,7 +1804,7 @@ xlog_clear_stale_blocks( | |||
1804 | * we don't waste all day writing from the head to the tail | 1804 | * we don't waste all day writing from the head to the tail |
1805 | * for no reason. | 1805 | * for no reason. |
1806 | */ | 1806 | */ |
1807 | max_distance = MIN(max_distance, tail_distance); | 1807 | max_distance = min(max_distance, tail_distance); |
1808 | 1808 | ||
1809 | if ((head_block + max_distance) <= log->l_logBBsize) { | 1809 | if ((head_block + max_distance) <= log->l_logBBsize) { |
1810 | /* | 1810 | /* |
@@ -2872,14 +2872,14 @@ xlog_recover_buffer_pass2( | |||
2872 | * buffers in the log can be a different size if the log was generated | 2872 | * buffers in the log can be a different size if the log was generated |
2873 | * by an older kernel using unclustered inode buffers or a newer kernel | 2873 | * by an older kernel using unclustered inode buffers or a newer kernel |
2874 | * running with a different inode cluster size. Regardless, if the | 2874 | * running with a different inode cluster size. Regardless, if the |
2875 | * the inode buffer size isn't MAX(blocksize, mp->m_inode_cluster_size) | 2875 | * the inode buffer size isn't max(blocksize, mp->m_inode_cluster_size) |
2876 | * for *our* value of mp->m_inode_cluster_size, then we need to keep | 2876 | * for *our* value of mp->m_inode_cluster_size, then we need to keep |
2877 | * the buffer out of the buffer cache so that the buffer won't | 2877 | * the buffer out of the buffer cache so that the buffer won't |
2878 | * overlap with future reads of those inodes. | 2878 | * overlap with future reads of those inodes. |
2879 | */ | 2879 | */ |
2880 | if (XFS_DINODE_MAGIC == | 2880 | if (XFS_DINODE_MAGIC == |
2881 | be16_to_cpu(*((__be16 *)xfs_buf_offset(bp, 0))) && | 2881 | be16_to_cpu(*((__be16 *)xfs_buf_offset(bp, 0))) && |
2882 | (BBTOB(bp->b_io_length) != MAX(log->l_mp->m_sb.sb_blocksize, | 2882 | (BBTOB(bp->b_io_length) != max(log->l_mp->m_sb.sb_blocksize, |
2883 | (uint32_t)log->l_mp->m_inode_cluster_size))) { | 2883 | (uint32_t)log->l_mp->m_inode_cluster_size))) { |
2884 | xfs_buf_stale(bp); | 2884 | xfs_buf_stale(bp); |
2885 | error = xfs_bwrite(bp); | 2885 | error = xfs_bwrite(bp); |
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 7f3d5e012ba3..245349d1e23f 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -271,7 +271,7 @@ xfs_preferred_iosize(xfs_mount_t *mp) | |||
271 | return (mp->m_swidth ? | 271 | return (mp->m_swidth ? |
272 | (mp->m_swidth << mp->m_sb.sb_blocklog) : | 272 | (mp->m_swidth << mp->m_sb.sb_blocklog) : |
273 | ((mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) ? | 273 | ((mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) ? |
274 | (1 << (int)MAX(mp->m_readio_log, mp->m_writeio_log)) : | 274 | (1 << (int)max(mp->m_readio_log, mp->m_writeio_log)) : |
275 | PAGE_SIZE)); | 275 | PAGE_SIZE)); |
276 | } | 276 | } |
277 | 277 | ||
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index d55435e94ea3..7c4813a4a9af 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -1136,7 +1136,7 @@ xfs_fs_statfs( | |||
1136 | statp->f_bavail = statp->f_bfree; | 1136 | statp->f_bavail = statp->f_bfree; |
1137 | 1137 | ||
1138 | fakeinos = statp->f_bfree << sbp->sb_inopblog; | 1138 | fakeinos = statp->f_bfree << sbp->sb_inopblog; |
1139 | statp->f_files = MIN(icount + fakeinos, (uint64_t)XFS_MAXINUMBER); | 1139 | statp->f_files = min(icount + fakeinos, (uint64_t)XFS_MAXINUMBER); |
1140 | if (mp->m_maxicount) | 1140 | if (mp->m_maxicount) |
1141 | statp->f_files = min_t(typeof(statp->f_files), | 1141 | statp->f_files = min_t(typeof(statp->f_files), |
1142 | statp->f_files, | 1142 | statp->f_files, |