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

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to