diff options
author | phk <phk@FreeBSD.org> | 1997-10-17 12:36:19 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1997-10-17 12:36:19 +0000 |
commit | 14aa7b01ea93949392e6e18666f790095eac2ebf (patch) | |
tree | af234d30cce9d801c011d9f4154cc8c26d406c53 /sys/msdosfs | |
parent | 988fe95f9897d896424ea0328f166e0e740afeaa (diff) | |
download | FreeBSD-src-14aa7b01ea93949392e6e18666f790095eac2ebf.zip FreeBSD-src-14aa7b01ea93949392e6e18666f790095eac2ebf.tar.gz |
Make a set of VOP standard lock, unlock & islocked VOP operators, which
depend on the lock being located at vp->v_data. Saves 3x3 identical
vop procs, more as the other filesystems becomes lock aware.
Diffstat (limited to 'sys/msdosfs')
-rw-r--r-- | sys/msdosfs/denode.h | 4 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 49 |
2 files changed, 6 insertions, 47 deletions
diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h index 335e4d0..6ad3fcc 100644 --- a/sys/msdosfs/denode.h +++ b/sys/msdosfs/denode.h @@ -1,4 +1,4 @@ -/* $Id: denode.h,v 1.12 1997/02/26 14:23:09 bde Exp $ */ +/* $Id: denode.h,v 1.13 1997/08/26 07:32:36 phk Exp $ */ /* $NetBSD: denode.h,v 1.8 1994/08/21 18:43:49 ws Exp $ */ /*- @@ -135,6 +135,7 @@ struct fatcache { * contained within a vnode. */ struct denode { + struct lock de_lock; /* denode lock >Keep this first< */ struct denode *de_next; /* Hash chain forward */ struct denode **de_prev; /* Hash chain back */ struct vnode *de_vnode; /* addr of vnode we are part of */ @@ -148,7 +149,6 @@ struct denode { long de_refcnt; /* reference count */ struct msdosfsmount *de_pmp; /* addr of our mount struct */ struct lockf *de_lockf; /* byte level lock list */ - struct lock de_lock; /* denode lock */ /* the next two fields must be contiguous in memory... */ u_char de_Name[8]; /* name, from directory entry */ u_char de_Extension[3]; /* extension, from directory entry */ diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 5adce6f..d228f49 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.48 1997/10/16 10:48:52 phk Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.49 1997/10/16 20:32:31 phk Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -94,12 +94,9 @@ static int msdosfs_rmdir __P((struct vop_rmdir_args *)); static int msdosfs_symlink __P((struct vop_symlink_args *)); static int msdosfs_readdir __P((struct vop_readdir_args *)); static int msdosfs_abortop __P((struct vop_abortop_args *)); -static int msdosfs_lock __P((struct vop_lock_args *)); -static int msdosfs_unlock __P((struct vop_unlock_args *)); static int msdosfs_bmap __P((struct vop_bmap_args *)); static int msdosfs_strategy __P((struct vop_strategy_args *)); static int msdosfs_print __P((struct vop_print_args *)); -static int msdosfs_islocked __P((struct vop_islocked_args *)); static int msdosfs_pathconf __P((struct vop_pathconf_args *ap)); /* @@ -1709,44 +1706,6 @@ msdosfs_abortop(ap) return 0; } -static int -msdosfs_lock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags, &vp->v_interlock, - ap->a_p)); -} - -int -msdosfs_unlock(ap) - struct vop_unlock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p)); -} - -int -msdosfs_islocked(ap) - struct vop_islocked_args /* { - struct vnode *a_vp; - } */ *ap; -{ - - return (lockstatus(&VTODE(ap->a_vp)->de_lock)); -} - /* * vp - address of vnode file the file * bn - which cluster we are interested in mapping to a filesystem block number. @@ -1884,9 +1843,9 @@ static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_fsync_desc, (vop_t *) msdosfs_fsync }, { &vop_getattr_desc, (vop_t *) msdosfs_getattr }, { &vop_inactive_desc, (vop_t *) msdosfs_inactive }, - { &vop_islocked_desc, (vop_t *) msdosfs_islocked }, + { &vop_islocked_desc, (vop_t *) vop_stdislocked }, { &vop_link_desc, (vop_t *) msdosfs_link }, - { &vop_lock_desc, (vop_t *) msdosfs_lock }, + { &vop_lock_desc, (vop_t *) vop_stdlock }, { &vop_lookup_desc, (vop_t *) vfs_cache_lookup }, { &vop_mkdir_desc, (vop_t *) msdosfs_mkdir }, { &vop_mknod_desc, (vop_t *) msdosfs_mknod }, @@ -1901,7 +1860,7 @@ static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_setattr_desc, (vop_t *) msdosfs_setattr }, { &vop_strategy_desc, (vop_t *) msdosfs_strategy }, { &vop_symlink_desc, (vop_t *) msdosfs_symlink }, - { &vop_unlock_desc, (vop_t *) msdosfs_unlock }, + { &vop_unlock_desc, (vop_t *) vop_stdunlock }, { &vop_write_desc, (vop_t *) msdosfs_write }, { NULL, NULL } }; |