All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Myers <bpm@sgi.com>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/4] xfsprogs: Add new field pquotaino to  on disk superblock
Date: Fri, 4 May 2012 11:09:53 -0500	[thread overview]
Message-ID: <20120504160953.GR16881@sgi.com> (raw)
In-Reply-To: <20120123173258.31735.97984.sendpatchset@chandra-lucid.austin.ibm.com>

On Mon, Jan 23, 2012 at 11:32:58AM -0600, Chandra Seetharaman wrote:
> >From e0df4087facfd89e59183f4b8003196396d1a6d3 Mon Sep 17 00:00:00 2001
> From: Chandra Seetharaman <sekharan@us.ibm.com>
> Date: Tue, 13 Dec 2011 16:06:33 -0600
> Subject: [PATCH 2/4] Add a new field sb_pquotino to the on-disk superblock data structure
>  and add accompanying code.
> 
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>

Looking pretty good.  Again, if you could be more specific about what the patch
does in your commit header it'd be helpful.

...

> @@ -174,11 +192,36 @@ xfs_sb_to_disk(
>  	xfs_sb_field_t	f;
>  	int		first;
>  	int		size;
> +	__be16		saved_qflags = 0;
>  
>  	ASSERT(fields);
>  	if (!fields)
>  		return;
>  
> +	if (!xfs_sb_version_hasnooquota(from) &&
> +		    (from->sb_qflags & (XFS_PQUOTA_ENFD | XFS_PQUOTA_CHKD |
> +					XFS_GQUOTA_ENFD | XFS_GQUOTA_CHKD))) {
> +
> +		if (from->sb_qflags & XFS_PQUOTA_ACCT) {
> +			from->sb_gquotino = from->sb_pquotino;
> +			from->sb_pquotino = 0;
> +		}
> +		/*
> +		 * in-core version of qflags do not have XFS_OQUOTA.*, whereas
> +		 * the on-disk version does. So, save the in-core sb_qflags
> +		 * and restore it after we modify and copy it to the buffer
> +		 * to be copied to disk.
> +		 */
> +		saved_qflags = from->sb_qflags;
> +
> +		if (from->sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD))
> +			from->sb_qflags |= XFS_OQUOTA_ENFD;
> +		if (from->sb_qflags & (XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD))
> +			from->sb_qflags |= XFS_OQUOTA_CHKD;
> +		from->sb_qflags &= ~(XFS_PQUOTA_ENFD | XFS_PQUOTA_CHKD |
> +					XFS_GQUOTA_ENFD | XFS_GQUOTA_CHKD);
> + 	}
> +
>  	while (fields) {
>  		f = (xfs_sb_field_t)xfs_lowbit64((__uint64_t)fields);
>  		first = xfs_sb_info[f].offset;
> @@ -209,6 +252,14 @@ xfs_sb_to_disk(
>  
>  		fields &= ~(1LL << f);
>  	}
> +	/* Revert to the old saved values */
> +	if (saved_qflags) {
> +		from->sb_qflags = saved_qflags;
> +		if (from->sb_qflags & XFS_PQUOTA_ACCT) {
> +			from->sb_pquotino = from->sb_gquotino;
> +			from->sb_gquotino = 0;
> +		}
> +	}
>  }
>

I'd really prefer not modifying 'from' temporarily.  If possible use a temporary
variable and do the conversion manually for qflags as you have done in the
kernel.

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

  reply	other threads:[~2012-05-04 16:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 17:32 [PATCH 0/4] xfsprogs: Allow pquota and gquota to be used together Chandra Seetharaman
2012-01-23 17:32 ` [PATCH 1/4] xfsprogs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD Chandra Seetharaman
2012-05-03 20:04   ` Ben Myers
2012-05-03 20:26     ` Chandra Seetharaman
2012-01-23 17:32 ` [PATCH 2/4] xfsprogs: Add new field pquotaino to on disk superblock Chandra Seetharaman
2012-05-04 16:09   ` Ben Myers [this message]
2012-01-23 17:33 ` [PATCH 3/4] xfsprogs: Add qs_pquota to the fs_quota Chandra Seetharaman
2012-05-04 16:32   ` Ben Myers
2012-01-23 17:33 ` [PATCH 4/4] xfsprogs: Add support to mkfs to add pquotino by adding a new option Chandra Seetharaman
2012-05-04 16:47   ` Ben Myers
  -- strict thread matches above, loose matches on Subject: below --
2012-07-20 23:03 [PATCH 0/4] xfsprogs: Allow pquota and gquota to be used together Chandra Seetharaman
2012-07-20 23:04 ` [PATCH 2/4] xfsprogs: Add new field pquotaino to on disk superblock Chandra Seetharaman

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=20120504160953.GR16881@sgi.com \
    --to=bpm@sgi.com \
    --cc=sekharan@us.ibm.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.