Fix a few niggling little bugs:

- set args->lkm_offset correctly so that VFS modules can be unloaded
- initialize _fs_vfsops.vfc_refcount correctly so that VFS modules can
  be unloaded
- include kernel.h in a few placves to get the correct definition of DATA_SET
This commit is contained in:
Garrett Wollman 1994-09-21 23:22:52 +00:00
parent 0e4885ff09
commit 67bfdf835b
8 changed files with 17 additions and 14 deletions

View File

@ -35,7 +35,7 @@
*
* @(#)null_vnops.c 8.1 (Berkeley) 6/10/93
*
* $Id: null_vnops.c,v 1.3 1994/08/20 03:48:51 davidg Exp $
* $Id: null_vnops.c,v 1.4 1994/09/21 03:47:02 wollman Exp $
*/
/*
@ -162,6 +162,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/time.h>
#include <sys/types.h>

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94
* $Id: umap_vnops.c,v 1.4 1994/08/20 03:48:54 davidg Exp $
* $Id: umap_vnops.c,v 1.5 1994/09/21 03:47:12 wollman Exp $
*/
/*
@ -43,6 +43,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/vnode.h>

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
* $Id: union_vnops.c,v 1.3 1994/08/02 07:45:47 davidg Exp $
* $Id: union_vnops.c,v 1.4 1994/09/21 03:47:14 wollman Exp $
*/
#include <sys/param.h>
@ -43,6 +43,7 @@
#include <sys/proc.h>
#include <sys/file.h>
#include <sys/time.h>
#include <sys/kernel.h>
#include <sys/types.h>
#include <sys/vnode.h>
#include <sys/mount.h>

View File

@ -578,11 +578,8 @@ _lkm_vfs(lkmtp, cmd)
}
}
if (args->lkm_offset != vfc->vfc_index)
return EINVAL;
i = args->lkm_offset;
if (!args->lkm_offset) {
i = args->lkm_offset = vfc->vfc_index;
if (i < 0) {
for (i = MOUNT_MAXTYPE - 1; i >= 0; i--) {
if(vfsconf[i] == &void_vfsconf)
break;
@ -592,6 +589,7 @@ _lkm_vfs(lkmtp, cmd)
return EINVAL;
}
args->lkm_offset = vfc->vfc_index = i;
vfsconf[i] = vfc;
vfssw[i] = vfc->vfc_vfsops;
@ -609,7 +607,6 @@ _lkm_vfs(lkmtp, cmd)
(*(vfssw[vfc->vfc_index]->vfs_init))();
/* done! */
args->lkm_offset = i; /* slot in vfssw[] */
break;
case LKM_E_UNLOAD:

View File

@ -35,7 +35,7 @@
*
* @(#)null_vnops.c 8.1 (Berkeley) 6/10/93
*
* $Id: null_vnops.c,v 1.3 1994/08/20 03:48:51 davidg Exp $
* $Id: null_vnops.c,v 1.4 1994/09/21 03:47:02 wollman Exp $
*/
/*
@ -162,6 +162,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/time.h>
#include <sys/types.h>

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94
* $Id: umap_vnops.c,v 1.4 1994/08/20 03:48:54 davidg Exp $
* $Id: umap_vnops.c,v 1.5 1994/09/21 03:47:12 wollman Exp $
*/
/*
@ -43,6 +43,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/vnode.h>

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
* $Id: union_vnops.c,v 1.3 1994/08/02 07:45:47 davidg Exp $
* $Id: union_vnops.c,v 1.4 1994/09/21 03:47:14 wollman Exp $
*/
#include <sys/param.h>
@ -43,6 +43,7 @@
#include <sys/proc.h>
#include <sys/file.h>
#include <sys/time.h>
#include <sys/kernel.h>
#include <sys/types.h>
#include <sys/vnode.h>
#include <sys/mount.h>

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mount.h 8.13 (Berkeley) 3/27/94
* $Id: mount.h,v 1.7 1994/09/19 15:41:56 dfr Exp $
* $Id: mount.h,v 1.8 1994/09/21 03:47:31 wollman Exp $
*/
#ifndef _SYS_MOUNT_H_
@ -262,7 +262,7 @@ struct vfsops {
&vfsops, \
#fsname, \
index, \
1, \
0, \
flags \
}; \
extern struct linker_set MODVNOPS; \