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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

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@xxxxxxxxxxxx>
---
 libibverbs/verbs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

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;
-- 
2.19.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux