Implemented loadable VFS modules, and made most existing filesystems
loadable. (NFS is a notable exception.)
This commit is contained in:
parent
84cc2dc332
commit
c901836c14
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2946
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vfsops.c 8.3 (Berkeley) 1/31/94
|
||||
* $Id: cd9660_vfsops.c,v 1.5 1994/08/20 16:03:07 davidg Exp $
|
||||
* $Id: cd9660_vfsops.c,v 1.6 1994/09/15 19:46:02 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -71,6 +71,8 @@ struct vfsops cd9660_vfsops = {
|
||||
cd9660_vptofh,
|
||||
cd9660_init,
|
||||
};
|
||||
VFS_SET(cd9660_vfsops, cd9660, MOUNT_CD9660, 0);
|
||||
|
||||
|
||||
/*
|
||||
* Called by vfs_mountroot when iso is going to be mounted as root.
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94
|
||||
* $Id: cd9660_vnops.c,v 1.5 1994/09/09 11:10:59 dfr Exp $
|
||||
* $Id: cd9660_vnops.c,v 1.6 1994/09/15 19:46:03 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -937,6 +937,7 @@ struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc cd9660_vnodeop_opv_desc =
|
||||
{ &cd9660_vnodeop_p, cd9660_vnodeop_entries };
|
||||
VNODEOP_SET(cd9660_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Special device vnode ops
|
||||
@ -989,6 +990,7 @@ struct vnodeopv_entry_desc cd9660_specop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc cd9660_specop_opv_desc =
|
||||
{ &cd9660_specop_p, cd9660_specop_entries };
|
||||
VNODEOP_SET(cd9660_specop_opv_desc);
|
||||
|
||||
#ifdef FIFO
|
||||
int (**cd9660_fifoop_p)();
|
||||
@ -1038,4 +1040,6 @@ struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc cd9660_fifoop_opv_desc =
|
||||
{ &cd9660_fifoop_p, cd9660_fifoop_entries };
|
||||
|
||||
VNODEOP_SET(cd9660_fifoop_opv_desc);
|
||||
#endif /* FIFO */
|
||||
|
@ -31,12 +31,13 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id$
|
||||
* $Id: dead_vnops.c,v 1.3 1994/08/02 07:44:51 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/namei.h>
|
||||
@ -136,6 +137,8 @@ struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
|
||||
struct vnodeopv_desc dead_vnodeop_opv_desc =
|
||||
{ &dead_vnodeop_p, dead_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(dead_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: fdesc_vfsops.c,v 1.9 1993/04/06 15:28:33 jsp Exp $
|
||||
* $Id: fdesc_vfsops.c,v 1.1.1.1 1994/05/24 10:04:59 rgrimes Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -44,6 +44,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/proc.h>
|
||||
@ -286,3 +287,5 @@ struct vfsops fdesc_vfsops = {
|
||||
fdesc_vptofh,
|
||||
fdesc_init,
|
||||
};
|
||||
|
||||
VFS_SET(fdesc_vfsops, fdesc, MOUNT_FDESC, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: fdesc_vnops.c,v 1.3 1994/09/09 13:23:20 davidg Exp $
|
||||
* $Id: fdesc_vnops.c,v 1.4 1994/09/09 13:24:26 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -975,3 +975,5 @@ struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc fdesc_vnodeop_opv_desc =
|
||||
{ &fdesc_vnodeop_p, fdesc_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(fdesc_vnodeop_opv_desc);
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94
|
||||
* $Id$
|
||||
* $Id: fifo_vnops.c,v 1.3 1994/08/02 07:44:56 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -108,6 +108,8 @@ struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
struct vnodeopv_desc fifo_vnodeop_opv_desc =
|
||||
{ &fifo_vnodeop_p, fifo_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(fifo_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: msdosfs_vfsops.c,v 1.1 1994/09/19 15:41:45 dfr Exp $ */
|
||||
/* $Id: msdosfs_vfsops.c,v 1.2 1994/09/19 19:24:44 dfr Exp $ */
|
||||
/* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -727,3 +727,5 @@ struct vfsops msdosfs_vfsops = {
|
||||
msdosfs_vptofh,
|
||||
msdosfs_init
|
||||
};
|
||||
|
||||
VFS_SET(msdosfs_vfsops, msdos, MOUNT_MSDOS, 0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id$ */
|
||||
/* $Id: msdosfs_vnops.c,v 1.1 1994/09/19 15:41:46 dfr Exp $ */
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -1931,3 +1931,5 @@ struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc msdosfs_vnodeop_opv_desc =
|
||||
{ &msdosfs_vnodeop_p, msdosfs_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(msdosfs_vnodeop_opv_desc);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
|
||||
*
|
||||
* @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
|
||||
* $Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp jsp $
|
||||
* $Id: null_vfsops.c,v 1.1.1.1 1994/05/24 10:05:03 rgrimes Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -364,3 +364,5 @@ struct vfsops null_vfsops = {
|
||||
nullfs_vptofh,
|
||||
nullfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(null_vfsops, null, MOUNT_NULL, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)null_vnops.c 8.1 (Berkeley) 6/10/93
|
||||
*
|
||||
* $Id: null_vnops.c,v 1.2 1994/08/02 07:45:06 davidg Exp $
|
||||
* $Id: null_vnops.c,v 1.3 1994/08/20 03:48:51 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -455,3 +455,5 @@ struct vnodeopv_entry_desc null_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc null_vnodeop_opv_desc =
|
||||
{ &null_vnodeop_p, null_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(null_vnodeop_opv_desc);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: portal_vfsops.c,v 1.5 1992/05/30 10:25:27 jsp Exp jsp $
|
||||
* $Id: portal_vfsops.c,v 1.1.1.1 1994/05/24 10:05:06 rgrimes Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -311,3 +311,5 @@ struct vfsops portal_vfsops = {
|
||||
portal_vptofh,
|
||||
portal_init,
|
||||
};
|
||||
|
||||
VFS_SET(portal_vfsops, portal, MOUNT_PORTAL, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)portal_vnops.c 8.8 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: portal_vnops.c,v 1.2 1994/05/25 09:08:21 rgrimes Exp $
|
||||
* $Id: portal_vnops.c,v 1.3 1994/08/20 03:48:52 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -707,3 +707,5 @@ struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc portal_vnodeop_opv_desc =
|
||||
{ &portal_vnodeop_p, portal_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(portal_vnodeop_opv_desc);
|
||||
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* @(#)procfs_vfsops.c 8.4 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: procfs_vfsops.c,v 1.3 1994/08/02 07:45:23 davidg Exp $
|
||||
* $Id: procfs_vfsops.c,v 1.4 1994/08/18 22:35:14 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -252,3 +252,5 @@ struct vfsops procfs_vfsops = {
|
||||
procfs_vptofh,
|
||||
procfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(procfs_vfsops, procfs, MOUNT_PROCFS, 0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94
|
||||
*
|
||||
* $Id: procfs_vnops.c,v 1.3 1994/08/02 07:45:25 davidg Exp $
|
||||
* $Id: procfs_vnops.c,v 1.4 1994/08/18 22:35:15 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -831,3 +831,5 @@ struct vnodeopv_entry_desc procfs_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc procfs_vnodeop_opv_desc =
|
||||
{ &procfs_vnodeop_p, procfs_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(procfs_vnodeop_opv_desc);
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
|
||||
* $Id: spec_vnops.c,v 1.3 1994/08/02 07:45:27 davidg Exp $
|
||||
* $Id: spec_vnops.c,v 1.4 1994/08/08 09:11:36 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -107,6 +107,8 @@ struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
struct vnodeopv_desc spec_vnodeop_opv_desc =
|
||||
{ &spec_vnodeop_p, spec_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(spec_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id$
|
||||
* $Id: umap_vfsops.c,v 1.2 1994/08/02 07:45:36 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -405,3 +405,6 @@ struct vfsops umap_vfsops = {
|
||||
umapfs_vptofh,
|
||||
umapfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(umap_vfsops, umap, MOUNT_UMAP, 0);
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94
|
||||
* $Id: umap_vnops.c,v 1.3 1994/08/02 07:45:37 davidg Exp $
|
||||
* $Id: umap_vnops.c,v 1.4 1994/08/20 03:48:54 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -486,3 +486,5 @@ struct vnodeopv_entry_desc umap_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc umap_vnodeop_opv_desc =
|
||||
{ &umap_vnodeop_p, umap_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(umap_vnodeop_opv_desc);
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)union_vfsops.c 8.7 (Berkeley) 3/5/94
|
||||
* $Id$
|
||||
* $Id: union_vfsops.c,v 1.3 1994/08/02 07:45:45 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -549,3 +549,5 @@ struct vfsops union_vfsops = {
|
||||
union_vptofh,
|
||||
union_init,
|
||||
};
|
||||
|
||||
VFS_SET(union_vfsops, union, MOUNT_UNION, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
|
||||
* $Id$
|
||||
* $Id: union_vnops.c,v 1.3 1994/08/02 07:45:47 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -1494,3 +1494,5 @@ struct vnodeopv_entry_desc union_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc union_vnodeop_opv_desc =
|
||||
{ &union_vnodeop_p, union_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(union_vnodeop_opv_desc);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vfsops.c 8.3 (Berkeley) 1/31/94
|
||||
* $Id: cd9660_vfsops.c,v 1.5 1994/08/20 16:03:07 davidg Exp $
|
||||
* $Id: cd9660_vfsops.c,v 1.6 1994/09/15 19:46:02 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -71,6 +71,8 @@ struct vfsops cd9660_vfsops = {
|
||||
cd9660_vptofh,
|
||||
cd9660_init,
|
||||
};
|
||||
VFS_SET(cd9660_vfsops, cd9660, MOUNT_CD9660, 0);
|
||||
|
||||
|
||||
/*
|
||||
* Called by vfs_mountroot when iso is going to be mounted as root.
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94
|
||||
* $Id: cd9660_vnops.c,v 1.5 1994/09/09 11:10:59 dfr Exp $
|
||||
* $Id: cd9660_vnops.c,v 1.6 1994/09/15 19:46:03 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -937,6 +937,7 @@ struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc cd9660_vnodeop_opv_desc =
|
||||
{ &cd9660_vnodeop_p, cd9660_vnodeop_entries };
|
||||
VNODEOP_SET(cd9660_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Special device vnode ops
|
||||
@ -989,6 +990,7 @@ struct vnodeopv_entry_desc cd9660_specop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc cd9660_specop_opv_desc =
|
||||
{ &cd9660_specop_p, cd9660_specop_entries };
|
||||
VNODEOP_SET(cd9660_specop_opv_desc);
|
||||
|
||||
#ifdef FIFO
|
||||
int (**cd9660_fifoop_p)();
|
||||
@ -1038,4 +1040,6 @@ struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc cd9660_fifoop_opv_desc =
|
||||
{ &cd9660_fifoop_p, cd9660_fifoop_entries };
|
||||
|
||||
VNODEOP_SET(cd9660_fifoop_opv_desc);
|
||||
#endif /* FIFO */
|
||||
|
@ -561,65 +561,74 @@ _lkm_vfs(lkmtp, cmd)
|
||||
int cmd;
|
||||
{
|
||||
struct lkm_vfs *args = lkmtp->private.lkm_vfs;
|
||||
struct vfsconf *vfc = args->lkm_vfsconf;
|
||||
extern struct vfsconf void_vfsconf;
|
||||
int i;
|
||||
int err = 0;
|
||||
|
||||
#if 0
|
||||
switch(cmd) {
|
||||
case LKM_E_LOAD:
|
||||
/* don't load twice! */
|
||||
if (lkmexists(lkmtp))
|
||||
return(EEXIST);
|
||||
|
||||
/* make sure there's no VFS in the table with this name */
|
||||
for (i = 0; i < nvfssw; i++)
|
||||
if (vfssw[i] != (struct vfsops *)0 &&
|
||||
strncmp(vfssw[i]->vfs_name,
|
||||
args->lkm_vfsops->vfs_name, MFSNAMELEN) == 0)
|
||||
return (EEXIST);
|
||||
|
||||
/* pick the last available empty slot */
|
||||
for (i = nvfssw - 1; i >= 0; i--)
|
||||
if (vfssw[i] == (struct vfsops *)0)
|
||||
break;
|
||||
if (i == -1) { /* or if none, punt */
|
||||
err = EINVAL;
|
||||
break;
|
||||
for(i = 0; i < MOUNT_MAXTYPE; i++) {
|
||||
if(!strcmp(vfc->vfc_name, vfsconf[i]->vfc_name)) {
|
||||
return EEXIST;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up file system
|
||||
*/
|
||||
vfssw[i] = args->lkm_vfsops;
|
||||
if (args->lkm_offset != vfc->vfc_index)
|
||||
return EINVAL;
|
||||
|
||||
i = args->lkm_offset;
|
||||
if (!args->lkm_offset) {
|
||||
for (i = MOUNT_MAXTYPE - 1; i >= 0; i--) {
|
||||
if(vfsconf[i] == &void_vfsconf)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i < 0) {
|
||||
return EINVAL;
|
||||
}
|
||||
args->lkm_offset = vfc->vfc_index = i;
|
||||
vfsconf[i] = vfc;
|
||||
vfssw[i] = vfc->vfc_vfsops;
|
||||
|
||||
/* like in vfs_op_init */
|
||||
for(i = 0; args->lkm_vnodeops->ls_items[i]; i++) {
|
||||
struct vnodeopv_desc *opv =
|
||||
(struct vnodeopv_desc *)args->lkm_vnodeops->ls_items[i];
|
||||
*(opv->opv_desc_vector_p) = NULL;
|
||||
}
|
||||
vfs_opv_init((struct vnodeopv_desc **)args->lkm_vnodeops->ls_items);
|
||||
|
||||
/*
|
||||
* Call init function for this VFS...
|
||||
*/
|
||||
(*(vfssw[i]->vfs_init))();
|
||||
(*(vfssw[vfc->vfc_index]->vfs_init))();
|
||||
|
||||
/* done! */
|
||||
args->lkm_offset = i; /* slot in vfssw[] */
|
||||
break;
|
||||
|
||||
case LKM_E_UNLOAD:
|
||||
#ifdef notyet
|
||||
/* current slot... */
|
||||
i = args->lkm_offset;
|
||||
|
||||
if (vfsconf[i]->vfc_refcount) {
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
/* replace current slot contents with old contents */
|
||||
vfssw[i] = (struct vfsops *)0;
|
||||
#else
|
||||
/* it's not safe to remove a vfs */
|
||||
err = EBUSY;
|
||||
#endif
|
||||
vfsconf[i] = &void_vfsconf;
|
||||
|
||||
break;
|
||||
|
||||
case LKM_E_STAT: /* no special handling... */
|
||||
break;
|
||||
}
|
||||
#else
|
||||
err = EINVAL;
|
||||
#endif
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
|
||||
* $Id: kern_sysctl.c,v 1.12 1994/09/18 20:39:48 wollman Exp $
|
||||
* $Id: kern_sysctl.c,v 1.13 1994/09/19 21:07:00 ache Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -120,11 +120,9 @@ __sysctl(p, uap, retval)
|
||||
case CTL_NET:
|
||||
fn = net_sysctl;
|
||||
break;
|
||||
#ifdef notyet
|
||||
case CTL_FS:
|
||||
fn = fs_sysctl;
|
||||
break;
|
||||
#endif
|
||||
case CTL_MACHDEP:
|
||||
fn = cpu_sysctl;
|
||||
break;
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94
|
||||
* $Id: vfs_conf.c,v 1.3 1994/08/20 16:03:12 davidg Exp $
|
||||
* $Id: vfs_conf.c,v 1.4 1994/09/19 15:41:13 dfr Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -50,219 +50,3 @@ int (*mountroot)() = ffs_mountroot;
|
||||
|
||||
struct vnode *rootvnode;
|
||||
|
||||
/*
|
||||
* Set up the filesystem operations for vnodes.
|
||||
* The types are defined in mount.h.
|
||||
*/
|
||||
#ifdef FFS
|
||||
extern struct vfsops ufs_vfsops;
|
||||
#define UFS_VFSOPS &ufs_vfsops
|
||||
#else
|
||||
#define UFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef LFS
|
||||
extern struct vfsops lfs_vfsops;
|
||||
#define LFS_VFSOPS &lfs_vfsops
|
||||
#else
|
||||
#define LFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef MFS
|
||||
extern struct vfsops mfs_vfsops;
|
||||
#define MFS_VFSOPS &mfs_vfsops
|
||||
#else
|
||||
#define MFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef NFS
|
||||
extern struct vfsops nfs_vfsops;
|
||||
#define NFS_VFSOPS &nfs_vfsops
|
||||
#else
|
||||
#define NFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef FDESC
|
||||
extern struct vfsops fdesc_vfsops;
|
||||
#define FDESC_VFSOPS &fdesc_vfsops
|
||||
#else
|
||||
#define FDESC_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef PORTAL
|
||||
extern struct vfsops portal_vfsops;
|
||||
#define PORTAL_VFSOPS &portal_vfsops
|
||||
#else
|
||||
#define PORTAL_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef NULLFS
|
||||
extern struct vfsops null_vfsops;
|
||||
#define NULL_VFSOPS &null_vfsops
|
||||
#else
|
||||
#define NULL_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef UMAPFS
|
||||
extern struct vfsops umap_vfsops;
|
||||
#define UMAP_VFSOPS &umap_vfsops
|
||||
#else
|
||||
#define UMAP_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef KERNFS
|
||||
extern struct vfsops kernfs_vfsops;
|
||||
#define KERNFS_VFSOPS &kernfs_vfsops
|
||||
#else
|
||||
#define KERNFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef PROCFS
|
||||
extern struct vfsops procfs_vfsops;
|
||||
#define PROCFS_VFSOPS &procfs_vfsops
|
||||
#else
|
||||
#define PROCFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef AFS
|
||||
extern struct vfsops afs_vfsops;
|
||||
#define AFS_VFSOPS &afs_vfsops
|
||||
#else
|
||||
#define AFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef CD9660
|
||||
extern struct vfsops cd9660_vfsops;
|
||||
#define CD9660_VFSOPS &cd9660_vfsops
|
||||
#else
|
||||
#define CD9660_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef MSDOSFS
|
||||
extern struct vfsops msdosfs_vfsops;
|
||||
#define MSDOSFS_VFSOPS &msdosfs_vfsops
|
||||
#else
|
||||
#define MSDOSFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef UNION
|
||||
extern struct vfsops union_vfsops;
|
||||
#define UNION_VFSOPS &union_vfsops
|
||||
#else
|
||||
#define UNION_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
struct vfsops *vfssw[] = {
|
||||
NULL, /* 0 = MOUNT_NONE */
|
||||
UFS_VFSOPS, /* 1 = MOUNT_UFS */
|
||||
NFS_VFSOPS, /* 2 = MOUNT_NFS */
|
||||
MFS_VFSOPS, /* 3 = MOUNT_MFS */
|
||||
MSDOSFS_VFSOPS, /* 4 = MOUNT_MSDOS */
|
||||
LFS_VFSOPS, /* 5 = MOUNT_LFS */
|
||||
NULL, /* 6 = MOUNT_LOFS */
|
||||
FDESC_VFSOPS, /* 7 = MOUNT_FDESC */
|
||||
PORTAL_VFSOPS, /* 8 = MOUNT_PORTAL */
|
||||
NULL_VFSOPS, /* 9 = MOUNT_NULL */
|
||||
UMAP_VFSOPS, /* 10 = MOUNT_UMAP */
|
||||
KERNFS_VFSOPS, /* 11 = MOUNT_KERNFS */
|
||||
PROCFS_VFSOPS, /* 12 = MOUNT_PROCFS */
|
||||
AFS_VFSOPS, /* 13 = MOUNT_AFS */
|
||||
CD9660_VFSOPS, /* 14 = MOUNT_CD9660 */
|
||||
UNION_VFSOPS, /* 15 = MOUNT_UNION */
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* vfs_opv_descs enumerates the list of vnode classes, each with it's own
|
||||
* vnode operation vector. It is consulted at system boot to build operation
|
||||
* vectors. It is NULL terminated.
|
||||
*
|
||||
*/
|
||||
extern struct vnodeopv_desc ffs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc ffs_specop_opv_desc;
|
||||
extern struct vnodeopv_desc ffs_fifoop_opv_desc;
|
||||
extern struct vnodeopv_desc lfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc lfs_specop_opv_desc;
|
||||
extern struct vnodeopv_desc lfs_fifoop_opv_desc;
|
||||
extern struct vnodeopv_desc mfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc dead_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc fifo_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc spec_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc nfsv2_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc spec_nfsv2nodeop_opv_desc;
|
||||
extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc;
|
||||
extern struct vnodeopv_desc fdesc_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc portal_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc null_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc umap_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc kernfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc procfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc cd9660_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc cd9660_specop_opv_desc;
|
||||
extern struct vnodeopv_desc cd9660_fifoop_opv_desc;
|
||||
extern struct vnodeopv_desc msdosfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc union_vnodeop_opv_desc;
|
||||
|
||||
struct vnodeopv_desc *vfs_opv_descs[] = {
|
||||
&ffs_vnodeop_opv_desc,
|
||||
&ffs_specop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&ffs_fifoop_opv_desc,
|
||||
#endif
|
||||
&dead_vnodeop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&fifo_vnodeop_opv_desc,
|
||||
#endif
|
||||
&spec_vnodeop_opv_desc,
|
||||
#ifdef LFS
|
||||
&lfs_vnodeop_opv_desc,
|
||||
&lfs_specop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&lfs_fifoop_opv_desc,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MFS
|
||||
&mfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef NFS
|
||||
&nfsv2_vnodeop_opv_desc,
|
||||
&spec_nfsv2nodeop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&fifo_nfsv2nodeop_opv_desc,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FDESC
|
||||
&fdesc_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef PORTAL
|
||||
&portal_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef NULLFS
|
||||
&null_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef UMAPFS
|
||||
&umap_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef KERNFS
|
||||
&kernfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef PROCFS
|
||||
&procfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef CD9660
|
||||
&cd9660_vnodeop_opv_desc,
|
||||
&cd9660_specop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&cd9660_fifoop_opv_desc,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MSDOSFS
|
||||
&msdosfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef UNION
|
||||
&union_vnodeop_opv_desc,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.5 1994/09/02 04:14:44 davidg Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.6 1994/09/02 10:23:43 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -135,6 +135,7 @@ mount(p, uap, retval)
|
||||
M_MOUNT, M_WAITOK);
|
||||
bzero((char *)mp, (u_long)sizeof(struct mount));
|
||||
mp->mnt_op = vfssw[uap->type];
|
||||
mp->mnt_vfc = vfsconf[uap->type];
|
||||
if (error = vfs_lock(mp)) {
|
||||
free((caddr_t)mp, M_MOUNT);
|
||||
vput(vp);
|
||||
@ -148,6 +149,8 @@ mount(p, uap, retval)
|
||||
}
|
||||
vp->v_mountedhere = mp;
|
||||
mp->mnt_vnodecovered = vp;
|
||||
vfsconf[uap->type]->vfc_refcount++;
|
||||
|
||||
update:
|
||||
/*
|
||||
* Set the mount level flags.
|
||||
@ -188,6 +191,7 @@ mount(p, uap, retval)
|
||||
vfs_unlock(mp);
|
||||
free((caddr_t)mp, M_MOUNT);
|
||||
vput(vp);
|
||||
vfsconf[uap->type]->vfc_refcount--;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
@ -282,6 +286,7 @@ dounmount(mp, flags, p)
|
||||
TAILQ_REMOVE(&mountlist, mp, mnt_list);
|
||||
mp->mnt_vnodecovered->v_mountedhere = (struct mount *)0;
|
||||
vfs_unlock(mp);
|
||||
mp->mnt_vfc->vfc_refcount--;
|
||||
if (mp->mnt_vnodelist.lh_first != NULL)
|
||||
panic("unmount: dangling vnode");
|
||||
free((caddr_t)mp, M_MOUNT);
|
||||
|
@ -36,12 +36,13 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_init.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: vfs_init.c,v 1.3 1994/08/02 07:43:22 davidg Exp $
|
||||
* $Id: vfs_init.c,v 1.4 1994/08/18 22:35:08 wollman Exp $
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/vnode.h>
|
||||
@ -51,6 +52,9 @@
|
||||
#include <sys/buf.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <vm/vm.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
/*
|
||||
* Sigh, such primitive tools are these...
|
||||
@ -61,8 +65,15 @@
|
||||
#define DODEBUG(A)
|
||||
#endif
|
||||
|
||||
extern struct vnodeopv_desc *vfs_opv_descs[];
|
||||
/* a list of lists of vnodeops defns */
|
||||
struct vfsconf void_vfsconf;
|
||||
|
||||
extern struct linker_set vfs_opv_descs_;
|
||||
#define vfs_opv_descs ((struct vnodeopv_desc **)vfs_opv_descs_.ls_items)
|
||||
|
||||
extern struct linker_set vfs_set;
|
||||
struct vfsops *vfssw[MOUNT_MAXTYPE + 1];
|
||||
struct vfsconf *vfsconf[MOUNT_MAXTYPE + 1];
|
||||
|
||||
extern struct vnodeop_desc *vfs_op_descs[];
|
||||
/* and the operations they perform */
|
||||
/*
|
||||
@ -73,7 +84,7 @@ extern struct vnodeop_desc *vfs_op_descs[];
|
||||
*/
|
||||
int vfs_opv_numops;
|
||||
|
||||
typedef (*PFI)(); /* the standard Pointer to a Function returning an Int */
|
||||
typedef int (*PFI)(); /* the standard Pointer to a Function returning an Int */
|
||||
|
||||
/*
|
||||
* A miscellaneous routine.
|
||||
@ -103,7 +114,7 @@ vn_default_error()
|
||||
* that is a(whole)nother story.) This is a feature.
|
||||
*/
|
||||
void
|
||||
vfs_opv_init()
|
||||
vfs_opv_init(struct vnodeopv_desc **them)
|
||||
{
|
||||
int i, j, k;
|
||||
int (***opv_desc_vector_p)();
|
||||
@ -113,8 +124,8 @@ vfs_opv_init()
|
||||
/*
|
||||
* Allocate the dynamic vectors and fill them in.
|
||||
*/
|
||||
for (i=0; vfs_opv_descs[i]; i++) {
|
||||
opv_desc_vector_p = vfs_opv_descs[i]->opv_desc_vector_p;
|
||||
for (i=0; them[i]; i++) {
|
||||
opv_desc_vector_p = them[i]->opv_desc_vector_p;
|
||||
/*
|
||||
* Allocate and init the vector, if it needs it.
|
||||
* Also handle backwards compatibility.
|
||||
@ -128,8 +139,8 @@ vfs_opv_init()
|
||||
opv_desc_vector_p));
|
||||
}
|
||||
opv_desc_vector = *opv_desc_vector_p;
|
||||
for (j=0; vfs_opv_descs[i]->opv_desc_ops[j].opve_op; j++) {
|
||||
opve_descp = &(vfs_opv_descs[i]->opv_desc_ops[j]);
|
||||
for (j=0; them[i]->opv_desc_ops[j].opve_op; j++) {
|
||||
opve_descp = &(them[i]->opv_desc_ops[j]);
|
||||
|
||||
/*
|
||||
* Sanity check: is this operation listed
|
||||
@ -168,8 +179,8 @@ vfs_opv_init()
|
||||
* with their default. (Sigh, an O(n^3) algorithm. I
|
||||
* could make it better, but that'd be work, and n is small.)
|
||||
*/
|
||||
for (i = 0; vfs_opv_descs[i]; i++) {
|
||||
opv_desc_vector = *(vfs_opv_descs[i]->opv_desc_vector_p);
|
||||
for (i = 0; them[i]; i++) {
|
||||
opv_desc_vector = *(them[i]->opv_desc_vector_p);
|
||||
/*
|
||||
* Force every operations vector to have a default routine.
|
||||
*/
|
||||
@ -223,7 +234,23 @@ void
|
||||
vfsinit()
|
||||
{
|
||||
struct vfsops **vfsp;
|
||||
struct vfsconf **vfc;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Initialize the VFS switch table
|
||||
*/
|
||||
for(i = 0; i < MOUNT_MAXTYPE + 1; i++) {
|
||||
vfsconf[i] = &void_vfsconf;
|
||||
}
|
||||
|
||||
vfc = (struct vfsconf **)vfs_set.ls_items;
|
||||
while(*vfc) {
|
||||
vfssw[(**vfc).vfc_index] = (**vfc).vfc_vfsops;
|
||||
vfsconf[(**vfc).vfc_index] = *vfc;
|
||||
vfc++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the vnode table
|
||||
*/
|
||||
@ -236,7 +263,7 @@ vfsinit()
|
||||
* Build vnode operation vectors.
|
||||
*/
|
||||
vfs_op_init();
|
||||
vfs_opv_init(); /* finish the job */
|
||||
vfs_opv_init(vfs_opv_descs); /* finish the job */
|
||||
/*
|
||||
* Initialize each file system type.
|
||||
*/
|
||||
@ -247,3 +274,55 @@ vfsinit()
|
||||
(*(*vfsp)->vfs_init)();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* kernel related system variables.
|
||||
*/
|
||||
int
|
||||
fs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int namelen;
|
||||
void *oldp;
|
||||
size_t *oldlenp;
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
struct proc *p;
|
||||
{
|
||||
int i;
|
||||
int error;
|
||||
int buflen = *oldlenp;
|
||||
caddr_t where = newp, start = newp;
|
||||
|
||||
switch (name[0]) {
|
||||
case FS_VFSCONF:
|
||||
if (namelen != 1) return ENOTDIR;
|
||||
|
||||
if (oldp == NULL) {
|
||||
*oldlenp = (MOUNT_MAXTYPE+1) * sizeof(struct vfsconf);
|
||||
return 0;
|
||||
}
|
||||
if (newp) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
for(i = 0; i < MOUNT_MAXTYPE + 1; i++) {
|
||||
if(buflen < sizeof *vfsconf[i]) {
|
||||
*oldlenp = where - start;
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
if(error = copyout(vfsconf[i], where,
|
||||
sizeof *vfsconf[i]))
|
||||
return error;
|
||||
where += sizeof *vfsconf[i];
|
||||
buflen -= sizeof *vfsconf[i];
|
||||
}
|
||||
*oldlenp = where - start;
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94
|
||||
* $Id: vfs_conf.c,v 1.3 1994/08/20 16:03:12 davidg Exp $
|
||||
* $Id: vfs_conf.c,v 1.4 1994/09/19 15:41:13 dfr Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -50,219 +50,3 @@ int (*mountroot)() = ffs_mountroot;
|
||||
|
||||
struct vnode *rootvnode;
|
||||
|
||||
/*
|
||||
* Set up the filesystem operations for vnodes.
|
||||
* The types are defined in mount.h.
|
||||
*/
|
||||
#ifdef FFS
|
||||
extern struct vfsops ufs_vfsops;
|
||||
#define UFS_VFSOPS &ufs_vfsops
|
||||
#else
|
||||
#define UFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef LFS
|
||||
extern struct vfsops lfs_vfsops;
|
||||
#define LFS_VFSOPS &lfs_vfsops
|
||||
#else
|
||||
#define LFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef MFS
|
||||
extern struct vfsops mfs_vfsops;
|
||||
#define MFS_VFSOPS &mfs_vfsops
|
||||
#else
|
||||
#define MFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef NFS
|
||||
extern struct vfsops nfs_vfsops;
|
||||
#define NFS_VFSOPS &nfs_vfsops
|
||||
#else
|
||||
#define NFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef FDESC
|
||||
extern struct vfsops fdesc_vfsops;
|
||||
#define FDESC_VFSOPS &fdesc_vfsops
|
||||
#else
|
||||
#define FDESC_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef PORTAL
|
||||
extern struct vfsops portal_vfsops;
|
||||
#define PORTAL_VFSOPS &portal_vfsops
|
||||
#else
|
||||
#define PORTAL_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef NULLFS
|
||||
extern struct vfsops null_vfsops;
|
||||
#define NULL_VFSOPS &null_vfsops
|
||||
#else
|
||||
#define NULL_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef UMAPFS
|
||||
extern struct vfsops umap_vfsops;
|
||||
#define UMAP_VFSOPS &umap_vfsops
|
||||
#else
|
||||
#define UMAP_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef KERNFS
|
||||
extern struct vfsops kernfs_vfsops;
|
||||
#define KERNFS_VFSOPS &kernfs_vfsops
|
||||
#else
|
||||
#define KERNFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef PROCFS
|
||||
extern struct vfsops procfs_vfsops;
|
||||
#define PROCFS_VFSOPS &procfs_vfsops
|
||||
#else
|
||||
#define PROCFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef AFS
|
||||
extern struct vfsops afs_vfsops;
|
||||
#define AFS_VFSOPS &afs_vfsops
|
||||
#else
|
||||
#define AFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef CD9660
|
||||
extern struct vfsops cd9660_vfsops;
|
||||
#define CD9660_VFSOPS &cd9660_vfsops
|
||||
#else
|
||||
#define CD9660_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef MSDOSFS
|
||||
extern struct vfsops msdosfs_vfsops;
|
||||
#define MSDOSFS_VFSOPS &msdosfs_vfsops
|
||||
#else
|
||||
#define MSDOSFS_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
#ifdef UNION
|
||||
extern struct vfsops union_vfsops;
|
||||
#define UNION_VFSOPS &union_vfsops
|
||||
#else
|
||||
#define UNION_VFSOPS NULL
|
||||
#endif
|
||||
|
||||
struct vfsops *vfssw[] = {
|
||||
NULL, /* 0 = MOUNT_NONE */
|
||||
UFS_VFSOPS, /* 1 = MOUNT_UFS */
|
||||
NFS_VFSOPS, /* 2 = MOUNT_NFS */
|
||||
MFS_VFSOPS, /* 3 = MOUNT_MFS */
|
||||
MSDOSFS_VFSOPS, /* 4 = MOUNT_MSDOS */
|
||||
LFS_VFSOPS, /* 5 = MOUNT_LFS */
|
||||
NULL, /* 6 = MOUNT_LOFS */
|
||||
FDESC_VFSOPS, /* 7 = MOUNT_FDESC */
|
||||
PORTAL_VFSOPS, /* 8 = MOUNT_PORTAL */
|
||||
NULL_VFSOPS, /* 9 = MOUNT_NULL */
|
||||
UMAP_VFSOPS, /* 10 = MOUNT_UMAP */
|
||||
KERNFS_VFSOPS, /* 11 = MOUNT_KERNFS */
|
||||
PROCFS_VFSOPS, /* 12 = MOUNT_PROCFS */
|
||||
AFS_VFSOPS, /* 13 = MOUNT_AFS */
|
||||
CD9660_VFSOPS, /* 14 = MOUNT_CD9660 */
|
||||
UNION_VFSOPS, /* 15 = MOUNT_UNION */
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* vfs_opv_descs enumerates the list of vnode classes, each with it's own
|
||||
* vnode operation vector. It is consulted at system boot to build operation
|
||||
* vectors. It is NULL terminated.
|
||||
*
|
||||
*/
|
||||
extern struct vnodeopv_desc ffs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc ffs_specop_opv_desc;
|
||||
extern struct vnodeopv_desc ffs_fifoop_opv_desc;
|
||||
extern struct vnodeopv_desc lfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc lfs_specop_opv_desc;
|
||||
extern struct vnodeopv_desc lfs_fifoop_opv_desc;
|
||||
extern struct vnodeopv_desc mfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc dead_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc fifo_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc spec_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc nfsv2_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc spec_nfsv2nodeop_opv_desc;
|
||||
extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc;
|
||||
extern struct vnodeopv_desc fdesc_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc portal_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc null_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc umap_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc kernfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc procfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc cd9660_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc cd9660_specop_opv_desc;
|
||||
extern struct vnodeopv_desc cd9660_fifoop_opv_desc;
|
||||
extern struct vnodeopv_desc msdosfs_vnodeop_opv_desc;
|
||||
extern struct vnodeopv_desc union_vnodeop_opv_desc;
|
||||
|
||||
struct vnodeopv_desc *vfs_opv_descs[] = {
|
||||
&ffs_vnodeop_opv_desc,
|
||||
&ffs_specop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&ffs_fifoop_opv_desc,
|
||||
#endif
|
||||
&dead_vnodeop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&fifo_vnodeop_opv_desc,
|
||||
#endif
|
||||
&spec_vnodeop_opv_desc,
|
||||
#ifdef LFS
|
||||
&lfs_vnodeop_opv_desc,
|
||||
&lfs_specop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&lfs_fifoop_opv_desc,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MFS
|
||||
&mfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef NFS
|
||||
&nfsv2_vnodeop_opv_desc,
|
||||
&spec_nfsv2nodeop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&fifo_nfsv2nodeop_opv_desc,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FDESC
|
||||
&fdesc_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef PORTAL
|
||||
&portal_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef NULLFS
|
||||
&null_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef UMAPFS
|
||||
&umap_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef KERNFS
|
||||
&kernfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef PROCFS
|
||||
&procfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef CD9660
|
||||
&cd9660_vnodeop_opv_desc,
|
||||
&cd9660_specop_opv_desc,
|
||||
#ifdef FIFO
|
||||
&cd9660_fifoop_opv_desc,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MSDOSFS
|
||||
&msdosfs_vnodeop_opv_desc,
|
||||
#endif
|
||||
#ifdef UNION
|
||||
&union_vnodeop_opv_desc,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.5 1994/09/02 04:14:44 davidg Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.6 1994/09/02 10:23:43 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -135,6 +135,7 @@ mount(p, uap, retval)
|
||||
M_MOUNT, M_WAITOK);
|
||||
bzero((char *)mp, (u_long)sizeof(struct mount));
|
||||
mp->mnt_op = vfssw[uap->type];
|
||||
mp->mnt_vfc = vfsconf[uap->type];
|
||||
if (error = vfs_lock(mp)) {
|
||||
free((caddr_t)mp, M_MOUNT);
|
||||
vput(vp);
|
||||
@ -148,6 +149,8 @@ mount(p, uap, retval)
|
||||
}
|
||||
vp->v_mountedhere = mp;
|
||||
mp->mnt_vnodecovered = vp;
|
||||
vfsconf[uap->type]->vfc_refcount++;
|
||||
|
||||
update:
|
||||
/*
|
||||
* Set the mount level flags.
|
||||
@ -188,6 +191,7 @@ mount(p, uap, retval)
|
||||
vfs_unlock(mp);
|
||||
free((caddr_t)mp, M_MOUNT);
|
||||
vput(vp);
|
||||
vfsconf[uap->type]->vfc_refcount--;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
@ -282,6 +286,7 @@ dounmount(mp, flags, p)
|
||||
TAILQ_REMOVE(&mountlist, mp, mnt_list);
|
||||
mp->mnt_vnodecovered->v_mountedhere = (struct mount *)0;
|
||||
vfs_unlock(mp);
|
||||
mp->mnt_vfc->vfc_refcount--;
|
||||
if (mp->mnt_vnodelist.lh_first != NULL)
|
||||
panic("unmount: dangling vnode");
|
||||
free((caddr_t)mp, M_MOUNT);
|
||||
|
@ -31,12 +31,13 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id$
|
||||
* $Id: dead_vnops.c,v 1.3 1994/08/02 07:44:51 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/namei.h>
|
||||
@ -136,6 +137,8 @@ struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
|
||||
struct vnodeopv_desc dead_vnodeop_opv_desc =
|
||||
{ &dead_vnodeop_p, dead_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(dead_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: fdesc_vfsops.c,v 1.9 1993/04/06 15:28:33 jsp Exp $
|
||||
* $Id: fdesc_vfsops.c,v 1.1.1.1 1994/05/24 10:04:59 rgrimes Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -44,6 +44,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/proc.h>
|
||||
@ -286,3 +287,5 @@ struct vfsops fdesc_vfsops = {
|
||||
fdesc_vptofh,
|
||||
fdesc_init,
|
||||
};
|
||||
|
||||
VFS_SET(fdesc_vfsops, fdesc, MOUNT_FDESC, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: fdesc_vnops.c,v 1.3 1994/09/09 13:23:20 davidg Exp $
|
||||
* $Id: fdesc_vnops.c,v 1.4 1994/09/09 13:24:26 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -975,3 +975,5 @@ struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc fdesc_vnodeop_opv_desc =
|
||||
{ &fdesc_vnodeop_p, fdesc_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(fdesc_vnodeop_opv_desc);
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94
|
||||
* $Id$
|
||||
* $Id: fifo_vnops.c,v 1.3 1994/08/02 07:44:56 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -108,6 +108,8 @@ struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
struct vnodeopv_desc fifo_vnodeop_opv_desc =
|
||||
{ &fifo_vnodeop_p, fifo_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(fifo_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kernfs_vfsops.c 8.4 (Berkeley) 1/21/94
|
||||
* $Id$
|
||||
* $Id: kernfs_vfsops.c,v 1.3 1994/08/02 07:45:02 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -340,3 +340,5 @@ struct vfsops kernfs_vfsops = {
|
||||
kernfs_vptofh,
|
||||
kernfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(kernfs_vfsops, kernfs, MOUNT_KERNFS, 0);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kernfs_vnops.c 8.6 (Berkeley) 2/10/94
|
||||
* $Id: kernfs_vnops.c,v 1.3 1994/08/02 07:45:04 davidg Exp $
|
||||
* $Id: kernfs_vnops.c,v 1.4 1994/08/18 22:35:12 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -775,3 +775,5 @@ struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc kernfs_vnodeop_opv_desc =
|
||||
{ &kernfs_vnodeop_p, kernfs_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(kernfs_vnodeop_opv_desc);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
|
||||
*
|
||||
* @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
|
||||
* $Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp jsp $
|
||||
* $Id: null_vfsops.c,v 1.1.1.1 1994/05/24 10:05:03 rgrimes Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -364,3 +364,5 @@ struct vfsops null_vfsops = {
|
||||
nullfs_vptofh,
|
||||
nullfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(null_vfsops, null, MOUNT_NULL, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)null_vnops.c 8.1 (Berkeley) 6/10/93
|
||||
*
|
||||
* $Id: null_vnops.c,v 1.2 1994/08/02 07:45:06 davidg Exp $
|
||||
* $Id: null_vnops.c,v 1.3 1994/08/20 03:48:51 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -455,3 +455,5 @@ struct vnodeopv_entry_desc null_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc null_vnodeop_opv_desc =
|
||||
{ &null_vnodeop_p, null_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(null_vnodeop_opv_desc);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: portal_vfsops.c,v 1.5 1992/05/30 10:25:27 jsp Exp jsp $
|
||||
* $Id: portal_vfsops.c,v 1.1.1.1 1994/05/24 10:05:06 rgrimes Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -311,3 +311,5 @@ struct vfsops portal_vfsops = {
|
||||
portal_vptofh,
|
||||
portal_init,
|
||||
};
|
||||
|
||||
VFS_SET(portal_vfsops, portal, MOUNT_PORTAL, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)portal_vnops.c 8.8 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: portal_vnops.c,v 1.2 1994/05/25 09:08:21 rgrimes Exp $
|
||||
* $Id: portal_vnops.c,v 1.3 1994/08/20 03:48:52 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -707,3 +707,5 @@ struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc portal_vnodeop_opv_desc =
|
||||
{ &portal_vnodeop_p, portal_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(portal_vnodeop_opv_desc);
|
||||
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* @(#)procfs_vfsops.c 8.4 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id: procfs_vfsops.c,v 1.3 1994/08/02 07:45:23 davidg Exp $
|
||||
* $Id: procfs_vfsops.c,v 1.4 1994/08/18 22:35:14 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -252,3 +252,5 @@ struct vfsops procfs_vfsops = {
|
||||
procfs_vptofh,
|
||||
procfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(procfs_vfsops, procfs, MOUNT_PROCFS, 0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94
|
||||
*
|
||||
* $Id: procfs_vnops.c,v 1.3 1994/08/02 07:45:25 davidg Exp $
|
||||
* $Id: procfs_vnops.c,v 1.4 1994/08/18 22:35:15 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -831,3 +831,5 @@ struct vnodeopv_entry_desc procfs_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc procfs_vnodeop_opv_desc =
|
||||
{ &procfs_vnodeop_p, procfs_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(procfs_vnodeop_opv_desc);
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
|
||||
* $Id: spec_vnops.c,v 1.3 1994/08/02 07:45:27 davidg Exp $
|
||||
* $Id: spec_vnops.c,v 1.4 1994/08/08 09:11:36 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -107,6 +107,8 @@ struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
struct vnodeopv_desc spec_vnodeop_opv_desc =
|
||||
{ &spec_vnodeop_p, spec_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(spec_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@
|
||||
*
|
||||
* @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94
|
||||
*
|
||||
* $Id$
|
||||
* $Id: umap_vfsops.c,v 1.2 1994/08/02 07:45:36 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -405,3 +405,6 @@ struct vfsops umap_vfsops = {
|
||||
umapfs_vptofh,
|
||||
umapfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(umap_vfsops, umap, MOUNT_UMAP, 0);
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94
|
||||
* $Id: umap_vnops.c,v 1.3 1994/08/02 07:45:37 davidg Exp $
|
||||
* $Id: umap_vnops.c,v 1.4 1994/08/20 03:48:54 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -486,3 +486,5 @@ struct vnodeopv_entry_desc umap_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc umap_vnodeop_opv_desc =
|
||||
{ &umap_vnodeop_p, umap_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(umap_vnodeop_opv_desc);
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)union_vfsops.c 8.7 (Berkeley) 3/5/94
|
||||
* $Id$
|
||||
* $Id: union_vfsops.c,v 1.3 1994/08/02 07:45:45 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -549,3 +549,5 @@ struct vfsops union_vfsops = {
|
||||
union_vptofh,
|
||||
union_init,
|
||||
};
|
||||
|
||||
VFS_SET(union_vfsops, union, MOUNT_UNION, 0);
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
|
||||
* $Id$
|
||||
* $Id: union_vnops.c,v 1.3 1994/08/02 07:45:47 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -1494,3 +1494,5 @@ struct vnodeopv_entry_desc union_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc union_vnodeop_opv_desc =
|
||||
{ &union_vnodeop_p, union_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(union_vnodeop_opv_desc);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: msdosfs_vfsops.c,v 1.1 1994/09/19 15:41:45 dfr Exp $ */
|
||||
/* $Id: msdosfs_vfsops.c,v 1.2 1994/09/19 19:24:44 dfr Exp $ */
|
||||
/* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -727,3 +727,5 @@ struct vfsops msdosfs_vfsops = {
|
||||
msdosfs_vptofh,
|
||||
msdosfs_init
|
||||
};
|
||||
|
||||
VFS_SET(msdosfs_vfsops, msdos, MOUNT_MSDOS, 0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id$ */
|
||||
/* $Id: msdosfs_vnops.c,v 1.1 1994/09/19 15:41:46 dfr Exp $ */
|
||||
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -1931,3 +1931,5 @@ struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc msdosfs_vnodeop_opv_desc =
|
||||
{ &msdosfs_vnodeop_p, msdosfs_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(msdosfs_vnodeop_opv_desc);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_vfsops.c,v 1.2 1994/08/02 07:52:16 davidg Exp $
|
||||
* $Id: nfs_vfsops.c,v 1.3 1994/08/20 16:03:19 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -81,6 +81,7 @@ struct vfsops nfs_vfsops = {
|
||||
nfs_vptofh,
|
||||
nfs_init,
|
||||
};
|
||||
VFS_SET(nfs_vfsops, nfs, MOUNT_NFS, 0);
|
||||
|
||||
/*
|
||||
* This structure must be filled in by a primary bootstrap or bootstrap
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
|
||||
* $Id: nfs_vnops.c,v 1.4 1994/08/08 17:30:53 davidg Exp $
|
||||
* $Id: nfs_vnops.c,v 1.5 1994/08/29 06:09:08 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -125,6 +125,7 @@ struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc nfsv2_vnodeop_opv_desc =
|
||||
{ &nfsv2_vnodeop_p, nfsv2_vnodeop_entries };
|
||||
VNODEOP_SET(nfsv2_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Special device vnode ops
|
||||
@ -177,6 +178,7 @@ struct vnodeopv_entry_desc spec_nfsv2nodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc spec_nfsv2nodeop_opv_desc =
|
||||
{ &spec_nfsv2nodeop_p, spec_nfsv2nodeop_entries };
|
||||
VNODEOP_SET(spec_nfsv2nodeop_opv_desc);
|
||||
|
||||
#ifdef FIFO
|
||||
int (**fifo_nfsv2nodeop_p)();
|
||||
@ -227,6 +229,7 @@ struct vnodeopv_entry_desc fifo_nfsv2nodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc =
|
||||
{ &fifo_nfsv2nodeop_p, fifo_nfsv2nodeop_entries };
|
||||
VNODEOP_SET(fifo_nfsv2nodeop_opv_desc);
|
||||
#endif /* FIFO */
|
||||
|
||||
void nqnfs_clientlease();
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_vfsops.c,v 1.2 1994/08/02 07:52:16 davidg Exp $
|
||||
* $Id: nfs_vfsops.c,v 1.3 1994/08/20 16:03:19 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -81,6 +81,7 @@ struct vfsops nfs_vfsops = {
|
||||
nfs_vptofh,
|
||||
nfs_init,
|
||||
};
|
||||
VFS_SET(nfs_vfsops, nfs, MOUNT_NFS, 0);
|
||||
|
||||
/*
|
||||
* This structure must be filled in by a primary bootstrap or bootstrap
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
|
||||
* $Id: nfs_vnops.c,v 1.4 1994/08/08 17:30:53 davidg Exp $
|
||||
* $Id: nfs_vnops.c,v 1.5 1994/08/29 06:09:08 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -125,6 +125,7 @@ struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc nfsv2_vnodeop_opv_desc =
|
||||
{ &nfsv2_vnodeop_p, nfsv2_vnodeop_entries };
|
||||
VNODEOP_SET(nfsv2_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Special device vnode ops
|
||||
@ -177,6 +178,7 @@ struct vnodeopv_entry_desc spec_nfsv2nodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc spec_nfsv2nodeop_opv_desc =
|
||||
{ &spec_nfsv2nodeop_p, spec_nfsv2nodeop_entries };
|
||||
VNODEOP_SET(spec_nfsv2nodeop_opv_desc);
|
||||
|
||||
#ifdef FIFO
|
||||
int (**fifo_nfsv2nodeop_p)();
|
||||
@ -227,6 +229,7 @@ struct vnodeopv_entry_desc fifo_nfsv2nodeop_entries[] = {
|
||||
};
|
||||
struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc =
|
||||
{ &fifo_nfsv2nodeop_p, fifo_nfsv2nodeop_entries };
|
||||
VNODEOP_SET(fifo_nfsv2nodeop_opv_desc);
|
||||
#endif /* FIFO */
|
||||
|
||||
void nqnfs_clientlease();
|
||||
|
@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: lkm.h,v 1.1 1994/08/20 02:23:40 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_LKM_H_
|
||||
@ -80,7 +80,8 @@ struct lkm_vfs {
|
||||
int lkm_ver;
|
||||
char *lkm_name;
|
||||
u_long lkm_offset;
|
||||
struct vfsops *lkm_vfsops;
|
||||
struct linker_set *lkm_vnodeops;
|
||||
struct vfsconf *lkm_vfsconf;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -215,13 +216,14 @@ struct lkm_table {
|
||||
sysentp \
|
||||
};
|
||||
|
||||
#define MOD_VFS(name,vfsslot,vfsopsp) \
|
||||
#define MOD_VFS(name,vfsslot,vnodeops,vfsconf) \
|
||||
static struct lkm_vfs _module = { \
|
||||
LM_VFS, \
|
||||
LKM_VERSION, \
|
||||
name, \
|
||||
vfsslot, \
|
||||
vfsopsp \
|
||||
vnodeops, \
|
||||
vfsconf \
|
||||
};
|
||||
|
||||
#define MOD_DEV(name,devtype,devslot,devp) \
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mount.h 8.13 (Berkeley) 3/27/94
|
||||
* $Id: mount.h,v 1.6 1994/09/15 20:24:26 bde Exp $
|
||||
* $Id: mount.h,v 1.7 1994/09/19 15:41:56 dfr Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_MOUNT_H_
|
||||
@ -135,6 +135,7 @@ struct mount {
|
||||
int mnt_maxsymlinklen; /* max size of short symlink */
|
||||
struct statfs mnt_stat; /* cache of filesystem stats */
|
||||
qaddr_t mnt_data; /* private data */
|
||||
struct vfsconf *mnt_vfc; /* configuration info */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -190,10 +191,25 @@ struct mount {
|
||||
#define MNT_UNMOUNT 0x01000000 /* unmount in progress */
|
||||
#define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */
|
||||
|
||||
/*
|
||||
* used to get configured filesystems information
|
||||
*/
|
||||
#define VFS_MAXNAMELEN 32
|
||||
struct vfsconf {
|
||||
void *vfc_vfsops;
|
||||
char vfc_name[VFS_MAXNAMELEN];
|
||||
int vfc_index;
|
||||
int vfc_refcount;
|
||||
int vfc_flags;
|
||||
};
|
||||
|
||||
/*
|
||||
* Operations supported on mounted file system.
|
||||
*/
|
||||
#ifdef KERNEL
|
||||
|
||||
extern struct vfsconf *vfsconf[];
|
||||
|
||||
#ifdef __STDC__
|
||||
struct nameidata;
|
||||
struct mbuf;
|
||||
@ -234,6 +250,39 @@ struct vfsops {
|
||||
#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)
|
||||
|
||||
#ifdef VFS_LKM
|
||||
#include <sys/conf.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/lkm.h>
|
||||
|
||||
#define VFS_SET(vfsops, fsname, index, flags) \
|
||||
static struct vfsconf _fs_vfsops = { \
|
||||
&vfsops, \
|
||||
#fsname, \
|
||||
index, \
|
||||
1, \
|
||||
flags \
|
||||
}; \
|
||||
extern struct linker_set MODVNOPS; \
|
||||
MOD_VFS(#fsname,index,&MODVNOPS,&_fs_vfsops); \
|
||||
int \
|
||||
fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
|
||||
DISPATCH(lkmtp, cmd, ver, nosys, nosys, nosys); }
|
||||
#else
|
||||
|
||||
#define VFS_SET(vfsops, fsname, index, flags) \
|
||||
static struct vfsconf _fs_vfsops = { \
|
||||
&vfsops, \
|
||||
#fsname, \
|
||||
index, \
|
||||
1, \
|
||||
flags \
|
||||
}; \
|
||||
DATA_SET(vfs_set,_fs_vfsops)
|
||||
#endif /* VFS_LKM */
|
||||
|
||||
#endif /* KERNEL */
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
|
||||
* $Id: sysctl.h,v 1.9 1994/09/16 01:09:42 ache Exp $
|
||||
* $Id: sysctl.h,v 1.10 1994/09/18 20:40:00 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_SYSCTL_H_
|
||||
@ -163,6 +163,16 @@ struct ctlname {
|
||||
{ "ntp_pll", CTLTYPE_NODE }, \
|
||||
}
|
||||
|
||||
/*
|
||||
* CTL_FS identifiers
|
||||
*/
|
||||
#define FS_VFSCONF 0 /* get configured filesystems */
|
||||
#define FS_MAXID 1 /* number of items */
|
||||
|
||||
#define CTL_FS_NAMES { \
|
||||
{ "vfsconf", CTLTYPE_STRUCT }, \
|
||||
}
|
||||
|
||||
/*
|
||||
* KERN_PROC subtypes
|
||||
*/
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
|
||||
* $Id: vnode.h,v 1.5 1994/09/15 20:24:29 bde Exp $
|
||||
* $Id: vnode.h,v 1.6 1994/09/19 15:41:57 dfr Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_VNODE_H_
|
||||
@ -211,6 +211,12 @@ void vref __P((struct vnode *));
|
||||
|
||||
#define NULLVP ((struct vnode *)NULL)
|
||||
|
||||
#ifdef VFS_LKM
|
||||
#define VNODEOP_SET(f) DATA_SET(MODVNOPS,f)
|
||||
#else
|
||||
#define VNODEOP_SET(f) DATA_SET(vfs_opv_descs_,f)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global vnode data.
|
||||
*/
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94
|
||||
* $Id: ffs_vfsops.c,v 1.4 1994/08/18 22:35:54 wollman Exp $
|
||||
* $Id: ffs_vfsops.c,v 1.5 1994/08/20 16:03:25 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -76,6 +76,8 @@ struct vfsops ufs_vfsops = {
|
||||
ffs_init,
|
||||
};
|
||||
|
||||
VFS_SET(ufs_vfsops, ffs, MOUNT_UFS, 0);
|
||||
|
||||
extern u_long nextgennumber;
|
||||
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ffs_vnops.c 8.7 (Berkeley) 2/3/94
|
||||
* $Id: ffs_vnops.c,v 1.2 1994/08/02 07:54:25 davidg Exp $
|
||||
* $Id: ffs_vnops.c,v 1.3 1994/08/08 17:30:59 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -211,6 +211,12 @@ struct vnodeopv_desc ffs_fifoop_opv_desc =
|
||||
{ &ffs_fifoop_p, ffs_fifoop_entries };
|
||||
#endif /* FIFO */
|
||||
|
||||
VNODEOP_SET(ffs_vnodeop_opv_desc);
|
||||
VNODEOP_SET(ffs_specop_opv_desc);
|
||||
#ifdef FIFO
|
||||
VNODEOP_SET(ffs_fifoop_opv_desc);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Enabling cluster read/write operations.
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lfs_vfsops.c 8.7 (Berkeley) 4/16/94
|
||||
* $Id: lfs_vfsops.c,v 1.4 1994/08/20 03:49:02 davidg Exp $
|
||||
* $Id: lfs_vfsops.c,v 1.5 1994/08/20 16:03:26 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -76,6 +76,8 @@ struct vfsops lfs_vfsops = {
|
||||
lfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(lfs_vfsops, lfs, MOUNT_LFS, 0);
|
||||
|
||||
int
|
||||
lfs_mountroot()
|
||||
{
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lfs_vnops.c 8.5 (Berkeley) 12/30/93
|
||||
* $Id$
|
||||
* $Id: lfs_vnops.c,v 1.3 1994/08/02 07:54:40 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -209,6 +209,12 @@ struct vnodeopv_desc lfs_fifoop_opv_desc =
|
||||
{ &lfs_fifoop_p, lfs_fifoop_entries };
|
||||
#endif /* FIFO */
|
||||
|
||||
VNODEOP_SET(lfs_vnodeop_opv_desc);
|
||||
VNODEOP_SET(lfs_specop_opv_desc);
|
||||
#ifdef FIFO
|
||||
VNODEOP_SET(lfs_fifoop_opv_desc);
|
||||
#endif
|
||||
|
||||
#define LFS_READWRITE
|
||||
#include <ufs/ufs/ufs_readwrite.c>
|
||||
#undef LFS_READWRITE
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfs_vfsops.c 8.4 (Berkeley) 4/16/94
|
||||
* $Id: mfs_vfsops.c,v 1.3 1994/08/02 07:54:43 davidg Exp $
|
||||
* $Id: mfs_vfsops.c,v 1.4 1994/08/18 22:35:55 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -80,6 +80,8 @@ struct vfsops mfs_vfsops = {
|
||||
mfs_init,
|
||||
};
|
||||
|
||||
VFS_SET(mfs_vfsops, mfs, MOUNT_MFS, 0);
|
||||
|
||||
/*
|
||||
* Called by main() when mfs is going to be mounted as root.
|
||||
*
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfs_vnops.c 8.3 (Berkeley) 9/21/93
|
||||
* $Id: mfs_vnops.c,v 1.3 1994/08/02 07:54:44 davidg Exp $
|
||||
* $Id: mfs_vnops.c,v 1.4 1994/09/12 11:38:28 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -109,6 +109,8 @@ struct vnodeopv_entry_desc mfs_vnodeop_entries[] = {
|
||||
struct vnodeopv_desc mfs_vnodeop_opv_desc =
|
||||
{ &mfs_vnodeop_p, mfs_vnodeop_entries };
|
||||
|
||||
VNODEOP_SET(mfs_vnodeop_opv_desc);
|
||||
|
||||
/*
|
||||
* Vnode Operations.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user