Write PDUs straight to the wire when the queue is empty
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>master
parent
630a80c056
commit
1716b14104
|
@ -581,6 +581,8 @@ int nfs4_write_async(struct nfs_context *nfs, struct nfsfh *nfsfh,
|
|||
uint64_t count, const void *buf, nfs_cb cb,
|
||||
void *private_data);
|
||||
|
||||
int rpc_write_to_socket(struct rpc_context *rpc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
11
lib/pdu.c
11
lib/pdu.c
|
@ -296,11 +296,16 @@ int rpc_queue_pdu(struct rpc_context *rpc, struct rpc_pdu *pdu)
|
|||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_lock(&rpc->rpc_mutex);
|
||||
#endif /* HAVE_MULTITHREADING */
|
||||
rpc_enqueue(&rpc->outqueue, pdu);
|
||||
rpc_enqueue(&rpc->outqueue, pdu);
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_unlock(&rpc->rpc_mutex);
|
||||
if (rpc->outqueue.head == pdu) {
|
||||
nfs_mt_mutex_unlock(&rpc->rpc_mutex);
|
||||
rpc_write_to_socket(rpc);
|
||||
} else {
|
||||
nfs_mt_mutex_unlock(&rpc->rpc_mutex);
|
||||
}
|
||||
#endif /* HAVE_MULTITHREADING */
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ rpc_which_events(struct rpc_context *rpc)
|
|||
return events;
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
rpc_write_to_socket(struct rpc_context *rpc)
|
||||
{
|
||||
int32_t count;
|
||||
|
|
Loading…
Reference in New Issue