From: bpm@sgi.com
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] commit_metadata export operation and nfsd_sync2
Date: Wed, 10 Feb 2010 13:53:43 -0600 [thread overview]
Message-ID: <20100210195343.GI23654@sgi.com> (raw)
In-Reply-To: <20100210085614.GA21875@infradead.org>
Hey Christoph,
Thanks for the suggestions.
On Wed, Feb 10, 2010 at 03:56:14AM -0500, Christoph Hellwig wrote:
> A better calling convention would be for the first paramter to
> always be non-zero (and we could take the file handle for that one),
Yeah that works out much nicer.
> Currently the only caller passing a NULL first argument is
> nfsd_setattr. If we use ->write_inode as fallback we could just
> pass it as first, if using ->fsync we'd need to take i_mutex before,
> but we might just stick to using ->write_inode to keep things
> simple (and get rid of the NULL file pointer in ->fsync).
>
> > + if (export_ops->commit_metadata) {
> > + if (parent)
> > + error = filemap_write_and_wait(p_inode->i_mapping);
> > + if (child)
> > + error2 = filemap_write_and_wait(c_inode->i_mapping);
>
> I think Trond explained that we do not want force data to disk here.
Thought so. I was making an effort to punch all the same buttons as
before so that behavior wouldn't change for filesystems other than xfs
until they're ready.
> > + if (parent) {
> > + error = filemap_write_and_wait(p_inode->i_mapping);
> > + if (!error && p_inode->i_fop->fsync)
> > + error = p_inode->i_fop->fsync(NULL, parent, 0);
> > + }
> > + if (child)
> > + write_inode_now(c_inode, 1);
> > + }
>
> Btw, as we don't need to write data to disk this should be a
> sync_inode calls with the following second argument:
>
> struct writeback_control wbc = {
> .sync_mode = WB_SYNC_ALL,
> .nr_to_write = 0, /* metadata-only */
> };
So, uh, are you suggesting that I use file_operations.fsync,
write_inode_now, vfs_fsync, write_inode, sync_inode, or
super_operations.write_inode? Would it be good to stay away from the
inode_lock?
-Ben
next prev parent reply other threads:[~2010-02-10 19:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-10 0:33 [RFC PATCH 0/2] nfsd sync export_op (was 'wsync export option') Ben Myers
2010-02-10 0:33 ` [RFC PATCH 1/2] commit_metadata export operation and nfsd_sync2 Ben Myers
2010-02-10 8:56 ` Christoph Hellwig
2010-02-10 19:53 ` bpm [this message]
2010-02-10 21:56 ` Christoph Hellwig
2010-02-10 0:33 ` [RFC PATCH 2/2] xfs_export_operations.commit_metadata Ben Myers
2010-02-10 9:07 ` Christoph Hellwig
2010-02-10 10:11 ` Christoph Hellwig
2010-02-10 20:15 ` bpm
2010-02-10 21:29 ` Dave Chinner
2010-02-10 21:57 ` Christoph Hellwig
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=20100210195343.GI23654@sgi.com \
--to=bpm@sgi.com \
--cc=hch@infradead.org \
--cc=linux-nfs@vger.kernel.org \
/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