Hi,

> Because actual _allocation_ unit may have nothing to blocksize and be
> invisible to VFS. Check fatfs - it uses the thing to trigger allocation,
> but actual zero-out goes on per-sector basis.

I tried vfat on a MO drive with 1KByte sectors - it doesn't work. I also
don't know how you want to do it. A fs with a block size smaller than
the sector size can't impossibly write directly into the page cache and
I don't see anywhere where that is taken care of.

> > fs/adfs/inode.c:        prepare_write:  cont_prepare_write,
>         ???? Not on this box. What version are you using?
> They are _calling_ the thing, but they would simply refuse to compile if
> they would have such lines - different prototypes.

Oops, sorry, wrong source tree, it's a 2.4 with some other changes. :)
What I tried was to change the prototypes so the smaller caller routines
in _every_ fs can be removed - seems to work, except that
cont_prepare_write needs that extra argument (another reason I'd like to
move it to i_realsize). It seems to work, is there any reason not to do
this?

> Not needed. That race is taken care of - readpage() never does access past
> i_size and has the page locked, while vmtruncate() starts with setting
> i_size (on shrinking truncate(), that is), then goes through all pages in
> affected area and grabs the lock on all of them (one by one, not
> simultaneously, indeed) and only then calls ->truncate().

Hmm, then I don't understand the BKL in the get_block functions.

> > Rounding it up to the block size isn't a problem, the question is why do
> > we give the bytes ptr to cont_prepare_write, if get_block has to update
> > it in first place. That's probably the point that confused me here.
> 
> cont_prepare_write() has to zero the tail of the last block out ;-<

IMO we could simplify that if we would do the preallocation business in
the page cache. We only need to support a dummy page structure in the
page cache to delay the allocation of the real page (we need that
anyway, if want to do direct io into/from e.g. pci space), but that's
more something for 2.5 or is there any reason why it shouldn't work?

bye, Roman

Reply via email to