OSDN Git Service

RDMA/restrack: Un-inline set task implementation
authorLeon Romanovsky <leonro@mellanox.com>
Tue, 2 Oct 2018 08:48:01 +0000 (11:48 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 5 Oct 2018 22:07:39 +0000 (16:07 -0600)
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>
drivers/infiniband/core/restrack.c
include/rdma/restrack.h

index bcc693f..b02d439 100644 (file)
@@ -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);
index 9654d33..0bddbbd 100644 (file)
@@ -175,14 +175,8 @@ int rdma_restrack_put(struct rdma_restrack_entry *res);
  * @res:  resource entry
  * @task: task struct
  */
-static inline 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;
-}
+void rdma_restrack_set_task(struct rdma_restrack_entry *res,
+                           struct task_struct *task);
 
 /*
  * Helper functions for rdma drivers when filling out