On Thu, 10 Aug 2000, Daniel Phillips wrote:

> Correct me if I'm wrong, but I think that if writepage ever needs to unmerge at
> tail then it's an error.  The tail should have already been unmerged by the
> ext2_file_write, which must necessarily precede the writepage.  Similarly for
> file_mmap: I should unmerge the tail as soon as a file ever memapped, and then
> a unmerge can't come from that source either.

As for the latter - you shouldn't. THE thing about mmap() is that it is
not allowed to expand the file. Ever. So all you have is to make sure that
your file has no holes _past_ the end of tail. Then every writepage()
may
        * hit the existing full block (no problem)
        * need to allocates the full block (also no problem)
        * write to the tail without changing the length (no unmerging)
It doesn't come for free - to make sure that writepage() will never have
to unmerge you must unmerge() on expanding ->truncate().

So there... I had to start doing something like that for UFS pre-patches.
Hopefully it will be portable to ext2 - I'ld like to try 32Kb blocks/4Kb
fragments, for one thing. Problems are mostly the same, except that I'm
trying to deal with allocation units larger than PAGE_CACHE_SIZE - it adds
some fun. OTOH, I can almost freely use buffer_cache - I'm not interested
in fragments below the 512 bytes...

Reply via email to