1 /* 2 * linux/fs/filesystems.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 * 6 * nfsservctl system-call when nfsd is not compiled in. 7 */ 8 9 #include <linux/config.h> 10 #include <linux/module.h> 11 #include <linux/sched.h> 12 #include <linux/smp_lock.h> 13 #include <linux/kmod.h> 14 #include <linux/nfsd/interface.h> 15 16 #if ! defined(CONFIG_NFSD) 17 struct nfsd_linkage *nfsd_linkage; 18 19 long sys_nfsservctl(int cmd,void * argp,void * resp)20asmlinkage sys_nfsservctl(int cmd, void *argp, void *resp) 21 { 22 int ret = -ENOSYS; 23 24 #if defined(CONFIG_MODULES) 25 lock_kernel(); 26 27 if (nfsd_linkage || 28 (request_module ("nfsd") == 0 && nfsd_linkage)) { 29 __MOD_INC_USE_COUNT(nfsd_linkage->owner); 30 unlock_kernel(); 31 ret = nfsd_linkage->do_nfsservctl(cmd, argp, resp); 32 __MOD_DEC_USE_COUNT(nfsd_linkage->owner); 33 } else 34 unlock_kernel(); 35 #endif 36 return ret; 37 } 38 EXPORT_SYMBOL(nfsd_linkage); 39 40 #endif /* CONFIG_NFSD */ 41