Re: Implementing writepage

David Woodhouse
2003-10-25T16:18:06Z

On Sat, 2003-10-25 at 22:27 +0000, Charles Manning wrote:
> I need to therefore implement writepage and have a few questions:

No you don't. This is flash -- people don't really need shared writable
mmap; if they think they do, they need educating not pandering to.

> 1) Is there a generic writepage lurking somewhere that will use
> prepare/commit_write instead?

Don't think so. Offhand I don't see why it couldn't be done, but it's
not what most file systems would want.

> 2) What fiddling is required with kmap & page flags within writepage or is
> this all handled by the caller?

You'll need to kmap the page since you actually want to touch the data
with the CPU. You probably also need to mark the page uptodate when
you're done. Take a look at the generic block writepage.

> Any help appreciated.

Ensure you have no memory allocations in the writepage() code path,
unless they're done with (IIRC) GFP_NOIO.

--
dwmw2