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>
17 #include <afs/sysincludes.h>
18 #include <afsincludes.h>
19 #include <sys/module.h>
20 #include <sys/sysproto.h>
21 #include <sys/syscall.h>
23 extern struct vfsops afs_vfsops;
24 extern struct vnodeopv_desc afs_vnodeop_opv_desc;
25 extern struct mount *afs_globalVFS;
27 MALLOC_DEFINE(M_AFS, "afsmisc", "memory used by the AFS filesystem");
30 VFS_SET(afs_vfsops, afs, VFCF_NETWORK);
32 int afs_module_handler(module_t mod, int what, void *arg);
34 static struct vfsconf afs_vfsconf;
35 static moduledata_t afs_mod = {
41 DECLARE_MODULE(afs, afs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE);
44 #ifndef AFS_FBSD60_ENV
46 afs_module_handler(module_t mod, int what, void *arg)
48 static int inited = 0;
54 printf("afs cannot be MOD_LOAD'd more than once\n");
58 memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
60 afs_vfsconf.vfc_version = VFS_VERSION;
62 strcpy(afs_vfsconf.vfc_name, "AFS");
63 afs_vfsconf.vfc_vfsops = &afs_vfsops;
64 afs_vfsconf.vfc_typenum = -1; /* set by vfs_register */
65 afs_vfsconf.vfc_flags = VFCF_NETWORK;
66 if ((error = vfs_register(&afs_vfsconf)) != 0)
68 vfs_add_vnodeops(&afs_vnodeop_opv_desc);
72 #ifndef RXK_LISTENER_ENV
73 /* shutdown is incomplete unless RXK_LISTENER_ENV */
74 printf("afs: I can't be unloaded yet\n");
81 if ((error = vfs_unregister(&afs_vfsconf)) != 0) {
84 vfs_rm_vnodeops(&afs_vnodeop_opv_desc);