summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2000-09-25 15:24:04 +0000
committerbp <bp@FreeBSD.org>2000-09-25 15:24:04 +0000
commit6110b03d2438de0cb3f47dbce3cec5c1dfa712f6 (patch)
tree104536559087d506b1c196e2562f5ecc57690734 /sys/nfs
parent520f10057961f03f20c2b980adff11bbfa8c2d6d (diff)
downloadFreeBSD-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/nfs')
-rw-r--r--sys/nfs/nfs_vnops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 91f9435..28fe55b 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -148,6 +148,7 @@ static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = {
{ &vop_getpages_desc, (vop_t *) nfs_getpages },
{ &vop_putpages_desc, (vop_t *) nfs_putpages },
{ &vop_inactive_desc, (vop_t *) nfs_inactive },
+ { &vop_islocked_desc, (vop_t *) vop_stdislocked },
{ &vop_lease_desc, (vop_t *) vop_null },
{ &vop_link_desc, (vop_t *) nfs_link },
{ &vop_lock_desc, (vop_t *) vop_sharedlock },
@@ -168,6 +169,7 @@ static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = {
{ &vop_setattr_desc, (vop_t *) nfs_setattr },
{ &vop_strategy_desc, (vop_t *) nfs_strategy },
{ &vop_symlink_desc, (vop_t *) nfs_symlink },
+ { &vop_unlock_desc, (vop_t *) vop_stdunlock },
{ &vop_write_desc, (vop_t *) nfs_write },
{ NULL, NULL }
};
@@ -185,12 +187,14 @@ static struct vnodeopv_entry_desc nfsv2_specop_entries[] = {
{ &vop_close_desc, (vop_t *) nfsspec_close },
{ &vop_fsync_desc, (vop_t *) nfs_fsync },
{ &vop_getattr_desc, (vop_t *) nfs_getattr },
+ { &vop_islocked_desc, (vop_t *) vop_stdislocked },
{ &vop_inactive_desc, (vop_t *) nfs_inactive },
{ &vop_lock_desc, (vop_t *) vop_sharedlock },
{ &vop_print_desc, (vop_t *) nfs_print },
{ &vop_read_desc, (vop_t *) nfsspec_read },
{ &vop_reclaim_desc, (vop_t *) nfs_reclaim },
{ &vop_setattr_desc, (vop_t *) nfs_setattr },
+ { &vop_unlock_desc, (vop_t *) vop_stdunlock },
{ &vop_write_desc, (vop_t *) nfsspec_write },
{ NULL, NULL }
};
OpenPOWER on IntegriCloud