public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chandra Seetharaman <sekharan@us.ibm.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v8 4/5] xfs: Add proper versioning support to fs_quota_stat
Date: Tue, 11 Jun 2013 18:13:06 -0500	[thread overview]
Message-ID: <1370992386.22504.27.camel@chandra-dt.ibm.com> (raw)
In-Reply-To: <20130610232722.GF29376@dastard>

On Tue, 2013-06-11 at 09:27 +1000, Dave Chinner wrote:
> On Fri, May 24, 2013 at 05:17:22PM -0500, Chandra Seetharaman wrote:
> > On Fri, 2013-05-17 at 15:10 +1000, Dave Chinner wrote:
> > > On Fri, May 10, 2013 at 04:21:28PM -0500, Chandra Seetharaman wrote:
> > > > Added appropriate pads and code for backward compatibility.
> > > > 
> > > > Copied over the old version as it is different from the newer padded
> > > > version.
> > > > 
> > > > New callers of the system call have to just set the version of the data
> > > > structure being passed, and kernel will fill as much data as requested.
> > > > 
> > > > Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> > > 
> > > This needs to be cc'd to Steve Whitehouse so he's aware that we are
> > > changing the quota interface...
> 
> > > > +/*
> > > > + * Since Version 1 did not have padding at appropriate places,
> > > > + * a new data structure has been defined for the older version to
> > > > + * provide backward compatibility.
> > > > + * Future extentions of this data structure won't require new
> > > > + * data structure definitions as the current one can be extended
> > > > + * with the logic and padding in place now.
> > > > + */
> > > > +#define FS_QSTAT_V1_SIZE	(sizeof(struct fs_quota_stat_v1))
> > > > +#define FS_QSTAT_V2_SIZE	(offsetof(struct fs_quota_stat, qs_pquota) + \
> > > > +					sizeof(fs_qfilestat_t))
> > > 
> > > Just use sizeof(struct fs_quota_stat) as the size. Indeed, for
> > 
> > My thinking w.r.t not making it sizeof (fs_quota_stat) is ...future
> > changes doesn't have to touch the macro definitions of earlier versions,
> > they can define a new macro just by copying the last V?_SIZE macro and
> > changing the last field name.
> 
> If we need a future revision, we can deal with the structure
> differences and versions at that point in time. Second guessing
> unknown future requirements is not necessary. ;)

sure.
> 
> > > future enhancements, maybe we should add 64 bytes of empty space at
> > > the end of the structure....
> > 
> > Since this version is fully backward compatible, I didn't think a future
> > pad was needed. Do you want me to add ?
> 
> We only really need to change the structure version when we change
> input parameters, the size or the shape of the structure being
> passed in from userspace. If we add padding now, then we can expand
> output of the call without needing to bump the version of the
> structure. Old code simply won't know (or care) about the new output
> in the region of the structure it considers empty padding....

Ok. I will all 64 bytes of additional padding at the end.

> 
> Cheers,
> 
> Dave.


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

  reply	other threads:[~2013-06-11 23:13 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 21:21 [PATCH v8 0/5] xfs: Allow pquota and gquota to be used together Chandra Seetharaman
2013-05-10 21:21 ` [PATCH v8 1/5] xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD Chandra Seetharaman
2013-05-13  3:15   ` Jeff Liu
2013-05-14 22:19     ` Chandra Seetharaman
2013-05-17  2:55   ` Dave Chinner
2013-05-24 21:45     ` Chandra Seetharaman
2013-05-10 21:21 ` [PATCH v8 2/5] xfs: Add pquota fields where gquota is used Chandra Seetharaman
2013-05-13  3:59   ` Jeff Liu
2013-05-17  3:01     ` Dave Chinner
2013-05-17  5:40       ` Jeff Liu
2013-05-17 21:15     ` Chandra Seetharaman
2013-05-17  4:23   ` Dave Chinner
2013-05-24 21:57     ` Chandra Seetharaman
2013-06-10 23:17       ` Dave Chinner
2013-06-11 23:08         ` Chandra Seetharaman
2013-05-10 21:21 ` [PATCH v8 3/5] xfs: Start using pquotaino from the superblock Chandra Seetharaman
2013-05-13  4:24   ` Jeff Liu
2013-05-17  4:46   ` Dave Chinner
2013-05-24 22:09     ` Chandra Seetharaman
2013-06-10 23:20       ` Dave Chinner
2013-05-10 21:21 ` [PATCH v8 4/5] xfs: Add proper versioning support to fs_quota_stat Chandra Seetharaman
2013-05-13  4:29   ` Jeff Liu
2013-05-17  5:10   ` Dave Chinner
2013-05-24 22:17     ` Chandra Seetharaman
2013-06-10 23:27       ` Dave Chinner
2013-06-11 23:13         ` Chandra Seetharaman [this message]
2013-05-10 21:21 ` [PATCH v8 5/5] xfs: Use new qs_pquota field in fs_quota_stat for Q_XGETQSTAT Chandra Seetharaman
2013-05-17  5:14   ` Dave Chinner
2013-05-24 22:17     ` 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=1370992386.22504.27.camel@chandra-dt.ibm.com \
    --to=sekharan@us.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox