[lkml]   [2008]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch 01/10] vfs: add path_create() and path_mknod()
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

 \ /
  Last update: 2008-04-03 01:43    [W:0.077 / U:1.956 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site