Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/nfs/nfs_commonkrpc.c
Show First 20 Lines • Show All 487 Lines • ▼ Show 20 Lines | |||||
newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, | newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, | ||||
struct nfsclient *clp, struct nfssockreq *nrp, vnode_t vp, | struct nfsclient *clp, struct nfssockreq *nrp, vnode_t vp, | ||||
struct thread *td, struct ucred *cred, u_int32_t prog, u_int32_t vers, | struct thread *td, struct ucred *cred, u_int32_t prog, u_int32_t vers, | ||||
u_char *retsum, int toplevel, u_int64_t *xidp, struct nfsclsession *dssep) | u_char *retsum, int toplevel, u_int64_t *xidp, struct nfsclsession *dssep) | ||||
{ | { | ||||
uint32_t retseq, retval, slotseq, *tl; | uint32_t retseq, retval, slotseq, *tl; | ||||
time_t waituntil; | time_t waituntil; | ||||
int i = 0, j = 0, opcnt, set_sigset = 0, slot; | int i = 0, j = 0, opcnt, set_sigset = 0, slot; | ||||
int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS; | int error = 0, usegssname = 0, secflavour = AUTH_SYS; | ||||
int freeslot, maxslot, reterr, slotpos, timeo; | int freeslot, maxslot, reterr, slotpos, timeo; | ||||
u_int16_t procnum; | u_int16_t procnum; | ||||
u_int trylater_delay = 1; | u_int trylater_delay = 1; | ||||
struct nfs_feedback_arg nf; | struct nfs_feedback_arg nf; | ||||
struct timeval timo; | struct timeval timo; | ||||
AUTH *auth; | AUTH *auth; | ||||
struct rpc_callextra ext; | struct rpc_callextra ext; | ||||
enum clnt_stat stat; | enum clnt_stat stat; | ||||
▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | if (dtrace_nfscl_nfs234_start_probe != NULL) { | ||||
} | } | ||||
if (probe_id != 0) | if (probe_id != 0) | ||||
(dtrace_nfscl_nfs234_start_probe) | (dtrace_nfscl_nfs234_start_probe) | ||||
(probe_id, vp, nd->nd_mreq, cred, | (probe_id, vp, nd->nd_mreq, cred, | ||||
probe_procnum); | probe_procnum); | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
trycnt = 0; | |||||
freeslot = -1; /* Set to slot that needs to be free'd */ | freeslot = -1; /* Set to slot that needs to be free'd */ | ||||
tryagain: | tryagain: | ||||
slot = -1; /* Slot that needs a sequence# increment. */ | slot = -1; /* Slot that needs a sequence# increment. */ | ||||
/* | /* | ||||
* This timeout specifies when a new socket should be created, | * This timeout specifies when a new socket should be created, | ||||
* along with new xid values. For UDP, this should be done | * along with new xid values. For UDP, this should be done | ||||
* infrequently, since retransmits of RPC requests should normally | * infrequently, since retransmits of RPC requests should normally | ||||
* use the same xid. | * use the same xid. | ||||
▲ Show 20 Lines • Show All 510 Lines • ▼ Show 20 Lines | |||||
* NFS wrapper to msleep(), that shoves a new p_sigmask and restores the | * NFS wrapper to msleep(), that shoves a new p_sigmask and restores the | ||||
* old one after msleep() returns. | * old one after msleep() returns. | ||||
*/ | */ | ||||
int | int | ||||
newnfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *wmesg, int timo) | newnfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *wmesg, int timo) | ||||
{ | { | ||||
sigset_t oldset; | sigset_t oldset; | ||||
int error; | int error; | ||||
struct proc *p; | |||||
if ((priority & PCATCH) == 0) | if ((priority & PCATCH) == 0) | ||||
return msleep(ident, mtx, priority, wmesg, timo); | return msleep(ident, mtx, priority, wmesg, timo); | ||||
if (td == NULL) | if (td == NULL) | ||||
td = curthread; /* XXX */ | td = curthread; /* XXX */ | ||||
newnfs_set_sigmask(td, &oldset); | newnfs_set_sigmask(td, &oldset); | ||||
error = msleep(ident, mtx, priority, wmesg, timo); | error = msleep(ident, mtx, priority, wmesg, timo); | ||||
newnfs_restore_sigmask(td, &oldset); | newnfs_restore_sigmask(td, &oldset); | ||||
p = td->td_proc; | |||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Test for a termination condition pending on the process. | * Test for a termination condition pending on the process. | ||||
* This is used for NFSMNT_INT mounts. | * This is used for NFSMNT_INT mounts. | ||||
*/ | */ | ||||
int | int | ||||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |