diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2002-02-17 16:41:04 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-02-17 16:41:04 -0800 |
| commit | ff820210adf2a3923aae99bee1c60b2fc6ab1904 (patch) | |
| tree | f61aad804031d5f3b97559e4af2062d746fc4700 /fs/filesystems.c | |
| parent | c4dd77020c9d25067622c2836e83867d521041c9 (diff) | |
[PATCH] PATCH 6/7: knfsd cleanups - syscall cleanup
Cleanup the syscall interface to nfsd
1/ add an "owner" field to the nfsd_linkage structure
2/ grab a reference to that module before calling the syscall
3/ Remove the reference counting from inside the module
4/ Always allow nfsd module to be called, even if compile with
CONFIG_NFSD == N
( but not if CONFIG_MODULES also == N)
Diffstat (limited to 'fs/filesystems.c')
| -rw-r--r-- | fs/filesystems.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/filesystems.c b/fs/filesystems.c index beb785f3cc3d..a465ff2dc0bf 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -3,7 +3,7 @@ * * Copyright (C) 1991, 1992 Linus Torvalds * - * table of configured filesystems + * nfsservctl system-call when nfsd is not compiled in. */ #include <linux/config.h> @@ -14,28 +14,28 @@ #include <linux/nfsd/interface.h> #include <linux/linkage.h> -#if defined(CONFIG_NFSD_MODULE) -struct nfsd_linkage *nfsd_linkage = NULL; +#if ! defined(CONFIG_NFSD) +struct nfsd_linkage *nfsd_linkage; long asmlinkage sys_nfsservctl(int cmd, void *argp, void *resp) { int ret = -ENOSYS; +#if defined(CONFIG_MODULES) lock_kernel(); if (nfsd_linkage || - (request_module ("nfsd") == 0 && nfsd_linkage)) + (request_module ("nfsd") == 0 && nfsd_linkage)) { + __MOD_INC_USE_COUNT(nfsd_linkage->owner); + unlock_kernel(); ret = nfsd_linkage->do_nfsservctl(cmd, argp, resp); - - unlock_kernel(); + __MOD_DEC_USE_COUNT(nfsd_linkage->owner); + } else + unlock_kernel(); +#endif return ret; } EXPORT_SYMBOL(nfsd_linkage); -#elif ! defined (CONFIG_NFSD) -asmlinkage int sys_nfsservctl(int cmd, void *argp, void *resp) -{ - return -ENOSYS; -} #endif /* CONFIG_NFSD */ |
