--On 09/18/00 13:19:27 -0400 Alexander Viro <[EMAIL PROTECTED]> wrote:

> 
> 
> On Mon, 18 Sep 2000, Chris Mason wrote:
> 
>> I'm not trying to put it all into a single get_block call, we have
>> different get_block funcs for different purposes.  What I'm really trying
>> to do is squeeze into block_prepare_write, as a generic setup function
>> for file modifications.
> 
> It is not. Period. Full stop. Check cont_prepare_write() and you will see
> a counterexample in the same fs/buffer.c. Yes, they are used in exactly
> the same manner.
> 
generic setup function.  Not the function that does the writes, but the
function that gets the page ready.  No, block_prepare_write does not have
to be the generic setup function, and it should not be for some
filesystems, and situations.  Right now, for what I need, it is usually
enough (except for writepage ;-)

In other words, I agree with you, even if we are saying it differently.
Clearly, when we go to writing directly to the tail for file_write, we'll
need a completely different prepare_write function.

>        Generic function for file modifications is generic_file_write().
> block_prepare_write() lives several layers below and is used only for some
> of the local filesystems (ones where it fits).
> 
>> The other reason why I convert in get_block is that is when I've got the
>> most information about the internals of the file, including a path
>> through the btree to the item that may or may not need converting.  In
>> reiserfs, the only way to find out if the last item of the file is
>> packed is to search the tree for it, and the same searching code is used
>> if it is a packed or an unpacked item.
> 
>        ? Chris, I hope you've noticed that e.g. ext2_prepare_write()
> lives in fs/ext2/inode.c, not in fs/buffer.c. So I don't see what stops
> you from pulling _any_ data you want.
> 

Sorry, not sure what you mean.  When prepare_write is called, reiserfs
doesn't know if it needs to convert until it has searched the internal
btree.  Once the search is done, 90% of prepare_write is also done, so we
might as well do the conversion there (otherwise we end up searching
twice).  The searching is done in reiserfs_get_block, so the conversion is
done in reiserfs_get_block.

Yes, I can pull almost anything I need out of buffer.c.  I'm trying to make
it so I don't need to, just to keep down the replication (and bugs).  But
if it makes things too nasty, I pull the code out and make it reiserfs
specific.

-chris


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to