diff mbox series

[rdma-core,03/10] verbs: Move ibv_create_comp_channel to use execute_write

Message ID 20181122232416.30132-4-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show
Series Command execution rework | expand

Commit Message

Jason Gunthorpe Nov. 22, 2018, 11:24 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

This was missed in commit 2eeecc77cdbc ("verbs: Convert write path callers
to use DECLARE_LEGACY_CORE_BUFS") as it was not in cmd.c.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 libibverbs/verbs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c
index 37a458a2e6ccc7..9121e2d342560c 100644
--- a/libibverbs/verbs.c
+++ b/libibverbs/verbs.c
@@ -46,6 +46,7 @@ 
 
 #include <util/compiler.h>
 #include <util/symver.h>
+#include <infiniband/cmd_write.h>
 
 #include "ibverbs.h"
 #ifndef NRESOLVE_NEIGH
@@ -341,22 +342,18 @@  LATEST_SYMVER_FUNC(ibv_dereg_mr, 1_1, "IBVERBS_1.1",
 
 struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context)
 {
+	DECLARE_LEGACY_CORE_BUFS(IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL);
 	struct ibv_comp_channel            *channel;
-	struct ibv_create_comp_channel      cmd;
-	struct ib_uverbs_create_comp_channel_resp resp;
 
 	channel = malloc(sizeof *channel);
 	if (!channel)
 		return NULL;
 
-	IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_COMP_CHANNEL, &resp, sizeof resp);
-	if (write(context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) {
+	if (execute_write(context, req, &resp)) {
 		free(channel);
 		return NULL;
 	}
 
-	(void) VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp);
-
 	channel->context = context;
 	channel->fd      = resp.fd;
 	channel->refcnt  = 0;