Lines 94-99
static struct clnt_ops clnt_dg_ops = {
Link Here
|
94 |
.cl_control = clnt_dg_control |
94 |
.cl_control = clnt_dg_control |
95 |
}; |
95 |
}; |
96 |
|
96 |
|
|
|
97 |
static volatile uint32_t rpc_xid = 0; |
98 |
|
97 |
/* |
99 |
/* |
98 |
* A pending RPC request which awaits a reply. Requests which have |
100 |
* A pending RPC request which awaits a reply. Requests which have |
99 |
* received their reply will have cr_xid set to zero and cr_mrep to |
101 |
* received their reply will have cr_xid set to zero and cr_mrep to |
Lines 193-198
clnt_dg_create(
Link Here
|
193 |
struct __rpc_sockinfo si; |
195 |
struct __rpc_sockinfo si; |
194 |
XDR xdrs; |
196 |
XDR xdrs; |
195 |
int error; |
197 |
int error; |
|
|
198 |
uint32_t newxid; |
196 |
|
199 |
|
197 |
if (svcaddr == NULL) { |
200 |
if (svcaddr == NULL) { |
198 |
rpc_createerr.cf_stat = RPC_UNKNOWNADDR; |
201 |
rpc_createerr.cf_stat = RPC_UNKNOWNADDR; |
Lines 245-252
clnt_dg_create(
Link Here
|
245 |
cu->cu_sent = 0; |
248 |
cu->cu_sent = 0; |
246 |
cu->cu_cwnd_wait = FALSE; |
249 |
cu->cu_cwnd_wait = FALSE; |
247 |
(void) getmicrotime(&now); |
250 |
(void) getmicrotime(&now); |
248 |
cu->cu_xid = __RPC_GETXID(&now); |
251 |
newxid = __RPC_GETXID(&now); |
249 |
call_msg.rm_xid = cu->cu_xid; |
252 |
atomic_cmpset_32(&rpc_xid, 0, newxid); |
|
|
253 |
call_msg.rm_xid = atomic_fetchadd_32(&rpc_xid, 1); |
250 |
call_msg.rm_call.cb_prog = program; |
254 |
call_msg.rm_call.cb_prog = program; |
251 |
call_msg.rm_call.cb_vers = version; |
255 |
call_msg.rm_call.cb_vers = version; |
252 |
xdrmem_create(&xdrs, cu->cu_mcallc, MCALL_MSG_SIZE, XDR_ENCODE); |
256 |
xdrmem_create(&xdrs, cu->cu_mcallc, MCALL_MSG_SIZE, XDR_ENCODE); |
Lines 418-425
clnt_dg_call(
Link Here
|
418 |
call_again: |
422 |
call_again: |
419 |
mtx_assert(&cs->cs_lock, MA_OWNED); |
423 |
mtx_assert(&cs->cs_lock, MA_OWNED); |
420 |
|
424 |
|
421 |
cu->cu_xid++; |
425 |
xid = atomic_fetchadd_32(&rpc_xid, 1); |
422 |
xid = cu->cu_xid; |
|
|
423 |
|
426 |
|
424 |
send_again: |
427 |
send_again: |
425 |
mtx_unlock(&cs->cs_lock); |
428 |
mtx_unlock(&cs->cs_lock); |
Lines 865-878
clnt_dg_control(CLIENT *cl, u_int request, void *info)
Link Here
|
865 |
(void) memcpy(&cu->cu_raddr, addr, addr->sa_len); |
868 |
(void) memcpy(&cu->cu_raddr, addr, addr->sa_len); |
866 |
break; |
869 |
break; |
867 |
case CLGET_XID: |
870 |
case CLGET_XID: |
868 |
*(uint32_t *)info = cu->cu_xid; |
871 |
*(uint32_t *)info = rpc_xid; |
869 |
break; |
872 |
break; |
870 |
|
873 |
|
|
|
874 |
#ifdef notnow |
871 |
case CLSET_XID: |
875 |
case CLSET_XID: |
872 |
/* This will set the xid of the NEXT call */ |
876 |
/* This will set the xid of the NEXT call */ |
873 |
/* decrement by 1 as clnt_dg_call() increments once */ |
877 |
/* decrement by 1 as clnt_dg_call() increments once */ |
874 |
cu->cu_xid = *(uint32_t *)info - 1; |
878 |
cu->cu_xid = *(uint32_t *)info - 1; |
875 |
break; |
879 |
break; |
|
|
880 |
#endif |
876 |
|
881 |
|
877 |
case CLGET_VERS: |
882 |
case CLGET_VERS: |
878 |
/* |
883 |
/* |