summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server
diff options
context:
space:
mode:
authorZhou Zhengping <johnzzpcrystal@gmail.com>2017-03-31 00:42:46 +0800
committerJeff Darcy <jeff@pl.atyp.us>2017-05-05 15:04:17 +0000
commitfe83a4ae84dd4345d6e958219d5a1dc59ecb039d (patch)
treeee99ad6503e434e11fb9c85d0da38c7a26c9dc1b /xlators/protocol/server
parentfa10c8a3528b95dc575bfedd30bcd68cc2dff25b (diff)
coreutils: use coreutils instead of duplicate code
Change-Id: I0e442331d2bbb22ec18c37af87ab2a8852737c43 BUG: 1448265 Signed-off-by: Zhou Zhengping <johnzzpcrystal@gmail.com> Reviewed-on: https://review.gluster.org/16975 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r--xlators/protocol/server/src/server-rpc-fops.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
index 0ba4ffa6f94..3b7f4e61f11 100644
--- a/xlators/protocol/server/src/server-rpc-fops.c
+++ b/xlators/protocol/server/src/server-rpc-fops.c
@@ -4218,10 +4218,7 @@ server3_3_writev (rpcsvc_request_t *req)
= req->msg[i];
}
- len = 0;
- for (i = 0; i < state->payload_count; i++) {
- len += state->payload_vector[i].iov_len;
- }
+ len = iov_length (state->payload_vector, state->payload_count);
GF_ASSERT (state->size == len);
@@ -6817,9 +6814,7 @@ server3_3_compound (rpcsvc_request_t *req)
= req->msg[i];
}
- for (i = 0; i < state->payload_count; i++) {
- state->size += state->payload_vector[i].iov_len;
- }
+ state->size = iov_length (state->payload_vector, state->payload_count);
ret = server_get_compound_resolve (state, &args);