Re: msync() behaviour broken for MS_ASYNC, revert patch?

From: Andrew Morton
Date: Wed Mar 31 2004 - 19:30:44 EST

Linus Torvalds <torvalds@xxxxxxxx> wrote:
> I'd be perfectly happy with a set of file cache control operations,
> including
> - start writeback in [a,b]
> - wait for [a,b] stable
> - and maybe "punch hole in [a,b]"

Yup, there are a number of linux-specific fadvise() extensions we
can/should be adding, including "start writeback on this byte range for
flush" and "start writeback on this byte range for data integrity" and
"wait on writeback of this byte range".

Some of these are needed internally for the fs-AIO implementation, and also
for an O_SYNC which only writes the pages which the writer wrote. It's
pretty simple, and it'll be happening.

One wrinkle is that we'd need to add the start/end loff_t pair to the
a_ops->writepages() prototype. But instead I intend to put the start/end
info into struct writeback_control and pass it that way. It seems sleazy
at first but when you think about it, it isn't. It provides forward and
backward compatability, it recognises that it's just a hint and that
filesystems can legitimately sync the whole file and it produces
smaller+faster code.

We might need a wait_on_page_writeback_range() a_op though.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at