aboutsummaryrefslogtreecommitdiff
path: root/sys/rpc
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2014-11-12 09:57:15 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2014-11-12 09:57:15 +0000
commitcfa6009e3646cc9efc24f3b3fb2d15b4f6a6c2b5 (patch)
tree376a152fabadae344479bb291540f2dc2d1edf0d /sys/rpc
parentb10cc05cf5d5fc7a0827c50a1a58265752d3edc8 (diff)
downloadsrc-cfa6009e3646cc9efc24f3b3fb2d15b4f6a6c2b5.tar.gz
src-cfa6009e3646cc9efc24f3b3fb2d15b4f6a6c2b5.zip
In preparation of merging projects/sendfile, transform bare access to
sb_cc member of struct sockbuf to a couple of inline functions: sbavail() and sbused() Right now they are equal, but once notion of "not ready socket buffer data", will be checked in, they are going to be different. Sponsored by: Netflix Sponsored by: Nginx, Inc.
Notes
Notes: svn path=/head/; revision=274421
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/clnt_vc.c4
-rw-r--r--sys/rpc/svc_vc.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index 67ad58f5cd1b..3899511990a6 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -860,7 +860,7 @@ clnt_vc_soupcall(struct socket *so, void *arg, int waitflag)
* error condition
*/
do_read = FALSE;
- if (so->so_rcv.sb_cc >= sizeof(uint32_t)
+ if (sbavail(&so->so_rcv) >= sizeof(uint32_t)
|| (so->so_rcv.sb_state & SBS_CANTRCVMORE)
|| so->so_error)
do_read = TRUE;
@@ -913,7 +913,7 @@ clnt_vc_soupcall(struct socket *so, void *arg, int waitflag)
* buffered.
*/
do_read = FALSE;
- if (so->so_rcv.sb_cc >= ct->ct_record_resid
+ if (sbavail(&so->so_rcv) >= ct->ct_record_resid
|| (so->so_rcv.sb_state & SBS_CANTRCVMORE)
|| so->so_error)
do_read = TRUE;
diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c
index df1d86e045cd..0190a0ce3834 100644
--- a/sys/rpc/svc_vc.c
+++ b/sys/rpc/svc_vc.c
@@ -546,7 +546,7 @@ svc_vc_ack(SVCXPRT *xprt, uint32_t *ack)
{
*ack = atomic_load_acq_32(&xprt->xp_snt_cnt);
- *ack -= xprt->xp_socket->so_snd.sb_cc;
+ *ack -= sbused(&xprt->xp_socket->so_snd);
return (TRUE);
}