Skip to content

Commit

Permalink
io_uring: convert xattr to use io_cmd_type
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jul 25, 2022
1 parent ea5af87 commit ceb452e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions io_uring/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ struct io_kiocb {
*/
struct file *file;
struct io_cmd_data cmd;
struct io_xattr xattr;
struct io_uring_cmd uring_cmd;
};

Expand Down Expand Up @@ -4402,7 +4401,7 @@ static int io_renameat(struct io_kiocb *req, unsigned int issue_flags)

static inline void __io_xattr_finish(struct io_kiocb *req)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);

if (ix->filename)
putname(ix->filename);
Expand All @@ -4422,7 +4421,7 @@ static void io_xattr_finish(struct io_kiocb *req, int ret)
static int __io_getxattr_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
const char __user *name;
int ret;

Expand Down Expand Up @@ -4465,7 +4464,7 @@ static int io_fgetxattr_prep(struct io_kiocb *req,
static int io_getxattr_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
const char __user *path;
int ret;

Expand All @@ -4486,7 +4485,7 @@ static int io_getxattr_prep(struct io_kiocb *req,

static int io_fgetxattr(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
int ret;

if (issue_flags & IO_URING_F_NONBLOCK)
Expand All @@ -4502,7 +4501,7 @@ static int io_fgetxattr(struct io_kiocb *req, unsigned int issue_flags)

static int io_getxattr(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
unsigned int lookup_flags = LOOKUP_FOLLOW;
struct path path;
int ret;
Expand Down Expand Up @@ -4531,7 +4530,7 @@ static int io_getxattr(struct io_kiocb *req, unsigned int issue_flags)
static int __io_setxattr_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
const char __user *name;
int ret;

Expand Down Expand Up @@ -4562,7 +4561,7 @@ static int __io_setxattr_prep(struct io_kiocb *req,
static int io_setxattr_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
const char __user *path;
int ret;

Expand Down Expand Up @@ -4590,7 +4589,7 @@ static int io_fsetxattr_prep(struct io_kiocb *req,
static int __io_setxattr(struct io_kiocb *req, unsigned int issue_flags,
struct path *path)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
int ret;

ret = mnt_want_write(path->mnt);
Expand All @@ -4617,7 +4616,7 @@ static int io_fsetxattr(struct io_kiocb *req, unsigned int issue_flags)

static int io_setxattr(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_xattr *ix = &req->xattr;
struct io_xattr *ix = io_kiocb_to_cmd(req);
unsigned int lookup_flags = LOOKUP_FOLLOW;
struct path path;
int ret;
Expand Down

0 comments on commit ceb452e

Please sign in to comment.