linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@us.ibm.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: journal start/stop in ext3_writeback_writepage()
Date: 09 Feb 2005 10:38:32 -0800	[thread overview]
Message-ID: <1107974312.20053.68.camel@dyn318077bld.beaverton.ibm.com> (raw)
In-Reply-To: <1107967040.1949.59.camel@sisko.sctweedie.blueyonder.co.uk>

On Wed, 2005-02-09 at 08:37, Stephen C. Tweedie wrote:
> Hi,
> 
> On Wed, 2005-02-09 at 16:18, Badari Pulavarty wrote:
> 
> > I am trying to understand journaling code in ext3. 
> > Can some one enlighten me, why we need journal start
> > and stop in ext3_writeback_writepage() ? The block
> > allocation is already made in prepare_write().
> 
> prepare_write()/commit_write() are used for write(2) writes: the data is
> dirtied, but not immediately queued for IO (unless you're using O_SYNC).
>  
> writepage is used when you want to write the page's data to disk
> *immediately* --- it's used when the VM is swapping out an mmaped file,
> or for msync().
> 
> So when writepage comes in, there's no guarantee that we've had a
> previous prepare.  You can, for example, use ftruncate() to create a
> large hole in a file, and then mmap() it; if you then dirty a page, then
> the allocation occurs in the writepage().  So a transaction handle is
> necessary.
> 
> --Stephen

Thank you. It make sense now. 

I was under the impression that writepage() could also be used to
flush the data even for write(2) writes. Is it not true ? 

I was trying to add writepages() interface for ext3. I am wondering
if I need to do journaling for that case too.

Thanks,
Badari


  reply	other threads:[~2005-02-09 18:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09 16:18 journal start/stop in ext3_writeback_writepage() Badari Pulavarty
2005-02-09 16:37 ` Stephen C. Tweedie
2005-02-09 18:38   ` Badari Pulavarty [this message]
2005-02-09 23:24     ` Stephen C. Tweedie
2005-02-10 17:39   ` Badari Pulavarty
2005-02-10 19:07     ` Sonny Rao
2005-02-10 19:17     ` Badari Pulavarty
2005-02-10 20:21       ` Andrew Morton
2005-02-10 23:12         ` Stephen C. Tweedie
2005-02-11  0:22           ` [Ext2-devel] " Badari Pulavarty
2005-02-11  0:27             ` Andrew Morton

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=1107974312.20053.68.camel@dyn318077bld.beaverton.ibm.com \
    --to=pbadari@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sct@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).