I'm pretty confident that we can extend the VFS layer to support named
streams (see the technical discussion with Al, rather than the flames in
this thread). I also clearly believe that it is worth it, but I'm starting
to wonder if we should have a special open flag to make people select the
stream.
If you look at the Solaris interface, the _nice_ part about "openat()" is that you can do something like
file = open(filename, O_RDONLY);
if (file < 0)
return -ENOENT;
icon = openat(file, "icon", O_RDONLY | O_XATTR);
if (icon < 0)
icon = default_icon_file;
..
and it will work regardless of whether "filename" is a directory or a regular file, if I've understood correctly.
Now, I think that makes sense for several reasons:
- single case
- race-free (think "stat()" vs "fstat()" races).
- I think we want to do "openat()" regardless of whether we ever support extended attributes or not ("openat()" is nice for doing "namei()" in user space even in the absense of any attributes or named streams).
So what we can do is
- implement openat() regardless, and expect to do the Solaris thing for it if we ever do streams.
- _also_ support the "implied named attributes" for regular files, so that you don't have to use "openat()" to access them.
Comments? Does anybody hate "openat()" for any reason (regardless of attributes)? We can easily support it, we'd just need to pass in the file to use as part of the "nameidata" thing or add an argument (it would also possibly be cleaner if we made "fs->pwd" be a "struct file").
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/