tech-kern archive

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

Vnode API change: VOP_LOOKUP



As announced some weeks ago here comes the API change to VOP_LOOKUP:

  Change vnode operation lookup to return the resulting vnode *vpp locked.
  Change cache_lookup() to return an unlocked vnode.


The fast path through the name cache doesn't add unlock/locks.
Most file systems now do this on cache miss:

        <lookup the inode number>
        if (ISDOTDOT)
                VOP_UNLOCK(dvp);
        VFS_VGET(mp, ino, &vpp);
        if (ISDOTDOT)
                vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
        VOP_UNLOCK(*vpp);
        return *vpp;

This lock/unlock dance will go once VFS_VGET gets replaced or enhanced
with a vnode/inode hash list that looks up vnodes without locking them.

Diff at: http://www.netbsd.org/~hannken/vnode-pass2b-1.diff

Comments or objections anyone?

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig 
(Germany)



Home | Main Index | Thread Index | Old Index