Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9a3a11f9
Commit
9a3a11f9
authored
May 24, 2022
by
Jens Axboe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
io_uring: convert iouring_cmd to io_cmd_type
Signed-off-by:
Jens Axboe
<
axboe@kernel.dk
>
parent
ceb452e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
io_uring/io_uring.c
io_uring/io_uring.c
+10
-8
No files found.
io_uring/io_uring.c
View file @
9a3a11f9
...
...
@@ -979,7 +979,6 @@ struct io_kiocb {
*/
struct
file
*
file
;
struct
io_cmd_data
cmd
;
struct
io_uring_cmd
uring_cmd
;
};
u8
opcode
;
...
...
@@ -4814,15 +4813,17 @@ static int io_linkat(struct io_kiocb *req, unsigned int issue_flags)
static
void
io_uring_cmd_work
(
struct
io_kiocb
*
req
,
bool
*
locked
)
{
req
->
uring_cmd
.
task_work_cb
(
&
req
->
uring_cmd
);
struct
io_uring_cmd
*
ioucmd
=
io_kiocb_to_cmd
(
req
);
ioucmd
->
task_work_cb
(
ioucmd
);
}
void
io_uring_cmd_complete_in_task
(
struct
io_uring_cmd
*
ioucmd
,
void
(
*
task_work_cb
)(
struct
io_uring_cmd
*
))
{
struct
io_kiocb
*
req
=
c
ontainer_of
(
ioucmd
,
struct
io_kiocb
,
uring_
cmd
);
struct
io_kiocb
*
req
=
c
md_to_io_kiocb
(
iou
cmd
);
req
->
uring_cmd
.
task_work_cb
=
task_work_cb
;
ioucmd
->
task_work_cb
=
task_work_cb
;
req
->
io_task_work
.
func
=
io_uring_cmd_work
;
io_req_task_work_add
(
req
);
}
...
...
@@ -4842,7 +4843,7 @@ static inline void io_req_set_cqe32_extra(struct io_kiocb *req,
*/
void
io_uring_cmd_done
(
struct
io_uring_cmd
*
ioucmd
,
ssize_t
ret
,
ssize_t
res2
)
{
struct
io_kiocb
*
req
=
c
ontainer_of
(
ioucmd
,
struct
io_kiocb
,
uring_
cmd
);
struct
io_kiocb
*
req
=
c
md_to_io_kiocb
(
iou
cmd
);
if
(
ret
<
0
)
req_set_fail
(
req
);
...
...
@@ -4855,18 +4856,19 @@ EXPORT_SYMBOL_GPL(io_uring_cmd_done);
static
int
io_uring_cmd_prep_async
(
struct
io_kiocb
*
req
)
{
struct
io_uring_cmd
*
ioucmd
=
io_kiocb_to_cmd
(
req
);
size_t
cmd_size
;
cmd_size
=
uring_cmd_pdu_size
(
req
->
ctx
->
flags
&
IORING_SETUP_SQE128
);
memcpy
(
req
->
async_data
,
req
->
uring_cmd
.
cmd
,
cmd_size
);
memcpy
(
req
->
async_data
,
ioucmd
->
cmd
,
cmd_size
);
return
0
;
}
static
int
io_uring_cmd_prep
(
struct
io_kiocb
*
req
,
const
struct
io_uring_sqe
*
sqe
)
{
struct
io_uring_cmd
*
ioucmd
=
&
req
->
uring_cmd
;
struct
io_uring_cmd
*
ioucmd
=
io_kiocb_to_cmd
(
req
)
;
if
(
sqe
->
rw_flags
||
sqe
->
__pad1
)
return
-
EINVAL
;
...
...
@@ -4877,7 +4879,7 @@ static int io_uring_cmd_prep(struct io_kiocb *req,
static
int
io_uring_cmd
(
struct
io_kiocb
*
req
,
unsigned
int
issue_flags
)
{
struct
io_uring_cmd
*
ioucmd
=
&
req
->
uring_cmd
;
struct
io_uring_cmd
*
ioucmd
=
io_kiocb_to_cmd
(
req
)
;
struct
io_ring_ctx
*
ctx
=
req
->
ctx
;
struct
file
*
file
=
req
->
file
;
int
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment