From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: [GFS2] Don't flush everything on fdatasync [70/70]
Date: Fri, 01 Dec 2006 10:58:58 +0000 [thread overview]
Message-ID: <1164970738.3752.508.camel@quoit.chygwyn.com> (raw)
In-Reply-To: <20061130230158.174e995c.akpm@osdl.org>
Hi,
On Thu, 2006-11-30 at 23:01 -0800, Andrew Morton wrote:
> On Thu, 30 Nov 2006 12:24:08 +0000
> Steven Whitehouse <swhiteho@redhat.com> wrote:
>
> > static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync)
> > {
> > - struct gfs2_inode *ip = GFS2_I(dentry->d_inode);
> > + struct inode *inode = dentry->d_inode;
> > + int sync_state = inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC);
> > + int ret = 0;
> > + struct writeback_control wbc = {
> > + .sync_mode = WB_SYNC_ALL,
> > + .nr_to_write = 0,
> > + };
> > +
> > + if (gfs2_is_jdata(GFS2_I(inode))) {
> > + gfs2_log_flush(GFS2_SB(inode), GFS2_I(inode)->i_gl);
> > + return 0;
> > + }
> >
> > - gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl);
> > + if (sync_state != 0) {
> > + if (!datasync)
> > + ret = sync_inode(inode, &wbc);
>
> filemap_fdatawrite() would be simpler.
I was taking my cue here from ext3 which does something similar. The
filemap_fdatawrite() is done by the VFS before this is called with a
filemap_fdatawait() afterwards. This was intended to flush the metadata
via (eventually) ->write_inode() although I guess I should be calling
write_inode_now() instead?
Steve.
next prev parent reply other threads:[~2006-12-01 10:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-30 12:24 [Cluster-devel] [GFS2] Don't flush everything on fdatasync [70/70] Steven Whitehouse
2006-12-01 7:01 ` [Cluster-devel] " Andrew Morton
2006-12-01 10:58 ` Steven Whitehouse [this message]
2006-12-01 19:09 ` Andrew Morton
2006-12-05 14:36 ` Steven Whitehouse
2006-12-07 9:11 ` Steven Whitehouse
2006-12-07 19:05 ` Wendy Cheng
2006-12-08 10:29 ` Steven Whitehouse
2006-12-08 10:29 ` Steven Whitehouse
2006-12-07 12:17 ` [Cluster-devel] [GFS2 & DLM] Pull request Steven Whitehouse
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=1164970738.3752.508.camel@quoit.chygwyn.com \
--to=swhiteho@redhat.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;
as well as URLs for NNTP newsgroup(s).