linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jamie Lokier <jamie@shareable.org>
Cc: Christoph Hellwig <hch@lst.de>, Neil Brown <neilb@suse.de>,
	linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] md: stop using do_sync_mapping_range
Date: Sat, 26 Sep 2009 17:11:19 +0200	[thread overview]
Message-ID: <20090926151119.GC11623@lst.de> (raw)
In-Reply-To: <20090923134715.GA15256@shareable.org>

On Wed, Sep 23, 2009 at 02:47:15PM +0100, Jamie Lokier wrote:
> Christoph Hellwig wrote:
> > -		do_sync_mapping_range(file->f_mapping, 0, LLONG_MAX,
> > -				      SYNC_FILE_RANGE_WAIT_BEFORE |
> > -				      SYNC_FILE_RANGE_WRITE |
> > -				      SYNC_FILE_RANGE_WAIT_AFTER);
> > +		filemap_write_and_wait(file->f_mapping);
> >
> > It's a very awkward way to write out all data and wait for it, so just
> > call filemap_write_and_wait.  I still can't figure what the point of
> > all this is, so a comment would surely be helpful.
> 
> The SYNC_FILE_RANGE_WAIT_BEFORE is to make sure that writes which were
> started before the most recent dirtying are completed before
> initiating a second write on the same pages to make sure the most
> recently dirty data is written.
> 
> Does filemap_write_and_wait() do that?

Yes, for WB_SYNC_ALL syncs write_cache_pages or the fs-specific
equivalent waits for pages marked writeback before starting starting
the writeout.

  reply	other threads:[~2009-09-26 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-23 13:18 [PATCH] md: stop using do_sync_mapping_range Christoph Hellwig
2009-09-23 13:47 ` Jamie Lokier
2009-09-26 15:11   ` Christoph Hellwig [this message]
2009-09-23 22:52 ` Neil Brown
2009-09-26 15:13   ` Christoph Hellwig
2009-09-26 21:51     ` NeilBrown

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=20090926151119.GC11623@lst.de \
    --to=hch@lst.de \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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).