Skip to content

io_uring/btrfs: remove struct io_uring_cmd_data

Caleb Sander Mateos io-uring linux-btrfs lkml 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 5 repliesApplied
  2. v14 patches 11 repliesApplied

Changes in v2 from the cover letter

- Don't branch twice on -EAGAIN in io_uring_cmd() (Jens)
- Rebase on for-6.17/io_uring

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4btrfs/ioctl: don't skip accounting in early ENOTTY returnfs/btrfs/ioctl.c+2 -10 replies
2/4io_uring/cmd: introduce IORING_URING_CMD_REISSUE flaginclude/linux/io_uring/cmd.h io_uring/uring_cmd.c+7 -10 replies
3/4btrfs/ioctl: store btrfs_uring_encoded_data in io_btrfs_cmdfs/btrfs/ioctl.c+27 -110 replies
4/4io_uring/cmd: remove struct io_uring_cmd_datainclude/linux/io_uring/cmd.h io_uring/uring_cmd.c io_uring/uring_cmd.h+1 -210 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Sterba
SeriesA-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] io_uring/btrfs: remove struct io_uring_cmd_data

btrfs's ->uring_cmd() implementations are the only ones using io_uring_cmd_data to store data that lasts for the lifetime of the uring_cmd. But all uring_cmds have to pay the memory and CPU cost of initializing this field and freeing the pointer if necessary when the uring_cmd ends. There is already a pdu field in struct io_uring_cmd that ->uring_cmd() implementations can use for storage. The only benefit of op_data seems to be that io_uring initializes it, so ->uring_cmd() can read it to tell if there was a previous call to ->uring_cmd().

Introduce a flag IORING_URING_CMD_REISSUE that ->uring_cmd() implementations can use to tell if this is the first call to ->uring_cmd() or a reissue of the uring_cmd. Switch btrfs to use the pdu storage for its btrfs_uring_encoded_data. If IORING_URING_CMD_REISSUE is unset, allocate a new btrfs_uring_encoded_data. If it's set, use the existing one in op_data. Free the btrfs_uring_encoded_data in the btrfs layer instead of relying on io_uring to free op_data. Finally, remove io_uring_cmd_data since it's now unused.

Caleb Sander Mateos (4):
btrfs/ioctl: don't skip accounting in early ENOTTY return io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag btrfs/ioctl: store btrfs_uring_encoded_data in io_btrfs_cmd io_uring/cmd: remove struct io_uring_cmd_data

 fs/btrfs/ioctl.c             | 41 +++++++++++++++++++++++++-----------
 include/linux/io_uring/cmd.h | 11 ++--------
 io_uring/uring_cmd.c         | 18 ++++++----------
 io_uring/uring_cmd.h         |  1 -
 4 files changed, 37 insertions(+), 34 deletions(-)

v2:
- Don't branch twice on -EAGAIN in io_uring_cmd() (Jens)
- Rebase on for-6.17/io_uring

Signature · 1 line
2.45.2