Skip to content

Commit

Permalink
xfs: m_maxioffset is redundant
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Eric Sandeen <[email protected]>
Signed-off-by: Ben Myers <[email protected]>
  • Loading branch information
Dave Chinner authored and Ben Myers committed Jun 14, 2012
1 parent 0f2cf9d commit d2c2819
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
12 changes: 6 additions & 6 deletions fs/xfs/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ xfs_map_blocks(

ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE ||
(ip->i_df.if_flags & XFS_IFEXTENTS));
ASSERT(offset <= mp->m_maxioffset);
ASSERT(offset <= mp->m_super->s_maxbytes);

if (offset + count > mp->m_maxioffset)
count = mp->m_maxioffset - offset;
if (offset + count > mp->m_super->s_maxbytes)
count = mp->m_super->s_maxbytes - offset;
end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count);
offset_fsb = XFS_B_TO_FSBT(mp, offset);
error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb,
Expand Down Expand Up @@ -1162,9 +1162,9 @@ __xfs_get_blocks(
lockmode = xfs_ilock_map_shared(ip);
}

ASSERT(offset <= mp->m_maxioffset);
if (offset + size > mp->m_maxioffset)
size = mp->m_maxioffset - offset;
ASSERT(offset <= mp->m_super->s_maxbytes);
if (offset + size > mp->m_super->s_maxbytes)
size = mp->m_super->s_maxbytes - offset;
end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + size);
offset_fsb = XFS_B_TO_FSBT(mp, offset);

Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/xfs_iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ xfs_iomap_write_delay(
* Make sure preallocation does not create extents beyond the range we
* actually support in this filesystem.
*/
if (last_fsb > XFS_B_TO_FSB(mp, mp->m_maxioffset))
last_fsb = XFS_B_TO_FSB(mp, mp->m_maxioffset);
if (last_fsb > XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes))
last_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);

ASSERT(last_fsb > offset_fsb);

Expand Down
2 changes: 0 additions & 2 deletions fs/xfs/xfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,6 @@ xfs_mountfs(

xfs_set_maxicount(mp);

mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog);

error = xfs_uuid_mount(mp);
if (error)
goto out;
Expand Down
3 changes: 1 addition & 2 deletions fs/xfs/xfs_mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ typedef struct xfs_mount {
uint m_qflags; /* quota status flags */
xfs_trans_reservations_t m_reservations;/* precomputed res values */
__uint64_t m_maxicount; /* maximum inode count */
__uint64_t m_maxioffset; /* maximum inode offset */
__uint64_t m_resblks; /* total reserved blocks */
__uint64_t m_resblks_avail;/* available reserved blocks */
__uint64_t m_resblks_save; /* reserved blks @ remount,ro */
Expand Down Expand Up @@ -297,7 +296,7 @@ xfs_preferred_iosize(xfs_mount_t *mp)
PAGE_CACHE_SIZE));
}

#define XFS_MAXIOFFSET(mp) ((mp)->m_maxioffset)
#define XFS_MAXIOFFSET(mp) ((mp)->m_super->s_maxbytes)

#define XFS_LAST_UNMOUNT_WAS_CLEAN(mp) \
((mp)->m_flags & XFS_MOUNT_WAS_CLEAN)
Expand Down

0 comments on commit d2c2819

Please sign in to comment.