Page MenuHomeFreeBSD

D30102.diff
No OneTemporary

D30102.diff

diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -1438,6 +1438,14 @@
nfscl_modevent,
NULL,
};
+/*
+ * This is the main module declaration for the NFS client. The
+ * nfscl_modevent() function is needed to ensure that the module
+ * cannot be unloaded, among other things.
+ * There is also a module declaration in sys/fs/nfsclient/nfs_clvfsops.c
+ * for the name "nfs" within the VFS_SET() macro that defines the "nfs"
+ * file system type.
+ */
DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_VFS, SI_ORDER_FIRST);
/* So that loader and kldload(2) can find us, wherever we are.. */
@@ -1445,3 +1453,4 @@
MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1);
MODULE_DEPEND(nfscl, krpc, 1, 1, 1);
MODULE_DEPEND(nfscl, nfssvc, 1, 1, 1);
+MODULE_DEPEND(nfscl, xdr, 1, 1, 1);
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -52,7 +52,6 @@
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
-#include <sys/module.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/socket.h>
@@ -148,14 +147,17 @@
.vfs_sysctl = nfs_sysctl,
.vfs_purge = nfs_purge,
};
+/*
+ * This macro declares that the file system type is named "nfs".
+ * It also declares a module name of "nfs" and uses vfs_modevent()
+ * as the event handling function.
+ * The main module declaration is found in sys/fs/nfsclient/nfs_clport.c
+ * for "nfscl" and is needed so that a custom event handling
+ * function gets called. MODULE_DEPEND() macros are found there.
+ */
VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY);
-/* So that loader and kldload(2) can find us, wherever we are.. */
MODULE_VERSION(nfs, 1);
-MODULE_DEPEND(nfs, nfscommon, 1, 1, 1);
-MODULE_DEPEND(nfs, krpc, 1, 1, 1);
-MODULE_DEPEND(nfs, nfssvc, 1, 1, 1);
-MODULE_DEPEND(nfs, xdr, 1, 1, 1);
/*
* This structure is now defined in sys/nfs/nfs_diskless.c so that it

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 31, 3:52 PM (1 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27415662
Default Alt Text
D30102.diff (2 KB)

Event Timeline