Re: reiser4 plugins (was: silent semantic changes with reiser4)

Christophe Saout
2004-08-26T13:58:19Z

[-- Attachment #1: Type: text/plain, Size: 2493 bytes --]

Am Donnerstag, den 26.08.2004, 15:40 +0200 schrieb Christoph Hellwig:

> > That's your opinion. reiser4 seems to work very well.
>
> So how many OSes is it ported to currently? The problem is not that it
> doesn't work but that it's really hard to maintain. And remember that
> this maintaince overhead is not just for Hans but for everyone that does
> VFS-level work.

Where does it add overhead? It's just the interface between the reiser4
storage layer and the rest abstracted out.

Ok, there's the code that dispatches the VFS method calls to the plugin
call but I would say that's about it. I didn't develop reiser4 so I
don't know.

/* ->mkdir() VFS method in reiser4 inode_operations */
static int
reiser4_mkdir(struct inode *parent /* inode of parent
* directory */ ,
struct dentry *dentry /* dentry of new object to
* create */ ,
int mode /* new object's mode */ )
{
reiser4_object_create_data data;

reiser4_stat_inc_at(parent->i_sb, vfs_calls.mkdir);

data.mode = S_IFDIR | mode;
data.id = DIRECTORY_FILE_PLUGIN_ID;
return invoke_create_method(parent, dentry, &data);
}

The invoke_create_method then just calls the create method of the plugin
after setting up a context and lookup up the plugin.

xfs_iops.c seems to do something similar.

> Unless of course we get a blanko permission to break it
> as soon as fixing the mess becomes non-trivial.

Well, I think so. It's done relatively often.

> > What I understood is that you can select exactly one plugin that e.g.
> > handles the file data. The default plugin is optimized for normal files,
> > another one could implement transparent compression or encryption. Some
> > of these plugins also give the storage layer hints how to group files
> > together to optimized performance. Neither of these things mess with the
> > VFS.
>
> compression or encryption must sit below the pagecache to work nicely,
> and this hint things that usually sit at the pagecache level. But let's
> assume you have a valid use for different file_operations, why don't you
> simply add in different file_operations instead of adding another
> internal dispatch layer?

I don't know, ask Hans. How could the VFS know it a filesystem wants to
do something specific with a file that is completely transparent to the
VFS?

[-- Attachment #2: Dies ist ein digital signierter Nachrichtenteil --]
[-- Type: application/pgp-signature, Size: 189 bytes --]