tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Vnode API change: add global vnode cache

   Date: Mon, 7 Apr 2014 18:32:02 +0200
   From: "J. Hannken-Illjes" <>

   On 07 Apr 2014, at 18:02, Taylor R Campbell 
<> wrote:

   > In that case, could you set the VI_CHANGING bit in vp, rather than
   > node->vn_vnode = NULL in the vcache node, to indicate that the vnode
   > is being initialized in vcache_intern?

   This will not work for layered file systems.  They will share the
   v_interlock from another vnode (in VFS_LOAD_NODE) so we better don't use
   the interlock before loading the fs node.

You can pass the shared interlock to vcache_intern, like I illustrated
in the code I attached.

   > Perhaps we ought at least to change VFS_VGET so it returns the vnode
   > unlocked, and once we do that, use it consistently to look up vnodes
   > by inode number rather than calling vcache_intern in multiple
   > different places.

   Maybe in the far future.  Already looked at it and it is a very big job
   if we want to do it in one step.

We could do this for just ufs:

1. Add ufs_vget_unlocked to make the sole call to vcache_intern for

2. Make ufs_vget call ufs_vget_unlocked and then lock the result.

3. Replace calls to VFS_VGET by ufs_vget_unlocked, rather than by

Then, when we fix VFS_VGET, we replace ufs_vget by ufs_vget_unlocked.

Home | Main Index | Thread Index | Old Index