Skip to content

Commit 055c156

Browse files
isilenceaxboe
authored andcommitted
io_uring/cmd: inline io_uring_cmd_get_task
With io_uring_types.h we see all required definitions to inline io_uring_cmd_get_task(). Signed-off-by: Pavel Begunkov <[email protected]> Reviewed-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/aa8e317f09e651a5f3e72f8c0ad3902084c1f930.1701391955.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 6b04a37 commit 055c156

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

include/linux/io_uring/cmd.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,
3939

4040
void io_uring_cmd_mark_cancelable(struct io_uring_cmd *cmd,
4141
unsigned int issue_flags);
42-
struct task_struct *io_uring_cmd_get_task(struct io_uring_cmd *cmd);
4342

4443
#else
4544
static inline int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
@@ -60,10 +59,6 @@ static inline void io_uring_cmd_mark_cancelable(struct io_uring_cmd *cmd,
6059
unsigned int issue_flags)
6160
{
6261
}
63-
static inline struct task_struct *io_uring_cmd_get_task(struct io_uring_cmd *cmd)
64-
{
65-
return NULL;
66-
}
6762
#endif
6863

6964
/* users must follow the IOU_F_TWQ_LAZY_WAKE semantics */
@@ -79,4 +74,9 @@ static inline void io_uring_cmd_complete_in_task(struct io_uring_cmd *ioucmd,
7974
__io_uring_cmd_do_in_task(ioucmd, task_work_cb, 0);
8075
}
8176

77+
static inline struct task_struct *io_uring_cmd_get_task(struct io_uring_cmd *cmd)
78+
{
79+
return cmd_to_io_kiocb(cmd)->task;
80+
}
81+
8282
#endif /* _LINUX_IO_URING_CMD_H */

io_uring/uring_cmd.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ void io_uring_cmd_mark_cancelable(struct io_uring_cmd *cmd,
5252
}
5353
EXPORT_SYMBOL_GPL(io_uring_cmd_mark_cancelable);
5454

55-
struct task_struct *io_uring_cmd_get_task(struct io_uring_cmd *cmd)
56-
{
57-
return cmd_to_io_kiocb(cmd)->task;
58-
}
59-
EXPORT_SYMBOL_GPL(io_uring_cmd_get_task);
60-
6155
static void io_uring_cmd_work(struct io_kiocb *req, struct io_tw_state *ts)
6256
{
6357
struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);

0 commit comments

Comments
 (0)