From 34bdbbd0de4e7ac29ca2f107fa68bc704a19521b Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Sun, 1 Mar 1998 22:46:53 +0000 Subject: [PATCH] The intent is to get rid of WILLRELE in vnode_if.src by making a complement to all ops that return a vpp, VFS_VRELE. This is initially only for file systems that implement the following ops that do a WILLRELE: vop_create, vop_whiteout, vop_mknod, vop_remove, vop_link, vop_rename, vop_mkdir, vop_rmdir, vop_symlink This is initial DNA that doesn't do anything yet. VFS_VRELE is implemented but not called. A default vfs_vrele was created for fs implementations that use the standard vnode management routines. VFS_VRELE implementations were made for the following file systems: Standard (vfs_vrele) ffs mfs nfs msdosfs devfs ext2fs Custom union umapfs Just EOPNOTSUPP fdesc procfs kernfs portal cd9660 These implementations may change as VOP changes are implemented. In the next phase, in the vop implementations calls to vrele and the vrele part of vput will be moved to the top layer vfs_vnops and made visible to all layers. vput will be replaced by unlock in these cases. Unlocking will still be done in the per fs layer but the refcount decrement will be triggered at the top because it doesn't hurt to hold a vnode reference a little longer. This will have minimal impact on the structure of the existing code. This will only be done for vnode arguments that are released by the various fs vop implementations. Wider use of VFS_VRELE will likely require restructuring of the code. Reviewed by: phk, dyson, terry et. al. Submitted by: Michael Hancock --- sys/fs/cd9660/cd9660_vfsops.c | 17 ++++++++++++++++- sys/fs/fdescfs/fdesc_vfsops.c | 6 +++++- sys/fs/msdosfs/msdosfs_vfsops.c | 3 ++- sys/fs/nullfs/null_vfsops.c | 22 +++++++++++++++++++++- sys/fs/portalfs/portal_vfsops.c | 5 ++++- sys/fs/procfs/procfs_vfsops.c | 5 ++++- sys/fs/umapfs/umap_vfsops.c | 18 +++++++++++++++++- sys/fs/unionfs/union_vfsops.c | 19 ++++++++++++++++++- sys/gnu/ext2fs/ext2_vfsops.c | 1 + sys/gnu/fs/ext2fs/ext2_vfsops.c | 1 + sys/isofs/cd9660/cd9660_vfsops.c | 17 ++++++++++++++++- sys/kern/vfs_default.c | 23 +++++++++++++++++++++++ sys/miscfs/devfs/devfs_vfsops.c | 3 ++- sys/miscfs/fdesc/fdesc_vfsops.c | 6 +++++- sys/miscfs/kernfs/kernfs.h | 4 +++- sys/miscfs/kernfs/kernfs_vfsops.c | 3 ++- sys/miscfs/nullfs/null_vfsops.c | 22 +++++++++++++++++++++- sys/miscfs/portal/portal_vfsops.c | 5 ++++- sys/miscfs/procfs/procfs_vfsops.c | 5 ++++- sys/miscfs/umapfs/umap_vfsops.c | 18 +++++++++++++++++- sys/miscfs/union/union_vfsops.c | 19 ++++++++++++++++++- sys/msdosfs/msdosfs_vfsops.c | 3 ++- sys/nfs/nfs_vfsops.c | 3 ++- sys/nfsclient/nfs_vfsops.c | 3 ++- sys/sys/mount.h | 5 ++++- sys/ufs/ffs/ffs_vfsops.c | 3 ++- sys/ufs/mfs/mfs_vfsops.c | 3 ++- 27 files changed, 218 insertions(+), 24 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 583d66c6201..a9218c3a2b7 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $Id: cd9660_vfsops.c,v 1.32 1997/11/07 08:52:51 phk Exp $ + * $Id: cd9660_vfsops.c,v 1.33 1997/12/21 21:40:02 joerg Exp $ */ #include @@ -73,6 +73,7 @@ static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *)); static int cd9660_sync __P((struct mount *, int, struct ucred *, struct proc *)); static int cd9660_vget __P((struct mount *, ino_t, struct vnode **)); +static int cd9660_vrele __P((struct mount *, struct vnode *)); static int cd9660_fhtovp __P((struct mount *, struct fid *, struct sockaddr *, struct vnode **, int *, struct ucred **)); static int cd9660_vptofh __P((struct vnode *, struct fid *)); @@ -86,6 +87,7 @@ static struct vfsops cd9660_vfsops = { cd9660_statfs, cd9660_sync, cd9660_vget, + cd9660_vrele, cd9660_fhtovp, cd9660_vptofh, cd9660_init @@ -658,6 +660,19 @@ cd9660_vget(mp, ino, vpp) (struct iso_directory_record *)0)); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + */ +/* ARGSUSED */ +static int +cd9660_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + return (EOPNOTSUPP); +} + int cd9660_vget_internal(mp, ino, vpp, relocated, isodir) struct mount *mp; diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index b57b236fe63..b5fe219bab8 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * - * $Id: fdesc_vfsops.c,v 1.12 1997/08/16 19:15:12 wollman Exp $ + * $Id: fdesc_vfsops.c,v 1.13 1997/10/12 20:24:39 phk Exp $ */ /* @@ -71,6 +71,7 @@ static int fdesc_sync __P((struct mount *mp, int waitfor, struct ucred *cred, struct proc *p)); static int fdesc_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int fdesc_vrele __P((struct mount *mp, struct vnode *vp)); static int fdesc_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -253,6 +254,8 @@ fdesc_sync(mp, waitfor, cred, p) size_t, struct proc *)))eopnotsupp) #define fdesc_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ eopnotsupp) +#define fdesc_vrele ((int (*) __P((struct mount *, struct vnode *))) \ + eopnotsupp) #define fdesc_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp) static struct vfsops fdesc_vfsops = { @@ -264,6 +267,7 @@ static struct vfsops fdesc_vfsops = { fdesc_statfs, fdesc_sync, fdesc_vget, + fdesc_vrele, fdesc_fhtovp, fdesc_vptofh, fdesc_init, diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index ec4e5f1c350..2b1d1d7f352 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.27 1998/02/23 14:57:50 kato Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.28 1998/02/23 16:44:32 ache Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -1042,6 +1042,7 @@ static struct vfsops msdosfs_vfsops = { msdosfs_statfs, msdosfs_sync, msdosfs_vget, + vfs_vrele, msdosfs_fhtovp, msdosfs_vptofh, msdosfs_init diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 30515a543d3..961c0f933af 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -36,7 +36,7 @@ * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94 * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 - * $Id: null_vfsops.c,v 1.23 1998/02/04 22:32:47 eivind Exp $ + * $Id: null_vfsops.c,v 1.24 1998/02/06 12:13:40 eivind Exp $ */ /* @@ -75,6 +75,7 @@ static int nullfs_unmount __P((struct mount *mp, int mntflags, struct proc *p)); static int nullfs_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int nullfs_vrele __P((struct mount *mp, struct vnode *vp)); static int nullfs_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -388,6 +389,24 @@ nullfs_vget(mp, ino, vpp) return VFS_VGET(MOUNTTONULLMOUNT(mp)->nullm_vfs, ino, vpp); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + */ +/* ARGSUSED */ +static int +nullfs_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + int error = 0; + + error = VFS_VRELE(MOUNTTONULLMOUNT(mp)->nullm_vfs, + NULLVPTOLOWERVP(vp)); + vrele(vp); + return (error); +} + static int nullfs_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp) struct mount *mp; @@ -419,6 +438,7 @@ static struct vfsops null_vfsops = { nullfs_statfs, nullfs_sync, nullfs_vget, + nullfs_vrele, nullfs_fhtovp, nullfs_vptofh, nullfs_init, diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c index 481b4d4ac5f..2fa81a9deff 100644 --- a/sys/fs/portalfs/portal_vfsops.c +++ b/sys/fs/portalfs/portal_vfsops.c @@ -35,7 +35,7 @@ * * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95 * - * $Id: portal_vfsops.c,v 1.18 1997/10/12 20:24:53 phk Exp $ + * $Id: portal_vfsops.c,v 1.19 1998/01/01 08:28:11 bde Exp $ */ /* @@ -273,6 +273,8 @@ portal_statfs(mp, sbp, p) size_t, struct proc *)))eopnotsupp) #define portal_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ eopnotsupp) +#define portal_vrele ((int (*) __P((struct mount *, struct vnode *))) \ + eopnotsupp) #define portal_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp) static struct vfsops portal_vfsops = { @@ -284,6 +286,7 @@ static struct vfsops portal_vfsops = { portal_statfs, portal_sync, portal_vget, + portal_vrele, portal_fhtovp, portal_vptofh, portal_init, diff --git a/sys/fs/procfs/procfs_vfsops.c b/sys/fs/procfs/procfs_vfsops.c index 9379da674b3..fddc277f6d8 100644 --- a/sys/fs/procfs/procfs_vfsops.c +++ b/sys/fs/procfs/procfs_vfsops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 * - * $Id: procfs_vfsops.c,v 1.18 1997/12/08 01:06:24 sef Exp $ + * $Id: procfs_vfsops.c,v 1.19 1997/12/30 08:46:44 bde Exp $ */ /* @@ -193,6 +193,8 @@ procfs_init(vfsp) size_t, struct proc *)))eopnotsupp) #define procfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ eopnotsupp) +#define procfs_vrele ((int (*) __P((struct mount *, struct vnode *))) \ + eopnotsupp) #define procfs_vptofh ((int (*) __P((struct vnode *, struct fid *)))einval) static struct vfsops procfs_vfsops = { @@ -204,6 +206,7 @@ static struct vfsops procfs_vfsops = { procfs_statfs, procfs_sync, procfs_vget, + procfs_vrele, procfs_fhtovp, procfs_vptofh, procfs_init, diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index d9dce5cbc26..8c1b705c816 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * - * $Id: umap_vfsops.c,v 1.19 1998/02/03 14:30:01 kato Exp $ + * $Id: umap_vfsops.c,v 1.20 1998/02/07 01:34:32 kato Exp $ */ /* @@ -72,6 +72,7 @@ static int umapfs_unmount __P((struct mount *mp, int mntflags, struct proc *p)); static int umapfs_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int umapfs_vrele __P((struct mount *mp, struct vnode *vp)); static int umapfs_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -393,6 +394,20 @@ umapfs_vget(mp, ino, vpp) return (VFS_VGET(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, ino, vpp)); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + */ +/* ARGSUSED */ +static int +umapfs_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + vrele(vp); + return (0); +} + static int umapfs_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp) struct mount *mp; @@ -423,6 +438,7 @@ static struct vfsops umap_vfsops = { umapfs_statfs, umapfs_sync, umapfs_vget, + umapfs_vrele, umapfs_fhtovp, umapfs_vptofh, umapfs_init, diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 78dc7f4fd10..156108dd44c 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 - * $Id: union_vfsops.c,v 1.25 1998/02/06 12:13:44 eivind Exp $ + * $Id: union_vfsops.c,v 1.26 1998/02/10 08:04:31 kato Exp $ */ /* @@ -74,6 +74,7 @@ static int union_unmount __P((struct mount *mp, int mntflags, struct proc *p)); extern int union_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int union_vrele __P((struct mount *mp, struct vnode *vp)); extern int union_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -522,6 +523,21 @@ union_statfs(mp, sbp, p) return (0); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + * XXX - may change when modification of vops start. + */ +/* ARGSUSED */ +static int +union_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + vrele(vp); + return (0); +} + /* * XXX - Assumes no data cached at union layer. */ @@ -547,6 +563,7 @@ static struct vfsops union_vfsops = { union_statfs, union_sync, union_vget, + union_vrele, union_fhtovp, union_vptofh, union_init, diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index 781c4d864f0..aab8b7482fa 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -93,6 +93,7 @@ static struct vfsops ext2fs_vfsops = { ext2_statfs, ext2_sync, ext2_vget, + vfs_vrele, ext2_fhtovp, ext2_vptofh, ext2_init, diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index 781c4d864f0..aab8b7482fa 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -93,6 +93,7 @@ static struct vfsops ext2fs_vfsops = { ext2_statfs, ext2_sync, ext2_vget, + vfs_vrele, ext2_fhtovp, ext2_vptofh, ext2_init, diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 583d66c6201..a9218c3a2b7 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $Id: cd9660_vfsops.c,v 1.32 1997/11/07 08:52:51 phk Exp $ + * $Id: cd9660_vfsops.c,v 1.33 1997/12/21 21:40:02 joerg Exp $ */ #include @@ -73,6 +73,7 @@ static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *)); static int cd9660_sync __P((struct mount *, int, struct ucred *, struct proc *)); static int cd9660_vget __P((struct mount *, ino_t, struct vnode **)); +static int cd9660_vrele __P((struct mount *, struct vnode *)); static int cd9660_fhtovp __P((struct mount *, struct fid *, struct sockaddr *, struct vnode **, int *, struct ucred **)); static int cd9660_vptofh __P((struct vnode *, struct fid *)); @@ -86,6 +87,7 @@ static struct vfsops cd9660_vfsops = { cd9660_statfs, cd9660_sync, cd9660_vget, + cd9660_vrele, cd9660_fhtovp, cd9660_vptofh, cd9660_init @@ -658,6 +660,19 @@ cd9660_vget(mp, ino, vpp) (struct iso_directory_record *)0)); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + */ +/* ARGSUSED */ +static int +cd9660_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + return (EOPNOTSUPP); +} + int cd9660_vget_internal(mp, ino, vpp, relocated, isodir) struct mount *mp; diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index e2be1939b87..1aae3955f1a 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -44,8 +44,31 @@ #include #include #include +#include #include +/* + * VFS operations + */ + +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + */ +/* ARGSUSED */ +int +vfs_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + vrele(vp); + return (0); +} + +/* + * vnode operations + */ + static int vop_nostrategy __P((struct vop_strategy_args *)); /* diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index 1660af5769d..199ed5e1408 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs/devfs_vfsops.c,v 1.25 1997/10/16 08:18:38 julian Exp $ + * $Id: devfs_vfsops.c,v 1.26 1998/01/02 07:31:06 julian Exp $ * */ @@ -341,6 +341,7 @@ static struct vfsops devfs_vfsops = { devfs_statfs, devfs_sync, devfs_vget, + vfs_vrele, devfs_fhtovp, devfs_vptofh, devfs_init diff --git a/sys/miscfs/fdesc/fdesc_vfsops.c b/sys/miscfs/fdesc/fdesc_vfsops.c index b57b236fe63..b5fe219bab8 100644 --- a/sys/miscfs/fdesc/fdesc_vfsops.c +++ b/sys/miscfs/fdesc/fdesc_vfsops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * - * $Id: fdesc_vfsops.c,v 1.12 1997/08/16 19:15:12 wollman Exp $ + * $Id: fdesc_vfsops.c,v 1.13 1997/10/12 20:24:39 phk Exp $ */ /* @@ -71,6 +71,7 @@ static int fdesc_sync __P((struct mount *mp, int waitfor, struct ucred *cred, struct proc *p)); static int fdesc_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int fdesc_vrele __P((struct mount *mp, struct vnode *vp)); static int fdesc_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -253,6 +254,8 @@ fdesc_sync(mp, waitfor, cred, p) size_t, struct proc *)))eopnotsupp) #define fdesc_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ eopnotsupp) +#define fdesc_vrele ((int (*) __P((struct mount *, struct vnode *))) \ + eopnotsupp) #define fdesc_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp) static struct vfsops fdesc_vfsops = { @@ -264,6 +267,7 @@ static struct vfsops fdesc_vfsops = { fdesc_statfs, fdesc_sync, fdesc_vget, + fdesc_vrele, fdesc_fhtovp, fdesc_vptofh, fdesc_init, diff --git a/sys/miscfs/kernfs/kernfs.h b/sys/miscfs/kernfs/kernfs.h index 1488bc6d159..e13c2998bf4 100644 --- a/sys/miscfs/kernfs/kernfs.h +++ b/sys/miscfs/kernfs/kernfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kernfs.h 8.6 (Berkeley) 3/29/95 - * $Id: kernfs.h,v 1.7 1997/08/16 19:15:14 wollman Exp $ + * $Id: kernfs.h,v 1.8 1997/09/07 05:25:58 bde Exp $ */ #define _PATH_KERNFS "/kern" /* Default mountpoint */ @@ -61,6 +61,8 @@ struct kernfs_node { size_t, struct proc *)))eopnotsupp) #define kernfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ eopnotsupp) +#define kernfs_vrele ((int (*) __P((struct mount *, struct vnode *))) \ + eopnotsupp) #define kernfs_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp) extern vop_t **kernfs_vnodeop_p; extern dev_t rrootdev; diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 897e9b036e7..47b7e5c4255 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95 - * $Id: kernfs_vfsops.c,v 1.19 1997/08/02 14:32:02 bde Exp $ + * $Id: kernfs_vfsops.c,v 1.20 1997/10/12 20:24:48 phk Exp $ */ /* @@ -278,6 +278,7 @@ static struct vfsops kernfs_vfsops = { kernfs_statfs, kernfs_sync, kernfs_vget, + kernfs_vrele, kernfs_fhtovp, kernfs_vptofh, kernfs_init, diff --git a/sys/miscfs/nullfs/null_vfsops.c b/sys/miscfs/nullfs/null_vfsops.c index 30515a543d3..961c0f933af 100644 --- a/sys/miscfs/nullfs/null_vfsops.c +++ b/sys/miscfs/nullfs/null_vfsops.c @@ -36,7 +36,7 @@ * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94 * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 - * $Id: null_vfsops.c,v 1.23 1998/02/04 22:32:47 eivind Exp $ + * $Id: null_vfsops.c,v 1.24 1998/02/06 12:13:40 eivind Exp $ */ /* @@ -75,6 +75,7 @@ static int nullfs_unmount __P((struct mount *mp, int mntflags, struct proc *p)); static int nullfs_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int nullfs_vrele __P((struct mount *mp, struct vnode *vp)); static int nullfs_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -388,6 +389,24 @@ nullfs_vget(mp, ino, vpp) return VFS_VGET(MOUNTTONULLMOUNT(mp)->nullm_vfs, ino, vpp); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + */ +/* ARGSUSED */ +static int +nullfs_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + int error = 0; + + error = VFS_VRELE(MOUNTTONULLMOUNT(mp)->nullm_vfs, + NULLVPTOLOWERVP(vp)); + vrele(vp); + return (error); +} + static int nullfs_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp) struct mount *mp; @@ -419,6 +438,7 @@ static struct vfsops null_vfsops = { nullfs_statfs, nullfs_sync, nullfs_vget, + nullfs_vrele, nullfs_fhtovp, nullfs_vptofh, nullfs_init, diff --git a/sys/miscfs/portal/portal_vfsops.c b/sys/miscfs/portal/portal_vfsops.c index 481b4d4ac5f..2fa81a9deff 100644 --- a/sys/miscfs/portal/portal_vfsops.c +++ b/sys/miscfs/portal/portal_vfsops.c @@ -35,7 +35,7 @@ * * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95 * - * $Id: portal_vfsops.c,v 1.18 1997/10/12 20:24:53 phk Exp $ + * $Id: portal_vfsops.c,v 1.19 1998/01/01 08:28:11 bde Exp $ */ /* @@ -273,6 +273,8 @@ portal_statfs(mp, sbp, p) size_t, struct proc *)))eopnotsupp) #define portal_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ eopnotsupp) +#define portal_vrele ((int (*) __P((struct mount *, struct vnode *))) \ + eopnotsupp) #define portal_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp) static struct vfsops portal_vfsops = { @@ -284,6 +286,7 @@ static struct vfsops portal_vfsops = { portal_statfs, portal_sync, portal_vget, + portal_vrele, portal_fhtovp, portal_vptofh, portal_init, diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index 9379da674b3..fddc277f6d8 100644 --- a/sys/miscfs/procfs/procfs_vfsops.c +++ b/sys/miscfs/procfs/procfs_vfsops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 * - * $Id: procfs_vfsops.c,v 1.18 1997/12/08 01:06:24 sef Exp $ + * $Id: procfs_vfsops.c,v 1.19 1997/12/30 08:46:44 bde Exp $ */ /* @@ -193,6 +193,8 @@ procfs_init(vfsp) size_t, struct proc *)))eopnotsupp) #define procfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ eopnotsupp) +#define procfs_vrele ((int (*) __P((struct mount *, struct vnode *))) \ + eopnotsupp) #define procfs_vptofh ((int (*) __P((struct vnode *, struct fid *)))einval) static struct vfsops procfs_vfsops = { @@ -204,6 +206,7 @@ static struct vfsops procfs_vfsops = { procfs_statfs, procfs_sync, procfs_vget, + procfs_vrele, procfs_fhtovp, procfs_vptofh, procfs_init, diff --git a/sys/miscfs/umapfs/umap_vfsops.c b/sys/miscfs/umapfs/umap_vfsops.c index d9dce5cbc26..8c1b705c816 100644 --- a/sys/miscfs/umapfs/umap_vfsops.c +++ b/sys/miscfs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * - * $Id: umap_vfsops.c,v 1.19 1998/02/03 14:30:01 kato Exp $ + * $Id: umap_vfsops.c,v 1.20 1998/02/07 01:34:32 kato Exp $ */ /* @@ -72,6 +72,7 @@ static int umapfs_unmount __P((struct mount *mp, int mntflags, struct proc *p)); static int umapfs_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int umapfs_vrele __P((struct mount *mp, struct vnode *vp)); static int umapfs_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -393,6 +394,20 @@ umapfs_vget(mp, ino, vpp) return (VFS_VGET(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, ino, vpp)); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + */ +/* ARGSUSED */ +static int +umapfs_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + vrele(vp); + return (0); +} + static int umapfs_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp) struct mount *mp; @@ -423,6 +438,7 @@ static struct vfsops umap_vfsops = { umapfs_statfs, umapfs_sync, umapfs_vget, + umapfs_vrele, umapfs_fhtovp, umapfs_vptofh, umapfs_init, diff --git a/sys/miscfs/union/union_vfsops.c b/sys/miscfs/union/union_vfsops.c index 78dc7f4fd10..156108dd44c 100644 --- a/sys/miscfs/union/union_vfsops.c +++ b/sys/miscfs/union/union_vfsops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 - * $Id: union_vfsops.c,v 1.25 1998/02/06 12:13:44 eivind Exp $ + * $Id: union_vfsops.c,v 1.26 1998/02/10 08:04:31 kato Exp $ */ /* @@ -74,6 +74,7 @@ static int union_unmount __P((struct mount *mp, int mntflags, struct proc *p)); extern int union_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); +static int union_vrele __P((struct mount *mp, struct vnode *vp)); extern int union_vptofh __P((struct vnode *vp, struct fid *fhp)); /* @@ -522,6 +523,21 @@ union_statfs(mp, sbp, p) return (0); } +/* + * Complement to all vpp returning ops. + * XXX - initially only to get rid of WILLRELE. + * XXX - may change when modification of vops start. + */ +/* ARGSUSED */ +static int +union_vrele(mp, vp) + struct mount *mp; + struct vnode *vp; +{ + vrele(vp); + return (0); +} + /* * XXX - Assumes no data cached at union layer. */ @@ -547,6 +563,7 @@ static struct vfsops union_vfsops = { union_statfs, union_sync, union_vget, + union_vrele, union_fhtovp, union_vptofh, union_init, diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index ec4e5f1c350..2b1d1d7f352 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.27 1998/02/23 14:57:50 kato Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.28 1998/02/23 16:44:32 ache Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -1042,6 +1042,7 @@ static struct vfsops msdosfs_vfsops = { msdosfs_statfs, msdosfs_sync, msdosfs_vget, + vfs_vrele, msdosfs_fhtovp, msdosfs_vptofh, msdosfs_init diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index f66d3baf06a..9ad89ebdecf 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 - * $Id: nfs_vfsops.c,v 1.53 1998/02/05 16:40:57 dyson Exp $ + * $Id: nfs_vfsops.c,v 1.54 1998/02/09 06:10:39 eivind Exp $ */ #include @@ -124,6 +124,7 @@ static struct vfsops nfs_vfsops = { nfs_statfs, nfs_sync, nfs_vget, + vfs_vrele, nfs_fhtovp, nfs_vptofh, nfs_init diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index f66d3baf06a..9ad89ebdecf 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 - * $Id: nfs_vfsops.c,v 1.53 1998/02/05 16:40:57 dyson Exp $ + * $Id: nfs_vfsops.c,v 1.54 1998/02/09 06:10:39 eivind Exp $ */ #include @@ -124,6 +124,7 @@ static struct vfsops nfs_vfsops = { nfs_statfs, nfs_sync, nfs_vget, + vfs_vrele, nfs_fhtovp, nfs_vptofh, nfs_init diff --git a/sys/sys/mount.h b/sys/sys/mount.h index c1206fb89de..9230ae0979b 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mount.h 8.21 (Berkeley) 5/20/95 - * $Id: mount.h,v 1.55 1998/02/21 19:23:04 jkh Exp $ + * $Id: mount.h,v 1.56 1998/02/22 01:17:51 jkh Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -351,6 +351,7 @@ struct vfsops { struct ucred *cred, struct proc *p)); int (*vfs_vget) __P((struct mount *mp, ino_t ino, struct vnode **vpp)); + int (*vfs_vrele) __P((struct mount *mp, struct vnode *vp)); int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp, struct sockaddr *nam, struct vnode **vpp, int *exflagsp, struct ucred **credanonp)); @@ -367,6 +368,7 @@ struct vfsops { #define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P) #define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P) #define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP) +#define VFS_VRELE(MP, VP) (*(MP)->mnt_op->vfs_vrele)(MP, VP) #define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \ (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED) #define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) @@ -443,6 +445,7 @@ void vfs_unlock __P((struct mount *)); /* unlock a vfs */ int vfs_busy __P((struct mount *, int, struct simplelock *, struct proc *)); int vfs_export /* process mount export info */ __P((struct mount *, struct netexport *, struct export_args *)); +int vfs_vrele __P((struct mount *, struct vnode *)); struct netcred *vfs_export_lookup /* lookup host in fs export list */ __P((struct mount *, struct netexport *, struct sockaddr *)); void vfs_getnewfsid __P((struct mount *)); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index b3e23457880..fb46fcb4e28 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 - * $Id: ffs_vfsops.c,v 1.71 1998/02/09 06:11:06 eivind Exp $ + * $Id: ffs_vfsops.c,v 1.72 1998/02/25 04:47:04 bde Exp $ */ #include "opt_quota.h" @@ -83,6 +83,7 @@ static struct vfsops ufs_vfsops = { ffs_statfs, ffs_sync, ffs_vget, + vfs_vrele, ffs_fhtovp, ffs_vptofh, ffs_init, diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c index e37ead5fcf7..735e531ae80 100644 --- a/sys/ufs/mfs/mfs_vfsops.c +++ b/sys/ufs/mfs/mfs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95 - * $Id: mfs_vfsops.c,v 1.39 1998/01/24 02:54:56 eivind Exp $ + * $Id: mfs_vfsops.c,v 1.40 1998/02/09 06:11:08 eivind Exp $ */ #include "opt_mfs.h" @@ -95,6 +95,7 @@ static struct vfsops mfs_vfsops = { mfs_statfs, ffs_sync, ffs_vget, + vfs_vrele, ffs_fhtovp, ffs_vptofh, mfs_init,