diff options
author | Anand Avati <avati@redhat.com> | 2012-09-05 17:20:05 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-12-04 14:46:04 -0800 |
commit | 98879ebdddd4ca77440defad6a73acf4fa1e75ab (patch) | |
tree | 041cfce881b40d22758a423542e380578dd8112f /rpc/rpc-transport/socket/src/socket.h | |
parent | 741766c708f2a246854584c064d63d3fba67be90 (diff) |
rpc-transport/socket: implement read-ahead of RPC headers
This reduces the number of read() system calls on the socket to
complete the full RPC fragment reading.
Change-Id: I421a53af195ead4aad70e09e0172a61ad7912d83
BUG: 821087
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/3855
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/socket/src/socket.h')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h index 2c4b44cf466..78faad9038d 100644 --- a/rpc/rpc-transport/socket/src/socket.h +++ b/rpc/rpc-transport/socket/src/socket.h @@ -158,6 +158,8 @@ struct gf_sock_incoming_frag { sp_rpcfrag_state_t state; }; +#define GF_SOCKET_RA_MAX 1024 + struct gf_sock_incoming { sp_rpcrecord_state_t record_state; struct gf_sock_incoming_frag frag; @@ -175,6 +177,11 @@ struct gf_sock_incoming { char complete_record; msg_type_t msg_type; size_t total_bytes_read; + + size_t ra_read; + size_t ra_max; + size_t ra_served; + char *ra_buf; }; typedef struct { |