aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2018-10-02 11:48:01 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-10-05 16:07:39 -0600
commit363ad35577de3a73cf97006ec5f00fccaee73172 (patch)
tree28ef71c18435b9d1184c2ef8e08089de3285faba /drivers/infiniband
parentRDMA/core: Check error status of rdma_find_ndev_for_src_ip_rcu (diff)
downloadlinux-dev-363ad35577de3a73cf97006ec5f00fccaee73172.tar.xz
linux-dev-363ad35577de3a73cf97006ec5f00fccaee73172.zip
RDMA/restrack: Un-inline set task implementation
Prepare rdma_restrack_set_task() call to accommodate more code by moving its implementation from *.h to *.c. Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com> Reviewed-by: Yossi Itigin <yosefe@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/restrack.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index bcc693fffd4c..b02d43988e16 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -155,6 +155,16 @@ static bool res_is_user(struct rdma_restrack_entry *res)
}
}
+void rdma_restrack_set_task(struct rdma_restrack_entry *res,
+ struct task_struct *task)
+{
+ if (res->task)
+ put_task_struct(res->task);
+ get_task_struct(task);
+ res->task = task;
+}
+EXPORT_SYMBOL(rdma_restrack_set_task);
+
void rdma_restrack_add(struct rdma_restrack_entry *res)
{
struct ib_device *dev = res_to_dev(res);