public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Arkadiusz Mi??kiewicz <arekm@maven.pl>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH VER 4] Extend project quotas to support 32bit project identificators.
Date: Wed, 22 Sep 2010 14:42:42 -0400	[thread overview]
Message-ID: <20100922184242.GA9911@infradead.org> (raw)
In-Reply-To: <1285177343-11108-1-git-send-email-arekm@maven.pl>

On Wed, Sep 22, 2010 at 07:42:23PM +0200, Arkadiusz Mi??kiewicz wrote:
>  	if (mask & FSX_PROJID) {
> +		/*
> +		 * Switch on the PROJID32BIT superblock bit when needed
> +		 * (implies also FEATURES2)
> +		 */
> +		if (!xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb) &&
> +				fa->fsx_projid > (__uint16_t)-1)
> +			xfs_addprojid32bit(tp, ip);

Didn't we agree that we want to enable this feature explicitly via
xfs_admin (or mkfs.xfs)?

> diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h
> index 87c2e9d..c03c752 100644
> --- a/fs/xfs/xfs_fs.h
> +++ b/fs/xfs/xfs_fs.h
> @@ -293,9 +293,10 @@ typedef struct xfs_bstat {
>  	__s32		bs_extsize;	/* extent size			*/
>  	__s32		bs_extents;	/* number of extents		*/
>  	__u32		bs_gen;		/* generation count		*/
> -	__u16		bs_projid;	/* project id			*/
> +	__u16		bs_projid_lo;	/* lower part of project id	*/
>  	__u16		bs_forkoff;	/* inode fork offset in bytes	*/
> -	unsigned char	bs_pad[12];	/* pad space, unused		*/
> +	__u16		bs_projid_hi;	/* higher part of project id	*/
> +	unsigned char	bs_pad[10];	/* pad space, unused		*/

Unlike in the inode we can't just rename the lo field here - that would
break the compilation of existing applications.

>  /*
> + * Project quota id helpers
> + */

Maybe add a little comment here that the split is because the projid
historically was just 16 bits on disk?

> +static inline prid_t
> +xfs_get_projid(xfs_inode_t *ip)

Please always use struct xfs_foo instead of xfs_foo_t for new code.

>  	return 0;
>  }
> +
> +/*
> + * Switches on the PROJID32BIT superblock bit
> + * (implies also FEATURES2).
> + */
> +
> +int

No need for a space after the comment.

> +{
> +	spin_lock(&ip->i_mount->m_sb_lock);
> +	if (!xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb)) {

Wedon't need the lock around the check, it's enough if it's inside the
conditional.

> +		xfs_sb_version_addprojid32bit(&ip->i_mount->m_sb);
> +		spin_unlock(&ip->i_mount->m_sb_lock);
> +		xfs_mod_sb(tp,
> +				XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);

Weird formatting?

Otherwise this looks good to me.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2010-09-22 18:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22 17:42 [PATCH VER 4] Extend project quotas to support 32bit project identificators Arkadiusz Miśkiewicz
2010-09-22 17:45 ` [PATCH VER 4] xfsprogs: projid32bit handling Arkadiusz Miśkiewicz
2010-09-22 17:45   ` [PATCH VER 4] xfstests: Quota project id setting overflow Arkadiusz Miśkiewicz
2010-09-22 18:44   ` [PATCH VER 4] xfsprogs: projid32bit handling Christoph Hellwig
2010-09-23 22:57   ` Alex Elder
2010-09-22 18:42 ` Christoph Hellwig [this message]
2010-09-22 19:01   ` [PATCH VER 4] Extend project quotas to support 32bit project identificators Arkadiusz Miskiewicz
2010-09-24  0:37     ` Dave Chinner
2010-09-23 22:51 ` Alex Elder
2010-09-24  0:55   ` Dave Chinner

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=20100922184242.GA9911@infradead.org \
    --to=hch@infradead.org \
    --cc=arekm@maven.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox