Marcus Brinkmann <[EMAIL PROTECTED]> writes:

> is pager_unlock_page just called to make it possible for a fs to prepare for
> an actual pager_write_page on the page? It doesn't look as if I need to do
> anything except to make sure that following writes will succeed.

pager_unlock_page is called for pages which you set writelocked in
pager_read_page.  pager_read_page should never allocate disk, so if
there are holes in the file (a possibility for sane filesystem
formats) then pager_read_page has to return those blocks as
writelocked and then pager_unlock_page will be used when the file
grows.  

You should not do disk allocation in pager_write_page; that is called
too late for errors to be propogated back to users correctly.

> Is it okay to allocate all blocks in diskfs_grow, and don't do anything in
> pager_unlock_page? As zero gaps are not supported in fat anyway, I would
> prefer to keep it simple and just allocate everything immediately.

Yes, that's the right approach in a filesystem that does not have holes.

Thomas

Reply via email to