public inbox for linux-xfs@vger.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 3/4] xfsprogs: Add qs_pquota to the fs_quota
Date: Fri, 4 May 2012 11:32:05 -0500	[thread overview]
Message-ID: <20120504163205.GS16881@sgi.com> (raw)
In-Reply-To: <20120123173304.31735.10706.sendpatchset@chandra-lucid.austin.ibm.com>

On Mon, Jan 23, 2012 at 11:33:04AM -0600, Chandra Seetharaman wrote:
> >From 9de21fc22372c3ba65a38e259aa023a74d1cae36 Mon Sep 17 00:00:00 2001
> From: Chandra Seetharaman <sekharan@us.ibm.com>
> Date: Tue, 13 Dec 2011 16:08:19 -0600
> Subject: [PATCH 3/4] Add a new field qs_pquota to the data structure fs_quota_stat and also
>  define a new version for the same.
> 
> Inform the kernel that the data structure is newer one and on return
> from kernel check the version and act accordingly.
> 
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> ---
>  include/xqm.h |    2 ++
>  quota/state.c |    6 +++++-
>  2 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/include/xqm.h b/include/xqm.h
> index 47f58a0..24e1ea0 100644
> --- a/include/xqm.h
> +++ b/include/xqm.h
> @@ -124,6 +124,7 @@ typedef struct fs_disk_quota {
>   * incore.
>   */
>  #define FS_QSTAT_VERSION	1	/* fs_quota_stat.qs_version */
> +#define FS_QSTAT_VERSION_2	2	/* new field qs_pquota */
>  
>  /*
>   * Some basic information about 'quota files'.
> @@ -146,6 +147,7 @@ typedef struct fs_quota_stat {
>  	__s32		qs_rtbtimelimit;/* limit for rt blks timer */
>  	__u16		qs_bwarnlimit;	/* limit for num warnings */
>  	__u16		qs_iwarnlimit;	/* limit for num warnings */
> +	fs_qfilestat_t	qs_pquota;	/* project quota storage information */
>  } fs_quota_stat_t;

Yep, same stuff you did for the kernel.

>  #endif	/* __XQM_H__ */
> diff --git a/quota/state.c b/quota/state.c
> index 42bffc0..678699f 100644
> --- a/quota/state.c
> +++ b/quota/state.c
> @@ -152,6 +152,8 @@ state_quotafile_mount(
>  	fs_quota_stat_t	s;
>  	char		*dev = mount->fs_name;
>  
> +	bzero(&s, sizeof(struct fs_quota_stat));
> +	s.qs_version = FS_QSTAT_VERSION_2;
>  	if (xfsquotactl(XFS_GETQSTAT, dev, type, 0, (void *)&s) < 0) {
>  		if (flags & VERBOSE_FLAG)
>  			fprintf(fp, _("%s quota are not enabled on %s\n"),
> @@ -168,7 +170,9 @@ state_quotafile_mount(
>  				s.qs_flags & XFS_QUOTA_GDQ_ACCT,
>  				s.qs_flags & XFS_QUOTA_GDQ_ENFD);
>  	if (type & XFS_PROJ_QUOTA)
> -		state_qfilestat(fp, mount, XFS_PROJ_QUOTA, &s.qs_gquota,
> +		state_qfilestat(fp, mount, XFS_PROJ_QUOTA, 
> +				(s.qs_version >= FS_QSTAT_VERSION_2) ?
> +				&s.qs_pquota : &s.qs_gquota,
>  				s.qs_flags & XFS_QUOTA_PDQ_ACCT,
>  				s.qs_flags & XFS_QUOTA_PDQ_ENFD);

Ah, nice.  Older kernels which do not have VERSION_2 overwrite qs_version.  You'll do the right thing either way.

Looks good.

Reviewed-by: Ben Myers <bpm@sgi.com>

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

  reply	other threads:[~2012-05-04 16:28 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
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 [this message]
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 3/4] xfsprogs: Add qs_pquota to the fs_quota 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=20120504163205.GS16881@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox