diff options
author | bp <bp@FreeBSD.org> | 2000-09-25 15:24:04 +0000 |
---|---|---|
committer | bp <bp@FreeBSD.org> | 2000-09-25 15:24:04 +0000 |
commit | 6110b03d2438de0cb3f47dbce3cec5c1dfa712f6 (patch) | |
tree | 104536559087d506b1c196e2562f5ecc57690734 /sys/ufs/ffs | |
parent | 520f10057961f03f20c2b980adff11bbfa8c2d6d (diff) | |
download | FreeBSD-src-6110b03d2438de0cb3f47dbce3cec5c1dfa712f6.zip FreeBSD-src-6110b03d2438de0cb3f47dbce3cec5c1dfa712f6.tar.gz |
Add a lock structure to vnode structure. Previously it was either allocated
separately (nfs, cd9660 etc) or keept as a first element of structure
referenced by v_data pointer(ffs). Such organization leads to known problems
with stacked filesystems.
From this point vop_no*lock*() functions maintain only interlock lock.
vop_std*lock*() functions maintain built-in v_lock structure using lockmgr().
vop_sharedlock() is compatible with vop_stdunlock(), but maintains a shared
lock on vnode.
If filesystem wishes to export lockmgr compatible lock, it can put an address
of this lock to v_vnlock field. This indicates that the upper filesystem
can take advantage of it and use single lock structure for entire (or part)
of stack of vnodes. This field shouldn't be examined or modified by VFS code
except for initialization purposes.
Reviewed in general by: mckusick
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index dc04eea..6806734 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1056,7 +1056,11 @@ restart: return (error); } bzero((caddr_t)ip, sizeof(struct inode)); - lockinit(&ip->i_lock, PINOD, "inode", 0, LK_CANRECURSE); + /* + * FFS supports lock sharing in the stack of vnodes + */ + vp->v_vnlock = &vp->v_lock; + lockinit(vp->v_vnlock, PINOD, "inode", 0, LK_CANRECURSE); vp->v_data = ip; ip->i_vnode = vp; ip->i_fs = fs = ump->um_fs; |