Re: silent semantic changes with reiser4

From: Linus Torvalds
Date: Sat Aug 28 2004 - 13:47:52 EST




On Sat, 28 Aug 2004 viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
>
> What would your openat() produce? Normal struct file? Then what's going
> to be its vfsmount/dentry and what will they be attached to?

Normal file descriptor, exactly like "open()".

And it's going to have all the same vfsmount/dentry thing it would have if
you looked it up the whole way. I don't understand your question..

Ignore the O_XATTR thing for a while, and assume it's just a convenient
combination of "fchdir + open" (plus "fchdir back" of course, but that's
beside the point - openat() doesn't ever really change cwd).

Going back to O_XATTR: that would end up doing the "special vfsmount"
magic at the beginning of the lookup. If the dentry you started with
wasn't marked D_HYBRID, it would just return -ENOTDIR.

So we could do openat() _without_ any of the lookup_mnt() etc special
cases. This interface is independent of whether we want to expose the
attributes through a normal lookup - we can do either, both, or neither as
we choose.

The nice thing about "openat()" is
- people can definitely find uses for it even without attributes.
- it's "portable". Well, at least somebody else does the same thing,
which is nice for user-space developers. You don't use a Linux-only
interface, you use a Linux/Solaris one, which makes a lot of people a
lot more happy.

Remember, portability has always been very important to Linux, and
Linux-only features while nice are certainly not as nice as features you
can also find in other places.

NIH is a disease.

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/