Re: [patch 01/10] vfs: add path_create() and path_mknod()

From: Al Viro
Date: Wed Apr 02 2008 - 19:41:29 EST


On Wed, Apr 02, 2008 at 07:19:58PM -0400, Trond Myklebust wrote:

> I'm just suggesting splitting out the namespace-specific part of struct
> file into a separate structure that would be private to the VFS.
> Something like
>
> struct file_descriptor {
> struct file *file;
> struct vfsmount *mnt;
> atomic_t refcount;
> };
>
> and then having the 'struct file' hold a reference to the superblock
> instead of holding a reference to the vfsmount.
>
> Why would that be problematic for SCM_RIGHTS? We don't allow people to
> send arbitrary references to 'struct file' using SCM_RIGHTS now; they
> have to send descriptors.

HUH? Descriptor is a number. There is no struct file_descriptor,
let alone refcounting for such. There is a table, indexed by number
and containing references to struct file.

If you want to shove pointer to vfsmount in there (what for? to waste
some memory and make SMP protection on access more interesting?), you
could do that, but IMO it's too ugly to consider.

Anyway, what the hell for? It's more complex and buys you nothing
useful.
--
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/