On Tue, Apr 20, 2010 at 06:30:10PM +0200, Miklos Szeredi wrote:
I'm sorry I have responded sooner, I've been trying to write a
detailed useful message and that turns out to be hard. I'll just
include a few of the highlights; mainly I want to say that I'd
rather do it the way you describe but when I tried it ended up even
uglier than the VFS implementation.
I went down this road initially (do most of the unioning in a file
system) and spent a couple of months on it. But I always ended up
having to do some level of copy-around and redirection similar to that
in unionfs.
One of the major difficulties that arises even when doing unioning at
the VFS level is keeping around the parent's path in order to do the
copyup later on. Take a look at the code pattern in the "union-mount:
Implement union-aware syscall()" series of patches. That's the
prettiest and most efficient version I could come up with, after two
other implementations, and it's in the VFS, at the vfs_foo_syscall()
level. I don't even know how I would start if I had to wait until the
file system op is called.
If you have some insights on how to do this, I'd love to hear them. I
don't enjoy writing VFS code for the fun of it. :)
Thanks,
-VAL
--