aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-06-08 01:44:53 -0400
committerBen Myers <bpm@sgi.com>2012-06-14 13:28:22 -0400
commitd2c2819117176e139dc761873c664aaa770c79c9 (patch)
tree03c64c1d3f21f8628ca313b276ce327a3c012549 /fs/xfs
parent0f2cf9d3d917b269645902506adaa4ff92b5e506 (diff)
xfs: m_maxioffset is redundant
The m_maxioffset field in the struct xfs_mount contains the same value as the superblock s_maxbytes field. There is no need to carry two copies of this limit around, so use the VFS superblock version. 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_aops.c12
-rw-r--r--fs/xfs/xfs_iomap.c4
-rw-r--r--fs/xfs/xfs_mount.c2
-rw-r--r--fs/xfs/xfs_mount.h3
4 files changed, 9 insertions, 12 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 8dad722c0041..84e372596d56 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -323,10 +323,10 @@ xfs_map_blocks(
323 323
324 ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || 324 ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE ||
325 (ip->i_df.if_flags & XFS_IFEXTENTS)); 325 (ip->i_df.if_flags & XFS_IFEXTENTS));
326 ASSERT(offset <= mp->m_maxioffset); 326 ASSERT(offset <= mp->m_super->s_maxbytes);
327 327
328 if (offset + count > mp->m_maxioffset) 328 if (offset + count > mp->m_super->s_maxbytes)
329 count = mp->m_maxioffset - offset; 329 count = mp->m_super->s_maxbytes - offset;
330 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count); 330 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count);
331 offset_fsb = XFS_B_TO_FSBT(mp, offset); 331 offset_fsb = XFS_B_TO_FSBT(mp, offset);
332 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, 332 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb,
@@ -1162,9 +1162,9 @@ __xfs_get_blocks(
1162 lockmode = xfs_ilock_map_shared(ip); 1162 lockmode = xfs_ilock_map_shared(ip);
1163 } 1163 }
1164 1164
1165 ASSERT(offset <= mp->m_maxioffset); 1165 ASSERT(offset <= mp->m_super->s_maxbytes);
1166 if (offset + size > mp->m_maxioffset) 1166 if (offset + size > mp->m_super->s_maxbytes)
1167 size = mp->m_maxioffset - offset; 1167 size = mp->m_super->s_maxbytes - offset;
1168 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + size); 1168 end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + size);
1169 offset_fsb = XFS_B_TO_FSBT(mp, offset); 1169 offset_fsb = XFS_B_TO_FSBT(mp, offset);
1170 1170
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index aadfce6681ee..4590cd1da432 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -416,8 +416,8 @@ retry:
416 * Make sure preallocation does not create extents beyond the range we 416 * Make sure preallocation does not create extents beyond the range we
417 * actually support in this filesystem. 417 * actually support in this filesystem.
418 */ 418 */
419 if (last_fsb > XFS_B_TO_FSB(mp, mp->m_maxioffset)) 419 if (last_fsb > XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes))
420 last_fsb = XFS_B_TO_FSB(mp, mp->m_maxioffset); 420 last_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
421 421
422 ASSERT(last_fsb > offset_fsb); 422 ASSERT(last_fsb > offset_fsb);
423 423
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 536021fb3d4e..9536fd190191 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1200,8 +1200,6 @@ xfs_mountfs(
1200 1200
1201 xfs_set_maxicount(mp); 1201 xfs_set_maxicount(mp);
1202 1202
1203 mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog);
1204
1205 error = xfs_uuid_mount(mp); 1203 error = xfs_uuid_mount(mp);
1206 if (error) 1204 if (error)
1207 goto out; 1205 goto out;
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 8b89c5ac72d9..47c6b3b3eb9c 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -176,7 +176,6 @@ typedef struct xfs_mount {
176 uint m_qflags; /* quota status flags */ 176 uint m_qflags; /* quota status flags */
177 xfs_trans_reservations_t m_reservations;/* precomputed res values */ 177 xfs_trans_reservations_t m_reservations;/* precomputed res values */
178 __uint64_t m_maxicount; /* maximum inode count */ 178 __uint64_t m_maxicount; /* maximum inode count */
179 __uint64_t m_maxioffset; /* maximum inode offset */
180 __uint64_t m_resblks; /* total reserved blocks */ 179 __uint64_t m_resblks; /* total reserved blocks */
181 __uint64_t m_resblks_avail;/* available reserved blocks */ 180 __uint64_t m_resblks_avail;/* available reserved blocks */
182 __uint64_t m_resblks_save; /* reserved blks @ remount,ro */ 181 __uint64_t m_resblks_save; /* reserved blks @ remount,ro */
@@ -297,7 +296,7 @@ xfs_preferred_iosize(xfs_mount_t *mp)
297 PAGE_CACHE_SIZE)); 296 PAGE_CACHE_SIZE));
298} 297}
299 298
300#define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset) 299#define XFS_MAXIOFFSET(mp) ((mp)->m_super->s_maxbytes)
301 300
302#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \ 301#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \
303 ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN) 302 ((mp)->m_flags & XFS_MOUNT_WAS_CLEAN)