public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] io_uring/btrfs: remove struct io_uring_cmd_data
@ 2025-06-19 19:27 Caleb Sander Mateos
  2025-06-19 19:27 ` [PATCH 1/4] btrfs/ioctl: don't skip accounting in early ENOTTY return Caleb Sander Mateos
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Caleb Sander Mateos @ 2025-06-19 19:27 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba, Jens Axboe
  Cc: Mark Harmstone, linux-btrfs, io-uring, linux-kernel,
	Caleb Sander Mateos

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         | 14 +++---------
 io_uring/uring_cmd.h         |  1 -
 4 files changed, 34 insertions(+), 33 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-07-08 18:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 19:27 [PATCH 0/4] io_uring/btrfs: remove struct io_uring_cmd_data Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 1/4] btrfs/ioctl: don't skip accounting in early ENOTTY return Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 2/4] io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag Caleb Sander Mateos
2025-07-01 19:03   ` Jens Axboe
2025-07-02  6:27     ` Daniel Vacek
2025-07-02  6:44       ` Ammar Faizi
2025-07-02  7:00         ` Alan Huang
2025-07-02 13:47         ` Jens Axboe
2025-06-19 19:27 ` [PATCH 3/4] btrfs/ioctl: store btrfs_uring_encoded_data in io_btrfs_cmd Caleb Sander Mateos
2025-07-01 19:05   ` Jens Axboe
2025-07-02 19:51     ` Caleb Sander Mateos
2025-07-08 18:17       ` Jens Axboe
2025-07-08 18:32         ` Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 4/4] io_uring/cmd: remove struct io_uring_cmd_data Caleb Sander Mateos
2025-06-20 15:47 ` [PATCH 0/4] io_uring/btrfs: " David Sterba
2025-07-01 15:01   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox