Skip to contentSkip to conversation

file as a directory

DISCUSSION Bodo Eggert 1 participant 1 message Nov 26, 2004 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 11 lines · Martin Waitz
Quoted 4 lines · Zan Lynx

There are already several things in filesystems that don't strictly belong inside the kernel. A filesystem could be implemented quite well as a user-space daemon that sat on top of the block device and communicated via sockets or shared memory just like an X server.

this is quite different.
As you need to enforce security policies when accessing the block device, you have to move the filesystem into its own daemon. You cannot do it in a library.

Only the mapping from block-nr to uid/gid/perms needs to be in the kernel. The rest can be done in userspace, but it would be ugly as hell.

Quoted 2 lines

It is irrelevant for the application weather the fs resides in a separate daemon or in the kernel itself.

ACK.

Quoted 4 lines

But support of different views on files is something different. You can do that in a library, you only need an interface that is capable of storing your data. The kernel already provides that interface.

If you want to allow users to set their default shell using some extension, a simple userspace library will not do the job. You'll need a central authority that is able to synchronize the access to the file, prevent unauthorized modifications, do the caching etc.

I think the special file handlers should generally be daemons, but the access should be controlled by kernel hooks, maybe something like automounting a userspace filesystem. Simple meta-filesystems, e.g. those that could be "emulated" using mount -oloop, may reside in the kernel space, more complicated but common ones may be stored in the kernel (placed on the initramfs?) to accelerate starting the helper daemon and uncommon ones would be registered at runtime (maybe user-specific).

Having functions in the kernel to support those filesystems in the kernel will help, e.g. a tgz helper daemon would need to allocate temporary storage for accelerating access (e.g. file tree, cache) as well as means to reassemble the tgz for operations on the whole file after write operations occured. Meta-filesystems on fs without these features can (off cause) be done, but I think they would be very slow or show inconsitencies in certain situations.

Signature · 1 line
Bug? That's not a bug, that's a feature.