aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-06-08 01:44:54 -0400
committerBen Myers <bpm@sgi.com>2012-06-14 13:28:24 -0400
commit32972383ca46223aa2b129826b3789721ec147aa (patch)
tree11750ff77efd52b933bb1531b0129eb32597fff8 /fs/xfs
parentd2c2819117176e139dc761873c664aaa770c79c9 (diff)
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>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_bmap.c2
-rw-r--r--fs/xfs/xfs_file.c2
-rw-r--r--fs/xfs/xfs_inode.c2
-rw-r--r--fs/xfs/xfs_iomap.c2
-rw-r--r--fs/xfs/xfs_mount.h2
-rw-r--r--fs/xfs/xfs_qm.c2
-rw-r--r--fs/xfs/xfs_vnodeops.c10
7 files changed, 10 insertions, 12 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 58b815ec8c91..848ffa77707b 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -5517,7 +5517,7 @@ xfs_getbmap(
5517 if (xfs_get_extsz_hint(ip) || 5517 if (xfs_get_extsz_hint(ip) ||
5518 ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC|XFS_DIFLAG_APPEND)){ 5518 ip->i_d.di_flags & (XFS_DIFLAG_PREALLOC|XFS_DIFLAG_APPEND)){
5519 prealloced = 1; 5519 prealloced = 1;
5520 fixlen = XFS_MAXIOFFSET(mp); 5520 fixlen = mp->m_super->s_maxbytes;
5521 } else { 5521 } else {
5522 prealloced = 0; 5522 prealloced = 0;
5523 fixlen = XFS_ISIZE(ip); 5523 fixlen = XFS_ISIZE(ip);
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 9f7ec15a6522..59e22c989cd4 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -273,7 +273,7 @@ xfs_file_aio_read(
273 } 273 }
274 } 274 }
275 275
276 n = XFS_MAXIOFFSET(mp) - iocb->ki_pos; 276 n = mp->m_super->s_maxbytes - iocb->ki_pos;
277 if (n <= 0 || size == 0) 277 if (n <= 0 || size == 0)
278 return 0; 278 return 0;
279 279
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index a59eea09930a..257f3c463e0e 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1226,7 +1226,7 @@ xfs_itruncate_extents(
1226 * then there is nothing to do. 1226 * then there is nothing to do.
1227 */ 1227 */
1228 first_unmap_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size); 1228 first_unmap_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size);
1229 last_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); 1229 last_block = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
1230 if (first_unmap_block == last_block) 1230 if (first_unmap_block == last_block)
1231 return 0; 1231 return 0;
1232 1232
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 4590cd1da432..915edf6639f0 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -285,7 +285,7 @@ xfs_iomap_eof_want_preallocate(
285 * do any speculative allocation. 285 * do any speculative allocation.
286 */ 286 */
287 start_fsb = XFS_B_TO_FSBT(mp, ((xfs_ufsize_t)(offset + count - 1))); 287 start_fsb = XFS_B_TO_FSBT(mp, ((xfs_ufsize_t)(offset + count - 1)));
288 count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); 288 count_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
289 while (count_fsb > 0) { 289 while (count_fsb > 0) {
290 imaps = nimaps; 290 imaps = nimaps;
291 firstblock = NULLFSBLOCK; 291 firstblock = NULLFSBLOCK;
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 47c6b3b3eb9c..90a45305407d 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -296,8 +296,6 @@ xfs_preferred_iosize(xfs_mount_t *mp)
296 PAGE_CACHE_SIZE)); 296 PAGE_CACHE_SIZE));
297} 297}
298 298
299#define XFS_MAXIOFFSET(mp) ((mp)->m_super->s_maxbytes)
300
301#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \ 299#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \
302 ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN) 300 ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN)
303#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) 301#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 249db1987764..2e86fa0cfc0d 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -940,7 +940,7 @@ xfs_qm_dqiterate(
940 map = kmem_alloc(XFS_DQITER_MAP_SIZE * sizeof(*map), KM_SLEEP); 940 map = kmem_alloc(XFS_DQITER_MAP_SIZE * sizeof(*map), KM_SLEEP);
941 941
942 lblkno = 0; 942 lblkno = 0;
943 maxlblkcnt = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); 943 maxlblkcnt = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
944 do { 944 do {
945 nmaps = XFS_DQITER_MAP_SIZE; 945 nmaps = XFS_DQITER_MAP_SIZE;
946 /* 946 /*
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index b6a82d817a82..c22f4e0ecac1 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -174,7 +174,7 @@ xfs_free_eofblocks(
174 * of the file. If not, then there is nothing to do. 174 * of the file. If not, then there is nothing to do.
175 */ 175 */
176 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_ISIZE(ip)); 176 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_ISIZE(ip));
177 last_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp)); 177 last_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
178 if (last_fsb <= end_fsb) 178 if (last_fsb <= end_fsb)
179 return 0; 179 return 0;
180 map_len = last_fsb - end_fsb; 180 map_len = last_fsb - end_fsb;
@@ -2262,10 +2262,10 @@ xfs_change_file_space(
2262 2262
2263 llen = bf->l_len > 0 ? bf->l_len - 1 : bf->l_len; 2263 llen = bf->l_len > 0 ? bf->l_len - 1 : bf->l_len;
2264 2264
2265 if ( (bf->l_start < 0) 2265 if (bf->l_start < 0 ||
2266 || (bf->l_start > XFS_MAXIOFFSET(mp)) 2266 bf->l_start > mp->m_super->s_maxbytes ||
2267 || (bf->l_start + llen < 0) 2267 bf->l_start + llen < 0 ||
2268 || (bf->l_start + llen > XFS_MAXIOFFSET(mp))) 2268 bf->l_start + llen > mp->m_super->s_maxbytes)
2269 return XFS_ERROR(EINVAL); 2269 return XFS_ERROR(EINVAL);
2270 2270
2271 bf->l_whence = 0; 2271 bf->l_whence = 0;