]> git.hungrycats.org Git - linux/commitdiff
btrfs: drop unused uring encoded IO REISSUE stash helpers
authorYang Xiuwei <yangxiuwei@kylinos.cn>
Wed, 19 Aug 2026 02:54:36 +0000 (10:54 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 17 Sep 2026 17:48:19 +0000 (19:48 +0200)
After not keeping state across -EAGAIN, restoring bc->data on REISSUE is
dead.  Remove it, stop using the cmd PDU on the write path, and fold the
read -EAGAIN check into the existing error path.

Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c

index 25d9feaa90030f10214ae0c216291c38716ef254..52aab510aea0d158f0e8a898f69e8d51ef5b43fe 100644 (file)
@@ -4749,9 +4749,6 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue
        struct io_btrfs_cmd *bc = io_uring_cmd_to_pdu(cmd, struct io_btrfs_cmd);
        struct btrfs_uring_encoded_data *data = NULL;
 
-       if (cmd->flags & IORING_URING_CMD_REISSUE)
-               data = bc->data;
-
        if (!capable(CAP_SYS_ADMIN)) {
                ret = -EPERM;
                goto out_acct;
@@ -4833,8 +4830,6 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue
 
        ret = btrfs_encoded_read(&kiocb, &data->iter, &data->args, &cached_state,
                                 &disk_bytenr, &disk_io_size);
-       if (ret == -EAGAIN)
-               goto out_free;
        if (ret < 0 && ret != -EIOCBQUEUED)
                goto out_free;
 
@@ -4891,12 +4886,8 @@ static int btrfs_uring_encoded_write(struct io_uring_cmd *cmd, unsigned int issu
        struct kiocb kiocb;
        ssize_t ret;
        void __user *sqe_addr;
-       struct io_btrfs_cmd *bc = io_uring_cmd_to_pdu(cmd, struct io_btrfs_cmd);
        struct btrfs_uring_encoded_data *data = NULL;
 
-       if (cmd->flags & IORING_URING_CMD_REISSUE)
-               data = bc->data;
-
        if (!capable(CAP_SYS_ADMIN)) {
                ret = -EPERM;
                goto out_acct;
@@ -4920,8 +4911,6 @@ static int btrfs_uring_encoded_write(struct io_uring_cmd *cmd, unsigned int issu
                        goto out_acct;
                }
 
-               bc->data = data;
-
                if (issue_flags & IO_URING_F_COMPAT) {
 #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT)
                        struct btrfs_ioctl_encoded_io_args_32 args32;
@@ -5007,7 +4996,6 @@ out_acct:
        inc_syscw(current);
 
        kfree(data);
-       bc->data = NULL;
        return ret;
 }