xfs: make largest supported offset less shouty

XFS_MAXIOFFSET() is just a simple macro that resolves to
mp->m_maxioffset. It doesn't need to exist, and it just makes the
code unnecessarily loud and shouty.

Make it quiet and easy to read.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
This commit is contained in:
Dave Chinner 2012-06-08 15:44:54 +10:00 committed by Ben Myers
parent d2c2819117
commit 32972383ca
7 changed files with 10 additions and 12 deletions

View file

@ -5517,7 +5517,7 @@ xfs_getbmap(
if (xfs_get_extsz_hint(ip) || if (xfs_get_extsz_hint(ip) ||
ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC|XFS_DIFLAG_APPEND)){ ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC|XFS_DIFLAG_APPEND)){
prealloced = 1; prealloced = 1;
fixlen = XFS_MAXIOFFSET(mp); fixlen = mp->m_super->s_maxbytes;
} else { } else {
prealloced = 0; prealloced = 0;
fixlen = XFS_ISIZE(ip); fixlen = XFS_ISIZE(ip);

View file

@ -273,7 +273,7 @@ xfs_file_aio_read(
} }
} }
n = XFS_MAXIOFFSET(mp) - iocb->ki_pos; n = mp->m_super->s_maxbytes - iocb->ki_pos;
if (n <= 0 || size == 0) if (n <= 0 || size == 0)
return 0; return 0;

View file

@ -1226,7 +1226,7 @@ xfs_itruncate_extents(
* then there is nothing to do. * then there is nothing to do.
*/ */
first_unmap_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size); first_unmap_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size);
last_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); last_block = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
if (first_unmap_block == last_block) if (first_unmap_block == last_block)
return 0; return 0;

View file

@ -285,7 +285,7 @@ xfs_iomap_eof_want_preallocate(
* do any speculative allocation. * do any speculative allocation.
*/ */
start_fsb = XFS_B_TO_FSBT(mp, ((xfs_ufsize_t)(offset + count - 1))); start_fsb = XFS_B_TO_FSBT(mp, ((xfs_ufsize_t)(offset + count - 1)));
count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); count_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
while (count_fsb > 0) { while (count_fsb > 0) {
imaps = nimaps; imaps = nimaps;
firstblock = NULLFSBLOCK; firstblock = NULLFSBLOCK;

View file

@ -296,8 +296,6 @@ xfs_preferred_iosize(xfs_mount_t *mp)
PAGE_CACHE_SIZE)); PAGE_CACHE_SIZE));
} }
#define XFS_MAXIOFFSET(mp) ((mp)->m_super->s_maxbytes)
#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \ #define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \
((mp)->m_flags & XFS_MOUNT_WAS_CLEAN) ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN)
#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)

View file

@ -940,7 +940,7 @@ xfs_qm_dqiterate(
map = kmem_alloc(XFS_DQITER_MAP_SIZE * sizeof(*map), KM_SLEEP); map = kmem_alloc(XFS_DQITER_MAP_SIZE * sizeof(*map), KM_SLEEP);
lblkno = 0; lblkno = 0;
maxlblkcnt = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); maxlblkcnt = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
do { do {
nmaps = XFS_DQITER_MAP_SIZE; nmaps = XFS_DQITER_MAP_SIZE;
/* /*

View file

@ -174,7 +174,7 @@ xfs_free_eofblocks(
* of the file. If not, then there is nothing to do. * of the file. If not, then there is nothing to do.
*/ */
end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_ISIZE(ip)); end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_ISIZE(ip));
last_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); last_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
if (last_fsb <= end_fsb) if (last_fsb <= end_fsb)
return 0; return 0;
map_len = last_fsb - end_fsb; map_len = last_fsb - end_fsb;
@ -2262,10 +2262,10 @@ xfs_change_file_space(
llen = bf->l_len > 0 ? bf->l_len - 1 : bf->l_len; llen = bf->l_len > 0 ? bf->l_len - 1 : bf->l_len;
if ( (bf->l_start < 0) if (bf->l_start < 0 ||
|| (bf->l_start > XFS_MAXIOFFSET(mp)) bf->l_start > mp->m_super->s_maxbytes ||
|| (bf->l_start + llen < 0) bf->l_start + llen < 0 ||
|| (bf->l_start + llen > XFS_MAXIOFFSET(mp))) bf->l_start + llen > mp->m_super->s_maxbytes)
return XFS_ERROR(EINVAL); return XFS_ERROR(EINVAL);
bf->l_whence = 0; bf->l_whence = 0;