diff options
author | marius <marius@FreeBSD.org> | 2010-02-16 20:00:21 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2010-02-16 20:00:21 +0000 |
commit | e51e443f9c10ecdd3c53d6065cdc8b426c492b07 (patch) | |
tree | 798a6052d509cf8b960f4f98ceac2a9fba8e21cd /sys/nfs | |
parent | ceb3f1544b3b73558308c9fdef1209622a768696 (diff) | |
download | FreeBSD-src-e51e443f9c10ecdd3c53d6065cdc8b426c492b07.zip FreeBSD-src-e51e443f9c10ecdd3c53d6065cdc8b426c492b07.tar.gz |
Factor out the code shared between NFS client and server into its own
module. With r203732 it became apparent that creating the sysctl nodes
twice causes at least a warning, however the whole code shouldn't be
present twice in the first place.
Discussed with: rmacklem
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_common.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index abf575f..c56f31f 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include <sys/socket.h> #include <sys/stat.h> #include <sys/malloc.h> +#include <sys/module.h> #include <sys/sysent.h> #include <sys/syscall.h> #include <sys/sysctl.h> @@ -79,15 +80,15 @@ nfstype nfsv3_type[9] = { static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); -SYSCTL_DECL(_vfs_nfs); +SYSCTL_NODE(_vfs, OID_AUTO, nfs_common, CTLFLAG_RD, 0, "NFS common support"); static int nfs_realign_test; -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RD, &nfs_realign_test, - 0, "Number of realign tests done"); +SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_test, CTLFLAG_RD, + &nfs_realign_test, 0, "Number of realign tests done"); static int nfs_realign_count; -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RD, &nfs_realign_count, - 0, "Number of mbuf realignments done"); +SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_count, CTLFLAG_RD, + &nfs_realign_count, 0, "Number of mbuf realignments done"); u_quad_t nfs_curusec(void) @@ -404,3 +405,12 @@ nfs_realign(struct mbuf **pm, int how) } return (0); } + +static moduledata_t nfs_common_mod = { + "nfs_common", + NULL, + NULL +}; + +DECLARE_MODULE(nfs_common, nfs_common_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_VERSION(nfs_common, 1); |