aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu
diff options
context:
space:
mode:
authorBoris Popov <bp@FreeBSD.org>2000-09-25 15:24:04 +0000
committerBoris Popov <bp@FreeBSD.org>2000-09-25 15:24:04 +0000
commit67e871664bbf89cdabdebc5d27448aa6885494f0 (patch)
tree09b5b63d419ae6f9b42f9ca832460c2683a08666 /sys/gnu
parentf568640168ac5d1dae6256573742901e99f3cec3 (diff)
downloadsrc-67e871664bbf89cdabdebc5d27448aa6885494f0.tar.gz
src-67e871664bbf89cdabdebc5d27448aa6885494f0.zip
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
Notes
Notes: svn path=/head/; revision=66355
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_ihash.c2
-rw-r--r--sys/gnu/ext2fs/inode.h1
-rw-r--r--sys/gnu/fs/ext2fs/inode.h1
3 files changed, 1 insertions, 3 deletions
diff --git a/sys/gnu/ext2fs/ext2_ihash.c b/sys/gnu/ext2fs/ext2_ihash.c
index 0a7c7d583191..36176f0bfc63 100644
--- a/sys/gnu/ext2fs/ext2_ihash.c
+++ b/sys/gnu/ext2fs/ext2_ihash.c
@@ -130,7 +130,7 @@ ufs_ihashins(ip)
struct ihashhead *ipp;
/* lock the inode, then put it on the appropriate hash list */
- lockmgr(&ip->i_lock, LK_EXCLUSIVE, (struct simplelock *)0, p);
+ lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct simplelock *)0, p);
simple_lock(&ufs_ihash_slock);
ipp = INOHASH(ip->i_dev, ip->i_number);
diff --git a/sys/gnu/ext2fs/inode.h b/sys/gnu/ext2fs/inode.h
index 6417a109081b..79e79b1ae082 100644
--- a/sys/gnu/ext2fs/inode.h
+++ b/sys/gnu/ext2fs/inode.h
@@ -66,7 +66,6 @@ typedef long ufs_lbn_t;
* active, and is put back when the file is no longer being used.
*/
struct inode {
- struct lock i_lock; /* Inode lock. >Keep this first< */
LIST_ENTRY(inode) i_hash;/* Hash chain. */
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct vnode *i_devvp;/* Vnode for block I/O. */
diff --git a/sys/gnu/fs/ext2fs/inode.h b/sys/gnu/fs/ext2fs/inode.h
index 6417a109081b..79e79b1ae082 100644
--- a/sys/gnu/fs/ext2fs/inode.h
+++ b/sys/gnu/fs/ext2fs/inode.h
@@ -66,7 +66,6 @@ typedef long ufs_lbn_t;
* active, and is put back when the file is no longer being used.
*/
struct inode {
- struct lock i_lock; /* Inode lock. >Keep this first< */
LIST_ENTRY(inode) i_hash;/* Hash chain. */
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct vnode *i_devvp;/* Vnode for block I/O. */