mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-06 13:09:50 +00:00
Add an option NFS_NOSERVER which saves 100K in the install kernel (or
any other kernel that uses it). Use with option NFS.
This commit is contained in:
parent
56ee67a3ff
commit
99cb299316
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13416
@ -185,7 +185,7 @@ struct sysent sysent[] = {
|
||||
{ 2, (sy_call_t *)fstatfs }, /* 158 = fstatfs */
|
||||
{ 0, (sy_call_t *)nosys }, /* 159 = nosys */
|
||||
{ 0, (sy_call_t *)nosys }, /* 160 = nosys */
|
||||
#ifdef NFS
|
||||
#if defined(NFS) && !defined (NFS_NOSERVER)
|
||||
{ 2, (sy_call_t *)getfh }, /* 161 = getfh */
|
||||
#else
|
||||
{ 0, (sy_call_t *)nosys }, /* 161 = nosys */
|
||||
|
@ -171,7 +171,7 @@ char *syscallnames[] = {
|
||||
"fstatfs", /* 158 = fstatfs */
|
||||
"#159", /* 159 = nosys */
|
||||
"#160", /* 160 = nosys */
|
||||
#ifdef NFS
|
||||
#if defined(NFS) && !defined (NFS_NOSERVER)
|
||||
"getfh", /* 161 = getfh */
|
||||
#else
|
||||
"#161", /* 161 = nosys */
|
||||
|
@ -1,4 +1,4 @@
|
||||
$Id: syscalls.master,v 1.22 1996/01/04 20:28:48 wollman Exp $
|
||||
$Id: syscalls.master,v 1.23 1996/01/08 04:13:25 peter Exp $
|
||||
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
|
||||
;
|
||||
; System call name/number master file.
|
||||
@ -261,7 +261,7 @@
|
||||
158 STD BSD { int fstatfs(int fd, struct statfs *buf); }
|
||||
159 UNIMPL NOHIDE nosys
|
||||
160 UNIMPL NOHIDE nosys
|
||||
#ifdef NFS
|
||||
#if defined(NFS) && !defined (NFS_NOSERVER)
|
||||
161 STD BSD { int getfh(char *fname, fhandle_t *fhp); }
|
||||
#else
|
||||
161 UNIMPL BSD nosys
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $
|
||||
* $Id: nfs_subs.c,v 1.26 1995/12/17 21:12:30 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -112,6 +112,7 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -144,6 +145,7 @@ int nfsv3_procid[NFS_NPROCS] = {
|
||||
NFSPROC_NOOP
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* and the reverse mapping from generic to Version 2 procedure numbers
|
||||
*/
|
||||
@ -176,6 +178,7 @@ int nfsv2_procid[NFS_NPROCS] = {
|
||||
NFSV2PROC_NOOP,
|
||||
};
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Maps errno values to nfs error numbers.
|
||||
* Use NFSERR_IO as the catch all for ones not specifically defined in
|
||||
@ -533,6 +536,8 @@ static short *nfsrv_v3errmap[] = {
|
||||
nfsv3err_commit,
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
|
||||
extern struct nfsrtt nfsrtt;
|
||||
extern time_t nqnfsstarttime;
|
||||
@ -1122,8 +1127,10 @@ nfs_init()
|
||||
nfs_iodwant[i] = (struct proc *)0;
|
||||
TAILQ_INIT(&nfs_bufq);
|
||||
nfs_nhinit(); /* Init the nfsnode table */
|
||||
#ifndef NFS_NOSERVER
|
||||
nfsrv_init(0); /* Init server data structures */
|
||||
nfsrv_initcache(); /* Init the server request cache */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize the nqnfs server stuff.
|
||||
@ -1140,22 +1147,28 @@ nfs_init()
|
||||
* Initialize reply list and start timer
|
||||
*/
|
||||
TAILQ_INIT(&nfs_reqq);
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_timer(0);
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
lease_check = nfs_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsconf[MOUNT_NFS]->vfc_refcount++; /* make us non-unloadable */
|
||||
#ifdef VFS_LKM
|
||||
sysent[SYS_nfssvc].sy_narg = 2;
|
||||
sysent[SYS_nfssvc].sy_call = nfssvc;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
sysent[SYS_getfh].sy_call = getfh;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
@ -1388,6 +1401,7 @@ nfs_getattrcache(vp, vaper)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Set up nameidata for a lookup() call and do it
|
||||
*/
|
||||
@ -1728,6 +1742,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* This function compares two net addresses by family and returns TRUE
|
||||
* if they are the same host.
|
||||
@ -1881,6 +1896,7 @@ nfs_clearcommit(mp)
|
||||
splx(s);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Map errnos to NFS error numbers. For Version 3 also filter out error
|
||||
* numbers not specified for the associated procedure.
|
||||
@ -1960,3 +1976,4 @@ nfsrv_vrele(struct vnode *vp) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_nqlease.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_nqlease.c,v 1.17 1995/11/21 15:51:31 bde Exp $
|
||||
* $Id: nfs_nqlease.c,v 1.18 1995/12/17 21:12:16 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -140,6 +140,7 @@ extern struct nfsstats nfsstats;
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Get or check for a lease for "vp", based on ND_CHECK flag.
|
||||
* The rules are as follows:
|
||||
@ -346,6 +347,8 @@ nqnfs_lease_check(vp, p, cred, flag)
|
||||
p, (struct mbuf *)0, &cache, &frev, cred);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
#ifdef HAS_VOPLEASE
|
||||
int
|
||||
nqnfs_vop_lease_check(ap)
|
||||
@ -625,6 +628,8 @@ nqsrv_waitfor_expiry(lp)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
|
||||
/*
|
||||
* Nqnfs server timer that maintains the server lease queue.
|
||||
* Scan the lease queue for expired entries:
|
||||
@ -847,6 +852,8 @@ nqnfsrv_vacated(nfsd, slp, procp, mrq)
|
||||
return (EPERM);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Client get lease rpc function.
|
||||
*/
|
||||
@ -941,6 +948,8 @@ nqnfs_vacated(vp, cred)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
|
||||
/*
|
||||
* Called for client side callbacks
|
||||
*/
|
||||
@ -999,6 +1008,7 @@ nqnfs_callback(nmp, mrep, md, dpos)
|
||||
nfsm_srvdone;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Nqnfs client helper daemon. Runs once a second to expire leases.
|
||||
* It also get authorization strings for "kerb" mounts.
|
||||
@ -1159,6 +1169,8 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, p)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Adjust all timer queue expiry times when the time of day clock is changed.
|
||||
* Called from the settimeofday() syscall.
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
||||
* $Id: nfs_serv.c,v 1.26 1995/12/07 12:47:25 davidg Exp $
|
||||
* $Id: nfs_serv.c,v 1.27 1995/12/17 21:12:22 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -85,21 +85,22 @@
|
||||
#include <nfs/nfsm_subs.h>
|
||||
#include <nfs/nqnfs.h>
|
||||
|
||||
nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK,
|
||||
NFFIFO, NFNON };
|
||||
#ifndef NFS_NOSERVER
|
||||
nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
|
||||
NFCHR, NFNON };
|
||||
/* Global vars */
|
||||
extern u_long nfs_xdrneg1;
|
||||
extern u_long nfs_false, nfs_true;
|
||||
extern enum vtype nv3tov_type[8];
|
||||
extern struct nfsstats nfsstats;
|
||||
nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
|
||||
NFCHR, NFNON };
|
||||
nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK,
|
||||
NFFIFO, NFNON };
|
||||
|
||||
int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000;
|
||||
|
||||
int nfs_async;
|
||||
SYSCTL_INT(_fs_nfs, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, "");
|
||||
|
||||
|
||||
static int nfsrv_access __P((struct vnode *,int,struct ucred *,int,
|
||||
struct proc *));
|
||||
static void nfsrvw_coalesce __P((struct nfsrv_descript *,
|
||||
@ -3431,3 +3432,5 @@ nfsrv_access(vp, flags, cred, rdonly, p)
|
||||
return (error);
|
||||
return (0);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94
|
||||
* $Id: nfs_socket.c,v 1.12 1995/12/03 10:02:59 bde Exp $
|
||||
* $Id: nfs_socket.c,v 1.13 1995/12/17 21:12:25 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -143,6 +143,7 @@ static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname,
|
||||
static int nfs_reconnect __P((struct nfsreq *rep));
|
||||
static int nfsrv_getstream __P((struct nfssvc_sock *,int));
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
|
||||
struct nfssvc_sock *slp,
|
||||
struct proc *procp,
|
||||
@ -174,6 +175,7 @@ int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
|
||||
nfsrv_noop,
|
||||
nfsrv_noop
|
||||
};
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Initialize sockets and congestion for a new NFS connection.
|
||||
@ -715,6 +717,7 @@ nfs_reply(myrep)
|
||||
nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
|
||||
rxid = *tl++;
|
||||
if (*tl != rpc_reply) {
|
||||
#ifndef NFS_NOSERVER
|
||||
if (nmp->nm_flag & NFSMNT_NQNFS) {
|
||||
if (nqnfs_callback(nmp, mrep, md, dpos))
|
||||
nfsstats.rpcinvalid++;
|
||||
@ -722,6 +725,10 @@ nfs_reply(myrep)
|
||||
nfsstats.rpcinvalid++;
|
||||
m_freem(mrep);
|
||||
}
|
||||
#else
|
||||
nfsstats.rpcinvalid++;
|
||||
m_freem(mrep);
|
||||
#endif
|
||||
nfsmout:
|
||||
if (myrep->r_flags & R_GETONEREP)
|
||||
return (0);
|
||||
@ -1104,6 +1111,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Generate the rpc reply header
|
||||
* siz arg. is used to decide if adding a cluster is worthwhile
|
||||
@ -1256,6 +1264,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Nfs timer routine
|
||||
* Scan the nfsreq list and retranmit any requests that have timed out
|
||||
@ -1386,6 +1395,8 @@ nfs_timer(arg)
|
||||
timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Test for a termination condition pending on the process.
|
||||
* This is used for NFSMNT_INT mounts.
|
||||
@ -1593,6 +1604,7 @@ nfs_realign(m, hsiz)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Socket upcall routine for the nfsd sockets.
|
||||
* The caddr_t arg is a pointer to the "struct nfssvc_sock".
|
||||
@ -2145,6 +2157,7 @@ nfsrv_wakenfsd(slp)
|
||||
slp->ns_flag |= SLP_DOREC;
|
||||
nfsd_head_flag |= NFSD_CHECKSLP;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
static int
|
||||
nfs_msg(p, server, msg)
|
||||
|
@ -34,9 +34,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_srvcache.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: nfs_srvcache.c,v 1.6 1995/06/27 11:06:43 dfr Exp $
|
||||
* $Id: nfs_srvcache.c,v 1.7 1995/12/17 21:12:27 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Reference: Chet Juszczak, "Improving the Performance and Correctness
|
||||
* of an NFS Server", in Proc. Winter 1989 USENIX Conference,
|
||||
@ -336,3 +337,5 @@ nfsrv_cleancache()
|
||||
}
|
||||
numnfsrvcache = 0;
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $
|
||||
* $Id: nfs_subs.c,v 1.26 1995/12/17 21:12:30 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -112,6 +112,7 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -144,6 +145,7 @@ int nfsv3_procid[NFS_NPROCS] = {
|
||||
NFSPROC_NOOP
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* and the reverse mapping from generic to Version 2 procedure numbers
|
||||
*/
|
||||
@ -176,6 +178,7 @@ int nfsv2_procid[NFS_NPROCS] = {
|
||||
NFSV2PROC_NOOP,
|
||||
};
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Maps errno values to nfs error numbers.
|
||||
* Use NFSERR_IO as the catch all for ones not specifically defined in
|
||||
@ -533,6 +536,8 @@ static short *nfsrv_v3errmap[] = {
|
||||
nfsv3err_commit,
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
|
||||
extern struct nfsrtt nfsrtt;
|
||||
extern time_t nqnfsstarttime;
|
||||
@ -1122,8 +1127,10 @@ nfs_init()
|
||||
nfs_iodwant[i] = (struct proc *)0;
|
||||
TAILQ_INIT(&nfs_bufq);
|
||||
nfs_nhinit(); /* Init the nfsnode table */
|
||||
#ifndef NFS_NOSERVER
|
||||
nfsrv_init(0); /* Init server data structures */
|
||||
nfsrv_initcache(); /* Init the server request cache */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize the nqnfs server stuff.
|
||||
@ -1140,22 +1147,28 @@ nfs_init()
|
||||
* Initialize reply list and start timer
|
||||
*/
|
||||
TAILQ_INIT(&nfs_reqq);
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_timer(0);
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
lease_check = nfs_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsconf[MOUNT_NFS]->vfc_refcount++; /* make us non-unloadable */
|
||||
#ifdef VFS_LKM
|
||||
sysent[SYS_nfssvc].sy_narg = 2;
|
||||
sysent[SYS_nfssvc].sy_call = nfssvc;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
sysent[SYS_getfh].sy_call = getfh;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
@ -1388,6 +1401,7 @@ nfs_getattrcache(vp, vaper)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Set up nameidata for a lookup() call and do it
|
||||
*/
|
||||
@ -1728,6 +1742,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* This function compares two net addresses by family and returns TRUE
|
||||
* if they are the same host.
|
||||
@ -1881,6 +1896,7 @@ nfs_clearcommit(mp)
|
||||
splx(s);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Map errnos to NFS error numbers. For Version 3 also filter out error
|
||||
* numbers not specified for the associated procedure.
|
||||
@ -1960,3 +1976,4 @@ nfsrv_vrele(struct vnode *vp) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_syscalls.c,v 1.11 1995/12/03 10:03:06 bde Exp $
|
||||
* $Id: nfs_syscalls.c,v 1.12 1995/12/17 21:12:33 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -87,25 +87,26 @@ extern struct nfsstats nfsstats;
|
||||
extern int nfsrvw_procrastinate;
|
||||
struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock;
|
||||
static int nuidhash_max = NFS_MAXUIDHASH;
|
||||
static int nfs_numnfsd = 0;
|
||||
int nfsd_waiting = 0;
|
||||
static int notstarted = 1;
|
||||
static int modify_flag = 0;
|
||||
static struct nfsdrt nfsdrt;
|
||||
|
||||
static void nfsrv_zapsock __P((struct nfssvc_sock *slp));
|
||||
static int nfssvc_iod __P((struct proc *));
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON];
|
||||
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
int nfsd_waiting = 0;
|
||||
static struct nfsdrt nfsdrt;
|
||||
static int nfs_numnfsd = 0;
|
||||
static int notstarted = 1;
|
||||
static int modify_flag = 0;
|
||||
static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd,
|
||||
int cacherep));
|
||||
static int nfssvc_addsock __P((struct file *,struct mbuf *));
|
||||
static int nfssvc_iod __P((struct proc *));
|
||||
static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *));
|
||||
|
||||
/*
|
||||
* NFS server system calls
|
||||
* getfh() lives here too, but maybe should move to kern/vfs_syscalls.c
|
||||
@ -152,6 +153,7 @@ getfh(p, uap, retval)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* Nfs server psuedo system call for the nfsd's
|
||||
* Based on the flag value it either:
|
||||
@ -171,6 +173,7 @@ nfssvc(p, uap, retval)
|
||||
register struct nfssvc_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
#ifndef NFS_NOSERVER
|
||||
struct nameidata nd;
|
||||
struct file *fp;
|
||||
struct mbuf *nam;
|
||||
@ -181,6 +184,7 @@ nfssvc(p, uap, retval)
|
||||
struct nfssvc_sock *slp;
|
||||
struct nfsuid *nuidp;
|
||||
struct nfsmount *nmp;
|
||||
#endif /* NFS_NOSERVER */
|
||||
int error;
|
||||
|
||||
/*
|
||||
@ -195,6 +199,10 @@ nfssvc(p, uap, retval)
|
||||
}
|
||||
if (uap->flag & NFSSVC_BIOD)
|
||||
error = nfssvc_iod(p);
|
||||
#ifdef NFS_NOSERVER
|
||||
else
|
||||
error = ENXIO;
|
||||
#else /* !NFS_NOSERVER */
|
||||
else if (uap->flag & NFSSVC_MNTD) {
|
||||
error = copyin(uap->argp, (caddr_t)&ncd, sizeof (ncd));
|
||||
if (error)
|
||||
@ -327,11 +335,13 @@ nfssvc(p, uap, retval)
|
||||
nfsd->nfsd_flag |= NFSD_AUTHFAIL;
|
||||
error = nfssvc_nfsd(nsd, uap->argp, p);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
if (error == EINTR || error == ERESTART)
|
||||
error = 0;
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Adds a socket to the list for servicing by nfsds.
|
||||
*/
|
||||
@ -702,6 +712,7 @@ nfssvc_nfsd(nsd, argp, p)
|
||||
nfsrv_init(TRUE); /* Reinitialize everything */
|
||||
return (error);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Asynchronous I/O daemons for client nfs.
|
||||
@ -1038,6 +1049,7 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Derefence a server socket structure. If it has no more references and
|
||||
* is no longer valid, you can throw it away.
|
||||
@ -1134,3 +1146,4 @@ nfsd_rt(sotype, nd, cacherep)
|
||||
rt->tstamp = time;
|
||||
nfsdrt.pos = (nfsdrt.pos + 1) % NFSRTTLOGSIZ;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_syscalls.c,v 1.11 1995/12/03 10:03:06 bde Exp $
|
||||
* $Id: nfs_syscalls.c,v 1.12 1995/12/17 21:12:33 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -87,25 +87,26 @@ extern struct nfsstats nfsstats;
|
||||
extern int nfsrvw_procrastinate;
|
||||
struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock;
|
||||
static int nuidhash_max = NFS_MAXUIDHASH;
|
||||
static int nfs_numnfsd = 0;
|
||||
int nfsd_waiting = 0;
|
||||
static int notstarted = 1;
|
||||
static int modify_flag = 0;
|
||||
static struct nfsdrt nfsdrt;
|
||||
|
||||
static void nfsrv_zapsock __P((struct nfssvc_sock *slp));
|
||||
static int nfssvc_iod __P((struct proc *));
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON];
|
||||
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
int nfsd_waiting = 0;
|
||||
static struct nfsdrt nfsdrt;
|
||||
static int nfs_numnfsd = 0;
|
||||
static int notstarted = 1;
|
||||
static int modify_flag = 0;
|
||||
static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd,
|
||||
int cacherep));
|
||||
static int nfssvc_addsock __P((struct file *,struct mbuf *));
|
||||
static int nfssvc_iod __P((struct proc *));
|
||||
static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *));
|
||||
|
||||
/*
|
||||
* NFS server system calls
|
||||
* getfh() lives here too, but maybe should move to kern/vfs_syscalls.c
|
||||
@ -152,6 +153,7 @@ getfh(p, uap, retval)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* Nfs server psuedo system call for the nfsd's
|
||||
* Based on the flag value it either:
|
||||
@ -171,6 +173,7 @@ nfssvc(p, uap, retval)
|
||||
register struct nfssvc_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
#ifndef NFS_NOSERVER
|
||||
struct nameidata nd;
|
||||
struct file *fp;
|
||||
struct mbuf *nam;
|
||||
@ -181,6 +184,7 @@ nfssvc(p, uap, retval)
|
||||
struct nfssvc_sock *slp;
|
||||
struct nfsuid *nuidp;
|
||||
struct nfsmount *nmp;
|
||||
#endif /* NFS_NOSERVER */
|
||||
int error;
|
||||
|
||||
/*
|
||||
@ -195,6 +199,10 @@ nfssvc(p, uap, retval)
|
||||
}
|
||||
if (uap->flag & NFSSVC_BIOD)
|
||||
error = nfssvc_iod(p);
|
||||
#ifdef NFS_NOSERVER
|
||||
else
|
||||
error = ENXIO;
|
||||
#else /* !NFS_NOSERVER */
|
||||
else if (uap->flag & NFSSVC_MNTD) {
|
||||
error = copyin(uap->argp, (caddr_t)&ncd, sizeof (ncd));
|
||||
if (error)
|
||||
@ -327,11 +335,13 @@ nfssvc(p, uap, retval)
|
||||
nfsd->nfsd_flag |= NFSD_AUTHFAIL;
|
||||
error = nfssvc_nfsd(nsd, uap->argp, p);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
if (error == EINTR || error == ERESTART)
|
||||
error = 0;
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Adds a socket to the list for servicing by nfsds.
|
||||
*/
|
||||
@ -702,6 +712,7 @@ nfssvc_nfsd(nsd, argp, p)
|
||||
nfsrv_init(TRUE); /* Reinitialize everything */
|
||||
return (error);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Asynchronous I/O daemons for client nfs.
|
||||
@ -1038,6 +1049,7 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Derefence a server socket structure. If it has no more references and
|
||||
* is no longer valid, you can throw it away.
|
||||
@ -1134,3 +1146,4 @@ nfsd_rt(sotype, nd, cacherep)
|
||||
rt->tstamp = time;
|
||||
nfsdrt.pos = (nfsdrt.pos + 1) % NFSRTTLOGSIZ;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94
|
||||
* $Id: nfs_socket.c,v 1.12 1995/12/03 10:02:59 bde Exp $
|
||||
* $Id: nfs_socket.c,v 1.13 1995/12/17 21:12:25 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -143,6 +143,7 @@ static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname,
|
||||
static int nfs_reconnect __P((struct nfsreq *rep));
|
||||
static int nfsrv_getstream __P((struct nfssvc_sock *,int));
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
|
||||
struct nfssvc_sock *slp,
|
||||
struct proc *procp,
|
||||
@ -174,6 +175,7 @@ int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
|
||||
nfsrv_noop,
|
||||
nfsrv_noop
|
||||
};
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Initialize sockets and congestion for a new NFS connection.
|
||||
@ -715,6 +717,7 @@ nfs_reply(myrep)
|
||||
nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
|
||||
rxid = *tl++;
|
||||
if (*tl != rpc_reply) {
|
||||
#ifndef NFS_NOSERVER
|
||||
if (nmp->nm_flag & NFSMNT_NQNFS) {
|
||||
if (nqnfs_callback(nmp, mrep, md, dpos))
|
||||
nfsstats.rpcinvalid++;
|
||||
@ -722,6 +725,10 @@ nfs_reply(myrep)
|
||||
nfsstats.rpcinvalid++;
|
||||
m_freem(mrep);
|
||||
}
|
||||
#else
|
||||
nfsstats.rpcinvalid++;
|
||||
m_freem(mrep);
|
||||
#endif
|
||||
nfsmout:
|
||||
if (myrep->r_flags & R_GETONEREP)
|
||||
return (0);
|
||||
@ -1104,6 +1111,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Generate the rpc reply header
|
||||
* siz arg. is used to decide if adding a cluster is worthwhile
|
||||
@ -1256,6 +1264,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Nfs timer routine
|
||||
* Scan the nfsreq list and retranmit any requests that have timed out
|
||||
@ -1386,6 +1395,8 @@ nfs_timer(arg)
|
||||
timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Test for a termination condition pending on the process.
|
||||
* This is used for NFSMNT_INT mounts.
|
||||
@ -1593,6 +1604,7 @@ nfs_realign(m, hsiz)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Socket upcall routine for the nfsd sockets.
|
||||
* The caddr_t arg is a pointer to the "struct nfssvc_sock".
|
||||
@ -2145,6 +2157,7 @@ nfsrv_wakenfsd(slp)
|
||||
slp->ns_flag |= SLP_DOREC;
|
||||
nfsd_head_flag |= NFSD_CHECKSLP;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
static int
|
||||
nfs_msg(p, server, msg)
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $
|
||||
* $Id: nfs_subs.c,v 1.26 1995/12/17 21:12:30 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -112,6 +112,7 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -144,6 +145,7 @@ int nfsv3_procid[NFS_NPROCS] = {
|
||||
NFSPROC_NOOP
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* and the reverse mapping from generic to Version 2 procedure numbers
|
||||
*/
|
||||
@ -176,6 +178,7 @@ int nfsv2_procid[NFS_NPROCS] = {
|
||||
NFSV2PROC_NOOP,
|
||||
};
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Maps errno values to nfs error numbers.
|
||||
* Use NFSERR_IO as the catch all for ones not specifically defined in
|
||||
@ -533,6 +536,8 @@ static short *nfsrv_v3errmap[] = {
|
||||
nfsv3err_commit,
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
|
||||
extern struct nfsrtt nfsrtt;
|
||||
extern time_t nqnfsstarttime;
|
||||
@ -1122,8 +1127,10 @@ nfs_init()
|
||||
nfs_iodwant[i] = (struct proc *)0;
|
||||
TAILQ_INIT(&nfs_bufq);
|
||||
nfs_nhinit(); /* Init the nfsnode table */
|
||||
#ifndef NFS_NOSERVER
|
||||
nfsrv_init(0); /* Init server data structures */
|
||||
nfsrv_initcache(); /* Init the server request cache */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize the nqnfs server stuff.
|
||||
@ -1140,22 +1147,28 @@ nfs_init()
|
||||
* Initialize reply list and start timer
|
||||
*/
|
||||
TAILQ_INIT(&nfs_reqq);
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_timer(0);
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
lease_check = nfs_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsconf[MOUNT_NFS]->vfc_refcount++; /* make us non-unloadable */
|
||||
#ifdef VFS_LKM
|
||||
sysent[SYS_nfssvc].sy_narg = 2;
|
||||
sysent[SYS_nfssvc].sy_call = nfssvc;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
sysent[SYS_getfh].sy_call = getfh;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
@ -1388,6 +1401,7 @@ nfs_getattrcache(vp, vaper)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Set up nameidata for a lookup() call and do it
|
||||
*/
|
||||
@ -1728,6 +1742,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* This function compares two net addresses by family and returns TRUE
|
||||
* if they are the same host.
|
||||
@ -1881,6 +1896,7 @@ nfs_clearcommit(mp)
|
||||
splx(s);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Map errnos to NFS error numbers. For Version 3 also filter out error
|
||||
* numbers not specified for the associated procedure.
|
||||
@ -1960,3 +1976,4 @@ nfsrv_vrele(struct vnode *vp) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
||||
* $Id: nfs_serv.c,v 1.26 1995/12/07 12:47:25 davidg Exp $
|
||||
* $Id: nfs_serv.c,v 1.27 1995/12/17 21:12:22 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -85,21 +85,22 @@
|
||||
#include <nfs/nfsm_subs.h>
|
||||
#include <nfs/nqnfs.h>
|
||||
|
||||
nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK,
|
||||
NFFIFO, NFNON };
|
||||
#ifndef NFS_NOSERVER
|
||||
nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
|
||||
NFCHR, NFNON };
|
||||
/* Global vars */
|
||||
extern u_long nfs_xdrneg1;
|
||||
extern u_long nfs_false, nfs_true;
|
||||
extern enum vtype nv3tov_type[8];
|
||||
extern struct nfsstats nfsstats;
|
||||
nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
|
||||
NFCHR, NFNON };
|
||||
nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK,
|
||||
NFFIFO, NFNON };
|
||||
|
||||
int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000;
|
||||
|
||||
int nfs_async;
|
||||
SYSCTL_INT(_fs_nfs, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, "");
|
||||
|
||||
|
||||
static int nfsrv_access __P((struct vnode *,int,struct ucred *,int,
|
||||
struct proc *));
|
||||
static void nfsrvw_coalesce __P((struct nfsrv_descript *,
|
||||
@ -3431,3 +3432,5 @@ nfsrv_access(vp, flags, cred, rdonly, p)
|
||||
return (error);
|
||||
return (0);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
|
@ -34,9 +34,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_srvcache.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: nfs_srvcache.c,v 1.6 1995/06/27 11:06:43 dfr Exp $
|
||||
* $Id: nfs_srvcache.c,v 1.7 1995/12/17 21:12:27 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Reference: Chet Juszczak, "Improving the Performance and Correctness
|
||||
* of an NFS Server", in Proc. Winter 1989 USENIX Conference,
|
||||
@ -336,3 +337,5 @@ nfsrv_cleancache()
|
||||
}
|
||||
numnfsrvcache = 0;
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94
|
||||
* $Id: nfs_socket.c,v 1.12 1995/12/03 10:02:59 bde Exp $
|
||||
* $Id: nfs_socket.c,v 1.13 1995/12/17 21:12:25 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -143,6 +143,7 @@ static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname,
|
||||
static int nfs_reconnect __P((struct nfsreq *rep));
|
||||
static int nfsrv_getstream __P((struct nfssvc_sock *,int));
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
|
||||
struct nfssvc_sock *slp,
|
||||
struct proc *procp,
|
||||
@ -174,6 +175,7 @@ int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
|
||||
nfsrv_noop,
|
||||
nfsrv_noop
|
||||
};
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Initialize sockets and congestion for a new NFS connection.
|
||||
@ -715,6 +717,7 @@ nfs_reply(myrep)
|
||||
nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
|
||||
rxid = *tl++;
|
||||
if (*tl != rpc_reply) {
|
||||
#ifndef NFS_NOSERVER
|
||||
if (nmp->nm_flag & NFSMNT_NQNFS) {
|
||||
if (nqnfs_callback(nmp, mrep, md, dpos))
|
||||
nfsstats.rpcinvalid++;
|
||||
@ -722,6 +725,10 @@ nfs_reply(myrep)
|
||||
nfsstats.rpcinvalid++;
|
||||
m_freem(mrep);
|
||||
}
|
||||
#else
|
||||
nfsstats.rpcinvalid++;
|
||||
m_freem(mrep);
|
||||
#endif
|
||||
nfsmout:
|
||||
if (myrep->r_flags & R_GETONEREP)
|
||||
return (0);
|
||||
@ -1104,6 +1111,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Generate the rpc reply header
|
||||
* siz arg. is used to decide if adding a cluster is worthwhile
|
||||
@ -1256,6 +1264,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Nfs timer routine
|
||||
* Scan the nfsreq list and retranmit any requests that have timed out
|
||||
@ -1386,6 +1395,8 @@ nfs_timer(arg)
|
||||
timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Test for a termination condition pending on the process.
|
||||
* This is used for NFSMNT_INT mounts.
|
||||
@ -1593,6 +1604,7 @@ nfs_realign(m, hsiz)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Socket upcall routine for the nfsd sockets.
|
||||
* The caddr_t arg is a pointer to the "struct nfssvc_sock".
|
||||
@ -2145,6 +2157,7 @@ nfsrv_wakenfsd(slp)
|
||||
slp->ns_flag |= SLP_DOREC;
|
||||
nfsd_head_flag |= NFSD_CHECKSLP;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
static int
|
||||
nfs_msg(p, server, msg)
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $
|
||||
* $Id: nfs_subs.c,v 1.26 1995/12/17 21:12:30 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -112,6 +112,7 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -144,6 +145,7 @@ int nfsv3_procid[NFS_NPROCS] = {
|
||||
NFSPROC_NOOP
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* and the reverse mapping from generic to Version 2 procedure numbers
|
||||
*/
|
||||
@ -176,6 +178,7 @@ int nfsv2_procid[NFS_NPROCS] = {
|
||||
NFSV2PROC_NOOP,
|
||||
};
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Maps errno values to nfs error numbers.
|
||||
* Use NFSERR_IO as the catch all for ones not specifically defined in
|
||||
@ -533,6 +536,8 @@ static short *nfsrv_v3errmap[] = {
|
||||
nfsv3err_commit,
|
||||
};
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
|
||||
extern struct nfsrtt nfsrtt;
|
||||
extern time_t nqnfsstarttime;
|
||||
@ -1122,8 +1127,10 @@ nfs_init()
|
||||
nfs_iodwant[i] = (struct proc *)0;
|
||||
TAILQ_INIT(&nfs_bufq);
|
||||
nfs_nhinit(); /* Init the nfsnode table */
|
||||
#ifndef NFS_NOSERVER
|
||||
nfsrv_init(0); /* Init server data structures */
|
||||
nfsrv_initcache(); /* Init the server request cache */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize the nqnfs server stuff.
|
||||
@ -1140,22 +1147,28 @@ nfs_init()
|
||||
* Initialize reply list and start timer
|
||||
*/
|
||||
TAILQ_INIT(&nfs_reqq);
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_timer(0);
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
lease_check = nfs_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsconf[MOUNT_NFS]->vfc_refcount++; /* make us non-unloadable */
|
||||
#ifdef VFS_LKM
|
||||
sysent[SYS_nfssvc].sy_narg = 2;
|
||||
sysent[SYS_nfssvc].sy_call = nfssvc;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
sysent[SYS_getfh].sy_call = getfh;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
@ -1388,6 +1401,7 @@ nfs_getattrcache(vp, vaper)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Set up nameidata for a lookup() call and do it
|
||||
*/
|
||||
@ -1728,6 +1742,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* This function compares two net addresses by family and returns TRUE
|
||||
* if they are the same host.
|
||||
@ -1881,6 +1896,7 @@ nfs_clearcommit(mp)
|
||||
splx(s);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Map errnos to NFS error numbers. For Version 3 also filter out error
|
||||
* numbers not specified for the associated procedure.
|
||||
@ -1960,3 +1976,4 @@ nfsrv_vrele(struct vnode *vp) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: nfs_syscalls.c,v 1.11 1995/12/03 10:03:06 bde Exp $
|
||||
* $Id: nfs_syscalls.c,v 1.12 1995/12/17 21:12:33 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -87,25 +87,26 @@ extern struct nfsstats nfsstats;
|
||||
extern int nfsrvw_procrastinate;
|
||||
struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock;
|
||||
static int nuidhash_max = NFS_MAXUIDHASH;
|
||||
static int nfs_numnfsd = 0;
|
||||
int nfsd_waiting = 0;
|
||||
static int notstarted = 1;
|
||||
static int modify_flag = 0;
|
||||
static struct nfsdrt nfsdrt;
|
||||
|
||||
static void nfsrv_zapsock __P((struct nfssvc_sock *slp));
|
||||
static int nfssvc_iod __P((struct proc *));
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON];
|
||||
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
int nfsd_waiting = 0;
|
||||
static struct nfsdrt nfsdrt;
|
||||
static int nfs_numnfsd = 0;
|
||||
static int notstarted = 1;
|
||||
static int modify_flag = 0;
|
||||
static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd,
|
||||
int cacherep));
|
||||
static int nfssvc_addsock __P((struct file *,struct mbuf *));
|
||||
static int nfssvc_iod __P((struct proc *));
|
||||
static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *));
|
||||
|
||||
/*
|
||||
* NFS server system calls
|
||||
* getfh() lives here too, but maybe should move to kern/vfs_syscalls.c
|
||||
@ -152,6 +153,7 @@ getfh(p, uap, retval)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#endif /* NFS_NOSERVER */
|
||||
/*
|
||||
* Nfs server psuedo system call for the nfsd's
|
||||
* Based on the flag value it either:
|
||||
@ -171,6 +173,7 @@ nfssvc(p, uap, retval)
|
||||
register struct nfssvc_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
#ifndef NFS_NOSERVER
|
||||
struct nameidata nd;
|
||||
struct file *fp;
|
||||
struct mbuf *nam;
|
||||
@ -181,6 +184,7 @@ nfssvc(p, uap, retval)
|
||||
struct nfssvc_sock *slp;
|
||||
struct nfsuid *nuidp;
|
||||
struct nfsmount *nmp;
|
||||
#endif /* NFS_NOSERVER */
|
||||
int error;
|
||||
|
||||
/*
|
||||
@ -195,6 +199,10 @@ nfssvc(p, uap, retval)
|
||||
}
|
||||
if (uap->flag & NFSSVC_BIOD)
|
||||
error = nfssvc_iod(p);
|
||||
#ifdef NFS_NOSERVER
|
||||
else
|
||||
error = ENXIO;
|
||||
#else /* !NFS_NOSERVER */
|
||||
else if (uap->flag & NFSSVC_MNTD) {
|
||||
error = copyin(uap->argp, (caddr_t)&ncd, sizeof (ncd));
|
||||
if (error)
|
||||
@ -327,11 +335,13 @@ nfssvc(p, uap, retval)
|
||||
nfsd->nfsd_flag |= NFSD_AUTHFAIL;
|
||||
error = nfssvc_nfsd(nsd, uap->argp, p);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
if (error == EINTR || error == ERESTART)
|
||||
error = 0;
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Adds a socket to the list for servicing by nfsds.
|
||||
*/
|
||||
@ -702,6 +712,7 @@ nfssvc_nfsd(nsd, argp, p)
|
||||
nfsrv_init(TRUE); /* Reinitialize everything */
|
||||
return (error);
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
||||
/*
|
||||
* Asynchronous I/O daemons for client nfs.
|
||||
@ -1038,6 +1049,7 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
/*
|
||||
* Derefence a server socket structure. If it has no more references and
|
||||
* is no longer valid, you can throw it away.
|
||||
@ -1134,3 +1146,4 @@ nfsd_rt(sotype, nd, cacherep)
|
||||
rt->tstamp = time;
|
||||
nfsdrt.pos = (nfsdrt.pos + 1) % NFSRTTLOGSIZ;
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
|
@ -153,7 +153,7 @@ HIDE_BSD(nosys)
|
||||
HIDE_BSD(getdirentries)
|
||||
HIDE_BSD(statfs)
|
||||
HIDE_BSD(fstatfs)
|
||||
#ifdef NFS
|
||||
#if defined(NFS) && !defined (NFS_NOSERVER)
|
||||
HIDE_BSD(getfh)
|
||||
#else
|
||||
HIDE_BSD(nosys)
|
||||
|
@ -494,7 +494,7 @@ struct fstatfs_args {
|
||||
int fd;
|
||||
struct statfs * buf;
|
||||
};
|
||||
#ifdef NFS
|
||||
#if defined(NFS) && !defined (NFS_NOSERVER)
|
||||
struct getfh_args {
|
||||
char * fname;
|
||||
fhandle_t * fhp;
|
||||
@ -824,7 +824,7 @@ int nfssvc __P((struct proc *, struct nfssvc_args *, int []));
|
||||
#endif
|
||||
int statfs __P((struct proc *, struct statfs_args *, int []));
|
||||
int fstatfs __P((struct proc *, struct fstatfs_args *, int []));
|
||||
#ifdef NFS
|
||||
#if defined(NFS) && !defined (NFS_NOSERVER)
|
||||
int getfh __P((struct proc *, struct getfh_args *, int []));
|
||||
#else
|
||||
#endif
|
||||
@ -995,7 +995,7 @@ struct ogetdirentries_args {
|
||||
u_int count;
|
||||
long * basep;
|
||||
};
|
||||
#ifdef NFS
|
||||
#if defined(NFS) && !defined (NFS_NOSERVER)
|
||||
#else
|
||||
#endif
|
||||
#ifdef LFS
|
||||
|
Loading…
Reference in New Issue
Block a user