From: Eric Sandeen <sandeen@sandeen.net>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/2] xfs: m_maxioffset is redundant
Date: Fri, 08 Jun 2012 09:02:44 -0500 [thread overview]
Message-ID: <4FD20604.7020607@sandeen.net> (raw)
In-Reply-To: <1339134294-11382-2-git-send-email-david@fromorbit.com>
On 6/8/12 12:44 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> 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>
Looks fine to me.
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
> fs/xfs/xfs_aops.c | 12 ++++++------
> fs/xfs/xfs_iomap.c | 4 ++--
> fs/xfs/xfs_mount.c | 2 --
> fs/xfs/xfs_mount.h | 3 +--
> 4 files changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index a1295e5..5f7de20 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -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,
> @@ -1156,9 +1156,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);
>
> diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
> index aadfce6..4590cd1 100644
> --- a/fs/xfs/xfs_iomap.c
> +++ b/fs/xfs/xfs_iomap.c
> @@ -416,8 +416,8 @@ retry:
> * 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);
>
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 536021f..9536fd1 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -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;
> diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
> index 8b89c5a..47c6b3b 100644
> --- a/fs/xfs/xfs_mount.h
> +++ b/fs/xfs/xfs_mount.h
> @@ -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 */
> @@ -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)
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-06-08 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 5:44 [PATCH 0/2] xfs: kill m_maxioffset Dave Chinner
2012-06-08 5:44 ` [PATCH 1/2] xfs: m_maxioffset is redundant Dave Chinner
2012-06-08 14:02 ` Eric Sandeen [this message]
2012-06-08 5:44 ` [PATCH 2/2] xfs: make largest supported offset less shouty Dave Chinner
2012-06-08 14:08 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD20604.7020607@sandeen.net \
--to=sandeen@sandeen.net \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.