2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 #include <afsconfig.h>
12 #include <afs/param.h>
15 #include <afs/sysincludes.h>
16 #include <afsincludes.h>
17 #include <sys/module.h>
18 #include <sys/sysproto.h>
19 #include <sys/syscall.h>
21 extern struct vfsops afs_vfsops
;
22 extern struct vnodeopv_desc afs_vnodeop_opv_desc
;
23 extern struct mount
*afs_globalVFS
;
25 MALLOC_DEFINE(M_AFS
, "afsmisc", "memory used by the AFS filesystem");
28 VFS_SET(afs_vfsops
, afs
, VFCF_NETWORK
);
30 int afs_module_handler(module_t mod
, int what
, void *arg
);
32 static struct vfsconf afs_vfsconf
;
33 static moduledata_t afs_mod
= {
39 DECLARE_MODULE(afs
, afs_mod
, SI_SUB_VFS
, SI_ORDER_MIDDLE
);
42 #ifndef AFS_FBSD60_ENV
44 afs_module_handler(module_t mod
, int what
, void *arg
)
46 static int inited
= 0;
52 printf("afs cannot be MOD_LOAD'd more than once\n");
56 memset(&afs_vfsconf
, 0, sizeof(struct vfsconf
));
58 afs_vfsconf
.vfc_version
= VFS_VERSION
;
60 strcpy(afs_vfsconf
.vfc_name
, "AFS");
61 afs_vfsconf
.vfc_vfsops
= &afs_vfsops
;
62 afs_vfsconf
.vfc_typenum
= -1; /* set by vfs_register */
63 afs_vfsconf
.vfc_flags
= VFCF_NETWORK
;
64 if ((error
= vfs_register(&afs_vfsconf
)) != 0)
66 vfs_add_vnodeops(&afs_vnodeop_opv_desc
);
70 #ifndef RXK_LISTENER_ENV
71 /* shutdown is incomplete unless RXK_LISTENER_ENV */
72 printf("afs: I can't be unloaded yet\n");
79 if ((error
= vfs_unregister(&afs_vfsconf
)) != 0) {
82 vfs_rm_vnodeops(&afs_vnodeop_opv_desc
);