public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/3] xfs: consolidate superblock logging functions
Date: Fri, 9 Jan 2015 10:20:30 +1100	[thread overview]
Message-ID: <20150108232030.GL25000@dastard> (raw)
In-Reply-To: <20150108143632.GB33789@bfoster.bfoster>

On Thu, Jan 08, 2015 at 09:36:33AM -0500, Brian Foster wrote:
> On Thu, Jan 08, 2015 at 08:51:04AM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > We now have several superblock loggin functions that are identical
> > except for the transaction reservation and whether it shoul dbe a
> > synchronous transaction or not. Consolidate these all into a single
> > function, a single reserveration and a sync flag and call it
> > xfs_sync_sb().
> > 
> > Also, xfs_mod_sb() is not really a modification function - it's the
> > operation of logging the superblock buffer. hence change the name of
> > it to reflect this.
> > 
> > Note that we have to change the mp->m_update_flags that are passed
> > around at mount time to a boolean simply to indicate a superblock
> > update is needed.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> 
> A question and one other little thing...

[snip]

> >  #define XFS_TRANS_QM_DQCLUSTER		32
> >  #define XFS_TRANS_QM_QINOCREATE		33
> >  #define XFS_TRANS_QM_QUOTAOFF_END	34
> > -#define XFS_TRANS_SB_UNIT		35
> > -#define XFS_TRANS_FSYNC_TS		36
> > -#define	XFS_TRANS_GROWFSRT_ALLOC	37
> > -#define	XFS_TRANS_GROWFSRT_ZERO		38
> > -#define	XFS_TRANS_GROWFSRT_FREE		39
> > -#define	XFS_TRANS_SWAPEXT		40
> > -#define	XFS_TRANS_SB_COUNT		41
> > -#define	XFS_TRANS_CHECKPOINT		42
> > -#define	XFS_TRANS_ICREATE		43
> > -#define	XFS_TRANS_CREATE_TMPFILE	44
> > -#define	XFS_TRANS_TYPE_MAX		44
> > +#define XFS_TRANS_FSYNC_TS		35
> > +#define	XFS_TRANS_GROWFSRT_ALLOC	36
> > +#define	XFS_TRANS_GROWFSRT_ZERO		37
> > +#define	XFS_TRANS_GROWFSRT_FREE		38
> > +#define	XFS_TRANS_SWAPEXT		39
> > +#define	XFS_TRANS_CHECKPOINT		40
> > +#define	XFS_TRANS_ICREATE		41
> > +#define	XFS_TRANS_CREATE_TMPFILE	42
> > +#define	XFS_TRANS_TYPE_MAX		43
> >  /* new transaction types need to be reflected in xfs_logprint(8) */
> >  
> >  #define XFS_TRANS_TYPES \
> > @@ -113,7 +111,6 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops;
> >  	{ XFS_TRANS_SETATTR_SIZE,	"SETATTR_SIZE" }, \
> >  	{ XFS_TRANS_INACTIVE,		"INACTIVE" }, \
> >  	{ XFS_TRANS_CREATE,		"CREATE" }, \
> > -	{ XFS_TRANS_CREATE_TMPFILE,	"CREATE_TMPFILE" }, \
> >  	{ XFS_TRANS_CREATE_TRUNC,	"CREATE_TRUNC" }, \
> >  	{ XFS_TRANS_TRUNCATE_FILE,	"TRUNCATE_FILE" }, \
> >  	{ XFS_TRANS_REMOVE,		"REMOVE" }, \
> > @@ -134,23 +131,23 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops;
> >  	{ XFS_TRANS_ATTR_RM,		"ATTR_RM" }, \
> >  	{ XFS_TRANS_ATTR_FLAG,		"ATTR_FLAG" }, \
> >  	{ XFS_TRANS_CLEAR_AGI_BUCKET,	"CLEAR_AGI_BUCKET" }, \
> > -	{ XFS_TRANS_QM_SBCHANGE,	"QM_SBCHANGE" }, \
> > +	{ XFS_TRANS_SB_CHANGE,		"SBCHANGE" }, \
> > +	{ XFS_TRANS_DUMMY1,		"DUMMY1" }, \
> > +	{ XFS_TRANS_DUMMY2,		"DUMMY2" }, \
> 
> I take it we can't just remove these dummy types, for userspace
> compatibility reasons, right? At least, it looks like logprint could get
> confused if other transaction types inherited these values.

With delayed logging, userspace will never see these as they never
get to disk. Userspace will only ever see checkpoints and unmount
records. My plan is to eventually remove this stuff from the kernel
(it isn['t used anymore except in tracing) and define it in
xfs_logprint in a way that works for current and legacy filesystems.
So for the moment, I'm just making the kernel/user values
consistent.

> > @@ -1574,29 +1574,6 @@ xfs_qm_dqfree_one(
> >  	xfs_qm_dqdestroy(dqp);
> >  }
> >  
> > -/*
> > - * Start a transaction and write the incore superblock changes to
> > - * disk. flags parameter indicates which fields have changed.
> > - */
> > -int
> > -xfs_qm_write_sb_changes(
> 
> This guy still has a function declaration in xfs_qm.h. The rest looks
> good to me:

Good catch, I'll kill it.

> Reviewed-by: Brian Foster <bfoster@redhat.com>

Thanks!

-Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  reply	other threads:[~2015-01-08 23:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 21:51 [PATCH 0/3 v3] xfs: simplify superblock logging Dave Chinner
2015-01-07 21:51 ` [PATCH 1/3] xfs: remove bitfield based superblock updates Dave Chinner
2015-01-09 20:35   ` Brian Foster
2015-01-09 23:36     ` Dave Chinner
2015-01-07 21:51 ` [PATCH 2/3] xfs: consolidate superblock logging functions Dave Chinner
2015-01-08 14:36   ` Brian Foster
2015-01-08 23:20     ` Dave Chinner [this message]
2015-01-07 21:51 ` [PATCH 3/3] xfs: sanitise sb_bad_features2 handling Dave Chinner
2015-01-08 14:36   ` Brian Foster

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=20150108232030.GL25000@dastard \
    --to=david@fromorbit.com \
    --cc=bfoster@redhat.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