Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1502194
| From | Binoy Jayan <binoy.jayan@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 5/8] IB/isert: Replace semaphore sem with completion |
| Date | 2016-10-17 18:40 +0200 |
| Message-ID | <stj7c-5TV-45@gated-at.bofh.it> (permalink) |
| References | <stj7b-5TV-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The semaphore 'sem' in isert_device is used as completion, so convert
it to struct completion. Semaphores are going away in the future.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
---
drivers/infiniband/ulp/isert/ib_isert.c | 6 +++---
drivers/infiniband/ulp/isert/ib_isert.h | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 6dd43f6..de80f56 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -619,7 +619,7 @@
mutex_unlock(&isert_np->mutex);
isert_info("np %p: Allow accept_np to continue\n", isert_np);
- up(&isert_np->sem);
+ complete(&isert_np->comp);
}
static void
@@ -2311,7 +2311,7 @@ struct rdma_cm_id *
isert_err("Unable to allocate struct isert_np\n");
return -ENOMEM;
}
- sema_init(&isert_np->sem, 0);
+ init_completion(&isert_np->comp);
mutex_init(&isert_np->mutex);
INIT_LIST_HEAD(&isert_np->accepted);
INIT_LIST_HEAD(&isert_np->pending);
@@ -2427,7 +2427,7 @@ struct rdma_cm_id *
int ret;
accept_wait:
- ret = down_interruptible(&isert_np->sem);
+ ret = wait_for_completion_interruptible(&isert_np->comp);
if (ret)
return -ENODEV;
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
index c02ada5..a1277c0 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.h
+++ b/drivers/infiniband/ulp/isert/ib_isert.h
@@ -3,6 +3,7 @@
#include <linux/in6.h>
#include <rdma/ib_verbs.h>
#include <rdma/rdma_cm.h>
+#include <linux/completion.h>
#include <rdma/rw.h>
#include <scsi/iser.h>
@@ -190,7 +191,7 @@ struct isert_device {
struct isert_np {
struct iscsi_np *np;
- struct semaphore sem;
+ struct completion comp;
struct rdma_cm_id *cm_id;
struct mutex mutex;
struct list_head accepted;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/8] infiniband: Remove semaphores Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
[PATCH 1/8] IB/core: iwpm_nlmsg_request: Replace semaphore with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
[PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Arnd Bergmann <arnd@arndb.de> - 2016-10-17 22:40 +0200
Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-18 07:20 +0200
Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Arnd Bergmann <arnd@arndb.de> - 2016-10-19 17:20 +0200
[PATCH 4/8] IB/mthca: Replace semaphore poll_sem with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
[PATCH 3/8] IB/hns: Replace semaphore poll_sem with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
[PATCH 2/8] IB/core: Replace semaphore sm_sem with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
[PATCH 5/8] IB/isert: Replace semaphore sem with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-17 18:40 +0200
Re: [PATCH 0/8] infiniband: Remove semaphores Arnd Bergmann <arnd@arndb.de> - 2016-10-17 22:10 +0200
Re: [PATCH 0/8] infiniband: Remove semaphores Arnd Bergmann <arnd@arndb.de> - 2016-10-17 22:40 +0200
csiph-web