From nobody Tue Oct 7 14:46:49 2025 Received: from mail-io1-f99.google.com (mail-io1-f99.google.com [209.85.166.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D298F23D289 for ; Tue, 8 Jul 2025 20:22:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006144; cv=none; b=S9zh4PGWq00gqDl+VUOV3YxGG7laxKIZFAl415gj8ERUI0pzD9N003NSJcambRZ/evfJg97c4E1SpCYcr57S5Za4Q+/sQdBQsxF/+gkUhk1jsZ0IndDx6ojuv9jkz+aythO7ehl3rzdCHutsKcmTsbcZR2mS7bJ7Bdl/KICebkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006144; c=relaxed/simple; bh=K4VZVi3xDLWT0DEl3LNGUBjrD17+mi5NFECXhkIiWrY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RllNDZUS7L48Obsb5dRfx3qRviOswsXW/0gOd57U4IcWEAoy3UUTpXWvKWyabZraqr8IvKcnFhxiPXGBiet6nbJs58iwl48T/eEQwShPBjqTFLkKuS/6klOrBrUUcROWEBzZ4j2kMYXF0UERSeV3v5ZExbywcg8e0H717CkyS0Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=ej9tjHnw; arc=none smtp.client-ip=209.85.166.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="ej9tjHnw" Received: by mail-io1-f99.google.com with SMTP id ca18e2360f4ac-8749beec4faso22962239f.0 for ; Tue, 08 Jul 2025 13:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1752006142; x=1752610942; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pd50J9nYsG0TeiIeJPqTSZq8OKqwb6u/EH2G1EHnbLs=; b=ej9tjHnwPQOvu2AwCbPDthCD2tzHNrSkl0T+E2Onn88MUdrXwzHOOSjIyBg6fliKPF sf9ZqSzcP9h7gMmdiJldzni8+95nnAh6K/V2t+VRnJQWAj2UBybfQvPGd4AFMhPfUZAV kVOhkfMrO3sXnh9mmxgrzOmfmpMN1A7ODrCR3BwLLZ/N1HmFmQKfvE8g1Ci6baKUw9xt whe1OJ2tA8CUjBb5Zjkp5oogYjA8p8LljYlOqyFY9hizuvg4yLBdYcsDJLOG/PMbWNOt NWFWQr/8gdRnfQLjFX8a3XQGtACUfCSg6vPhjZEwvjy10fsUK91g96hqCmqC0jn96Ut2 1gcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752006142; x=1752610942; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pd50J9nYsG0TeiIeJPqTSZq8OKqwb6u/EH2G1EHnbLs=; b=EMSaU+ixZ9pRBJO/QP6hoKiewL2+WFyO2AQl/ILagRmim05ibWVslZ8aE0afg0QGGR 3SQywL3vpMyR6LqHdqVPsHlHs/NgryNwmVmCORXtg0AWW8FOVnRbagIwhbekjaLw//Yj ybfqqI0VBZA14fgg4PhRjfbg9tLP2F/39b9EjTeCWVkvj5BHjAA/fpZjhAkUB/uRufUi HnarXqFxnP6zHxWMp6N64+6kVk1z/EW082MOMQd7A5mb9v7fXfWj15wb2F2VIeGt/gih d9RBGh/CVkd61ZNJ+H1ANGeicpgrFYUcfUcYt+LDJsn4K77x7/XVonCW1HX3sDZeyNFC sThQ== X-Forwarded-Encrypted: i=1; AJvYcCWd5xMsLQMr2n9wBS3LIv8g1qnB07hg2Y9wYhTh3pEdZHN/s5tm87XjkNnSQH35fJI5f2JveLKdvNBkUhM=@vger.kernel.org X-Gm-Message-State: AOJu0YxddbwgxE6EtPUPCqRtKiW9Q1uTR76P445tDxRPhxIzdB+YZBAh QKZ4B2xQaVstNUjmCgMgINe33HUzpfEDOD/g0Fx7PDlqkGp/UrThO9mHCZjVJOiWL4C1z6DhLdQ ii6DkBt1tj1VBVsLhKPwsFVhMOh5gzOxQ9I2t X-Gm-Gg: ASbGncvYhyrGFU/cItF0Lkh35E29kB+KtuSF0MX4KvSLJK+nCqFJxIvLJJyz79QpkFA kPU6In6fnMHQbpkEmj1IiBpDuJYZOUbIFDBEfnTE95b9hWSQwzOuhG+qRzlXR5xgJTXdl50znst GtZrFftrKp/tGZhu4xsxwi8MaJd3Bcycf3UUOX99loaA/jY5X+rhDCPeFMDfFXHtN9CQoqr6V8x b92xvaGKJp2jphMF2ZaY+Mh9uMcS+Yw6Cb/Mtl6V3iOMq9zDsqbwMXT7zpE/hsnmh2aAPzhE1qY Ep0M4dBh/Bn/ziIbcPpQv9NGAIK0/MHnxeOMHTZ1CThqN8xaOMtwm4s= X-Google-Smtp-Source: AGHT+IG+alU718jhrtLgwSBCn0Hg1VyWjiAmiqngDIW05UDrmRiP8JyfLGPlu3WX7iH1exrAX1XOBeOJ74cm X-Received: by 2002:a05:6602:2cc9:b0:876:a91a:9076 with SMTP id ca18e2360f4ac-8795b08bfcamr2487939f.1.1752006141957; Tue, 08 Jul 2025 13:22:21 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.128]) by smtp-relay.gmail.com with ESMTPS id 8926c6da1cb9f-503b5a14ca4sm385101173.26.2025.07.08.13.22.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jul 2025 13:22:21 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.7.70.37]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 20B8F34050C; Tue, 8 Jul 2025 14:22:21 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 1E893E41CDE; Tue, 8 Jul 2025 14:22:21 -0600 (MDT) From: Caleb Sander Mateos To: Chris Mason , Josef Bacik , David Sterba , Jens Axboe Cc: Mark Harmstone , linux-btrfs@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH v2 1/4] btrfs/ioctl: don't skip accounting in early ENOTTY return Date: Tue, 8 Jul 2025 14:22:09 -0600 Message-ID: <20250708202212.2851548-2-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250708202212.2851548-1-csander@purestorage.com> References: <20250708202212.2851548-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" btrfs_uring_encoded_read() returns early with -ENOTTY if the uring_cmd is issued with IO_URING_F_COMPAT but the kernel doesn't support compat syscalls. However, this early return bypasses the syscall accounting. goto out_acct instead to ensure the syscall is counted. Signed-off-by: Caleb Sander Mateos Fixes: 34310c442e17 ("btrfs: add io_uring command for encoded reads (ENCODE= D_READ ioctl)") Acked-by: David Sterba --- fs/btrfs/ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 913acef3f0a9..ff15160e2581 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4827,11 +4827,12 @@ static int btrfs_uring_encoded_read(struct io_uring= _cmd *cmd, unsigned int issue =20 if (issue_flags & IO_URING_F_COMPAT) { #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) copy_end =3D offsetofend(struct btrfs_ioctl_encoded_io_args_32, flags); #else - return -ENOTTY; + ret =3D -ENOTTY; + goto out_acct; #endif } else { copy_end =3D copy_end_kernel; } =20 --=20 2.45.2 From nobody Tue Oct 7 14:46:49 2025 Received: from mail-oa1-f99.google.com (mail-oa1-f99.google.com [209.85.160.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F49B23D29B for ; Tue, 8 Jul 2025 20:22:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006147; cv=none; b=Jd/dZylicKkRXaZD8r9E7a05tV76YxoPmWEuXHWS7s1BnuQfSsM30YFaX6G7NtVz5rUA+hrJ4U4vip5ZiIJ4WT0GiZgzoxn0xBpTYBtI1KN2FDOWBm1J0fnll2iHq85aTmALy8Dv6JGb+iYulZZJPqDbfYS8w77L0iVzowL6i9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006147; c=relaxed/simple; bh=4bIax1gyYYvpqMt8cPConX9wmrpXrYqQG/XPD2e8Ioo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q/qT/7sYn1KJDgBzrXwUcM20ZefUADTTfa2WzhevlQzDUm8BfkQW1XnQndvTRNN9CYGxvG67mLFfU+NMrwEwi87RwEbRVYAsjbmgvXmdhtkhml7FIkb35FsgiOPRANk1h5hiQ9/ks6uQ+9rhrmuUG5+VUAw/Mwg1C1//RULLYZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=Whn2coy/; arc=none smtp.client-ip=209.85.160.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="Whn2coy/" Received: by mail-oa1-f99.google.com with SMTP id 586e51a60fabf-2da39478181so850506fac.2 for ; Tue, 08 Jul 2025 13:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1752006142; x=1752610942; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IbVhQv8YJGYKLE0LWaArA9jYunrRwOqLWNMX36zOiHY=; b=Whn2coy/AFtW9ZPM+z1T2oH+6PoZhgsVQVCVe1CY2MCwCZDWPnGU4SdSu6ujxixljo Pl0MLQP6uico5tRnGCOyEQ0lnPeJ0flKLrF8K1p+xi0nlwuEHkJiyG/J/SDc32U16lWi l2PGmV57cNLNno4DI6/AM7DypdaSPu79+CE7kHRAq0S5ThHfF54DJ7xIJOmz2hfeN3sS wtEZ5fWLnXZC17tNYp05J2cgjSAR7UpSGKnd6ox9RMh7TPlpy2cs0SEjYv3I/91TnGht QUN88DmeaSbTsiW87q9pQIrA4ebMfLCPvfky5whTgQvxT/dfD7xIlJJ3+l6ecPckwHJ3 yCLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752006142; x=1752610942; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IbVhQv8YJGYKLE0LWaArA9jYunrRwOqLWNMX36zOiHY=; b=qwxyAl94/12kV6gwrYv+ewDESBSbvVKnT1F2Kq7tqfctEtsccgtdjocroLguRfHAB7 NNIYKNr9FwcbxQg2Tv1O8/YvZ+FOQb+iasGmmSWeXUwrr35sQKboSmPKvWXjVpt6U5UX 2EvjRN38W3/1HT63FbHANWS8JXYYaAzmfLICoElsepB69tTewHQvcNy5/chh0MJZagGB HdPaYs9F6cfc32nUd0QtpFL2+XDR7DK0QH8gY7LrQrbbJQK58wZbcCXkqXDv8wXY3v1O E3zv9RSC8q3Iyx39+RatCqNEPz2H+ZiO4HncgyplOE+Y0b4GrgARcEG/gxj3gOnvWIfX I05Q== X-Forwarded-Encrypted: i=1; AJvYcCUb+Q5JGwVSgK/LiJmTg27oDox3z++WiNHHMULL32Kdqrscix8KouUAKwumsKYlw6/jFGWBjTQpv3Mm/Cw=@vger.kernel.org X-Gm-Message-State: AOJu0YwB4Y9FvHj71BHVY8a2yL8bbtmhODS2gCIzSDxBr6Tc4u7BF5Fg 4ptwl9kSuFI88EloiqUjaOfbUcbM2PDQ1mJVE0ci4AWjsk1+Y/pL7kCZNuTlUfgGGoKqfWvwLgc RPjP+0BVTAeVwaqxYwrtjmWtnjhjsm1JwAr8uZVgDmrWVoS6NpXc+ X-Gm-Gg: ASbGnctU47z5nVPSRyeN8t8QfUnGP9/DRvtdW+5k+iEGAgLsU+81A2DM4orvLVQUDH8 nePo1Hi/MBtXoqcKLEW1BVKHeJlowCd3NVz37l5V+Dkp/INbe/G921EqKCKzwZF0G7rI8ljcBn7 azibybETN3ipvP1jzy+yULgEWox4Ln+J51tOgMxufXNrrBYWeJanSzqjikBRC+krEKs9dCgq2cl /saEW7+XuNWZAejrQ8S1fdu+cz5HV9ceKESL7XWiTWlIigktPAVzdaCYmHf+c1Jvo9bUXHLM1VT 2bqXl0FaMjnPqG9EIysdXU+kyFp/RmXhc/en/2yM X-Google-Smtp-Source: AGHT+IE8YlKT/00F+Yu2SYeEG2yU67VWu/UZkefui/vdHgZzLvAUibn1j109YPG+6uWbe8+4Dc9QKFIVL0m4 X-Received: by 2002:a05:6870:e0a8:b0:2e8:f7fd:6a75 with SMTP id 586e51a60fabf-2f796a0b1afmr4657958fac.12.1752006142392; Tue, 08 Jul 2025 13:22:22 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 586e51a60fabf-2f78fdff09csm717795fac.8.2025.07.08.13.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jul 2025 13:22:22 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.7.70.37]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id A4BA13402B1; Tue, 8 Jul 2025 14:22:21 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id A2B46E41CDE; Tue, 8 Jul 2025 14:22:21 -0600 (MDT) From: Caleb Sander Mateos To: Chris Mason , Josef Bacik , David Sterba , Jens Axboe Cc: Mark Harmstone , linux-btrfs@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH v2 2/4] io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag Date: Tue, 8 Jul 2025 14:22:10 -0600 Message-ID: <20250708202212.2851548-3-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250708202212.2851548-1-csander@purestorage.com> References: <20250708202212.2851548-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a flag IORING_URING_CMD_REISSUE that ->uring_cmd() implementations can use to tell whether this is the first or subsequent issue of the uring_cmd. This will allow ->uring_cmd() implementations to store information in the io_uring_cmd's pdu across issues. Signed-off-by: Caleb Sander Mateos Acked-by: David Sterba --- include/linux/io_uring/cmd.h | 2 ++ io_uring/uring_cmd.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h index 53408124c1e5..29892f54e0ac 100644 --- a/include/linux/io_uring/cmd.h +++ b/include/linux/io_uring/cmd.h @@ -6,10 +6,12 @@ #include #include =20 /* only top 8 bits of sqe->uring_cmd_flags for kernel internal use */ #define IORING_URING_CMD_CANCELABLE (1U << 30) +/* io_uring_cmd is being issued again */ +#define IORING_URING_CMD_REISSUE (1U << 31) =20 struct io_uring_cmd { struct file *file; const struct io_uring_sqe *sqe; /* callback to defer completions to task context */ diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index b228b84a510f..58964a2f8582 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -259,11 +259,15 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int i= ssue_flags) req->iopoll_start =3D ktime_get_ns(); } } =20 ret =3D file->f_op->uring_cmd(ioucmd, issue_flags); - if (ret =3D=3D -EAGAIN || ret =3D=3D -EIOCBQUEUED) + if (ret =3D=3D -EAGAIN) { + ioucmd->flags |=3D IORING_URING_CMD_REISSUE; + return ret; + } + if (ret =3D=3D -EIOCBQUEUED) return ret; if (ret < 0) req_set_fail(req); io_req_uring_cleanup(req, issue_flags); io_req_set_res(req, ret, 0); --=20 2.45.2 From nobody Tue Oct 7 14:46:49 2025 Received: from mail-vk1-f228.google.com (mail-vk1-f228.google.com [209.85.221.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78AE124110F for ; Tue, 8 Jul 2025 20:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006146; cv=none; b=b6qLKvNnv8s1VuO95bNACJgQQxz20CnWIViZvlPdn7Ioh7fv0qjxnk9EcnucSMRzq3j81xEoLcQ9OlswbgPuXBzmwxdBdMq8wUj9s3e+KlbJ3rQZFIj9B00u4u/TSVZ3z2i1uXuUWj2crhHDjV8I3bH+/BryrmdUZ+jJCqU20m4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006146; c=relaxed/simple; bh=FnPpDqN7O0aPwX/W/1yco6ofOjFg1aDQKv5V46Z7+ks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IkmT38hV+n1LWZKUnQ6rnhfG3+Tp6bV4yK8+PUozYJA93O+IqiVrPyMvc6mg/oIePL0VQfenGWSI261MScjtP9yJT2duVf/51YTPXH8nIJYvfcdVmAoMcBNvJE/fAwgsuEg6/Ywy9aXpdYLYGtAPsUFcvFlz6YU2vVddQn5j3sk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=J8GA8PcE; arc=none smtp.client-ip=209.85.221.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="J8GA8PcE" Received: by mail-vk1-f228.google.com with SMTP id 71dfb90a1353d-532e831a81fso92276e0c.3 for ; Tue, 08 Jul 2025 13:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1752006143; x=1752610943; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mybhRJjeD/SDX1/X5lJ4CCixpkUUl0tnOPI9FH5o5Og=; b=J8GA8PcEJmd/zlb7aH8t/8+ZsWuiysFBVwLboVX8YAeBV62T8vhIz0d1sRAAaYDKco fehcitlKjCtGvrSfVlLjpFtMWfH5gdVP82nWbV2AbEBr9WNsxb0HG5aDz3dqalLcSLPN lqI6Fq/0ZqUatbzhVo0++JqgAVk2jDJKjEKMw2cEyzu8Z/6gKt0xoVIuXlIZf9ArRl8z XfIMdjcZd/bHQ22qW6EZRmswJMdgzYwdfIH0y7osen6vJMv4eTM7BlN7RpTDlYMeUzKh 78pgWzAYNN+X3CgBLj2z0bonJFh34kNNKEdfrynSG1JF+Zr5GnYfe/4p9JJLPMZ5zsN3 Ch7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752006143; x=1752610943; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mybhRJjeD/SDX1/X5lJ4CCixpkUUl0tnOPI9FH5o5Og=; b=MXLdJeB3Fdhxv+5ng2wbZDNrmnwHF6eefkRUUBJ1vpOVcSI/obBNW+8XoLB8V9XoAe 6cn0B6zUU4p5tIMr6eeTNVF3jqnoW8WVQnCn2vdsg7A1r3STa18CPO6L2qD4yvYveGTf WUqEzfYXYXKItP20ZhDTza7G4jmeDs9yJ2Y80rs3GLO9rWVUoudoiyD6QnrX/rcG7nWH Fort9+VwbYFWa4ScitnKSIh+2m5HZDPEBWLu+FcuWD4zgAxmENhn+iKgTEFjYlnVkP/E 3SIExK1PsWqU2Hin6Vt3PNJmzungkOsTvxjbglkX/UJr3dZXebhSHs1Z0/KcBju8dZib 8LRA== X-Forwarded-Encrypted: i=1; AJvYcCXychntUmgkQusD0FBEX4w4Lm9ECl4bFiV8WRDv7/zXL8i9xqARP2lfJk6c4Nv3NeoKWfbnd3GMM/TtQQw=@vger.kernel.org X-Gm-Message-State: AOJu0Yzj2KcIRZY6ULPjwddlURgG5Vz13AfkY522tyZWKSf48stherzf 00XFhwy6nROwJbTbjItj3LIkei40hGgeU3nc2pg+Qe24C1njM8Gu7Y3PqwyD5VHzywgfboCXXDJ io5rae1reS6BW4ENMiEJNOCWIdhpp8k6LwWAWCp5yI+FT3awMXm/g X-Gm-Gg: ASbGncv5L3nArUSs/Vt3BOhaZhQTDz8MdjOFz0YG5JwsCCYqK2UCMwshCHxgQ9J8UXc XNbsHLlPtyFP/0LRp6Lkdbk3c0cz8/COSPkxpLN6KYpBA8YguPWcgo7yHa4CBM6tHCjdUmzesQl sbLUj09BfG6lj/R70sPKhSUkFTojvTPCtvuU/T/2mfWVDEqKDjEPD24ARzDzhNDMQaa778w1BLd uHFOA+wHt+jimSvDMwiUnNNDyB3uQ5OlZQV1h0jZXZLE/t1X8bZIXEMJliyND8U219axIkCSLzY IB+1S1rQzY/PiIxEzxTlW9w8yGRuH/1AW03XJGU6 X-Google-Smtp-Source: AGHT+IHYqzTxRs/HjUbVHh7vShirT6xyeWtD4Rh1khbDuaNfsTesTzSXIz4ihU28zMunzVsVzsx/qjzG8h/j X-Received: by 2002:a05:6122:530c:10b0:531:c315:f777 with SMTP id 71dfb90a1353d-535d526ebb1mr55769e0c.1.1752006143200; Tue, 08 Jul 2025 13:22:23 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 71dfb90a1353d-53478e7e801sm477879e0c.6.2025.07.08.13.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jul 2025 13:22:23 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.7.70.37]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 39E4A34050C; Tue, 8 Jul 2025 14:22:22 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 37C22E41CDE; Tue, 8 Jul 2025 14:22:22 -0600 (MDT) From: Caleb Sander Mateos To: Chris Mason , Josef Bacik , David Sterba , Jens Axboe Cc: Mark Harmstone , linux-btrfs@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH v2 3/4] btrfs/ioctl: store btrfs_uring_encoded_data in io_btrfs_cmd Date: Tue, 8 Jul 2025 14:22:11 -0600 Message-ID: <20250708202212.2851548-4-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250708202212.2851548-1-csander@purestorage.com> References: <20250708202212.2851548-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" btrfs is the only user of struct io_uring_cmd_data and its op_data field. Switch its ->uring_cmd() implementations to store the struct btrfs_uring_encoded_data * in the struct io_btrfs_cmd, overlayed with io_uring_cmd's pdu field. This avoids having to touch another cache line to access the struct btrfs_uring_encoded_data *, and allows op_data and struct io_uring_cmd_data to be removed. Signed-off-by: Caleb Sander Mateos Acked-by: David Sterba --- fs/btrfs/ioctl.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index ff15160e2581..6183729c93a1 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4627,10 +4627,17 @@ static int btrfs_ioctl_encoded_write(struct file *f= ile, void __user *argp, bool add_wchar(current, ret); inc_syscw(current); return ret; } =20 +struct btrfs_uring_encoded_data { + struct btrfs_ioctl_encoded_io_args args; + struct iovec iovstack[UIO_FASTIOV]; + struct iovec *iov; + struct iov_iter iter; +}; + /* * Context that's attached to an encoded read io_uring command, in cmd->pd= u. It * contains the fields in btrfs_uring_read_extent that are necessary to fi= nish * off and cleanup the I/O in btrfs_uring_read_finished. */ @@ -4648,10 +4655,11 @@ struct btrfs_uring_priv { int err; bool compressed; }; =20 struct io_btrfs_cmd { + struct btrfs_uring_encoded_data *data; struct btrfs_uring_priv *priv; }; =20 static void btrfs_uring_read_finished(struct io_uring_cmd *cmd, unsigned i= nt issue_flags) { @@ -4706,10 +4714,11 @@ static void btrfs_uring_read_finished(struct io_uri= ng_cmd *cmd, unsigned int iss __free_page(priv->pages[index]); =20 kfree(priv->pages); kfree(priv->iov); kfree(priv); + kfree(bc->data); } =20 void btrfs_uring_read_extent_endio(void *ctx, int err) { struct btrfs_uring_priv *priv =3D ctx; @@ -4789,17 +4798,10 @@ static int btrfs_uring_read_extent(struct kiocb *io= cb, struct iov_iter *iter, btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED); kfree(priv); return ret; } =20 -struct btrfs_uring_encoded_data { - struct btrfs_ioctl_encoded_io_args args; - struct iovec iovstack[UIO_FASTIOV]; - struct iovec *iov; - struct iov_iter iter; -}; - static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int= issue_flags) { size_t copy_end_kernel =3D offsetofend(struct btrfs_ioctl_encoded_io_args= , flags); size_t copy_end; int ret; @@ -4811,11 +4813,15 @@ static int btrfs_uring_encoded_read(struct io_uring= _cmd *cmd, unsigned int issue loff_t pos; struct kiocb kiocb; struct extent_state *cached_state =3D NULL; u64 start, lockend; void __user *sqe_addr; - struct btrfs_uring_encoded_data *data =3D io_uring_cmd_get_async_data(cmd= )->op_data; + struct io_btrfs_cmd *bc =3D io_uring_cmd_to_pdu(cmd, struct io_btrfs_cmd); + struct btrfs_uring_encoded_data *data =3D NULL; + + if (cmd->flags & IORING_URING_CMD_REISSUE) + data =3D bc->data; =20 if (!capable(CAP_SYS_ADMIN)) { ret =3D -EPERM; goto out_acct; } @@ -4841,11 +4847,11 @@ static int btrfs_uring_encoded_read(struct io_uring= _cmd *cmd, unsigned int issue if (!data) { ret =3D -ENOMEM; goto out_acct; } =20 - io_uring_cmd_get_async_data(cmd)->op_data =3D data; + bc->data =3D data; =20 if (issue_flags & IO_URING_F_COMPAT) { #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) struct btrfs_ioctl_encoded_io_args_32 args32; =20 @@ -4939,21 +4945,28 @@ static int btrfs_uring_encoded_read(struct io_uring= _cmd *cmd, unsigned int issue out_acct: if (ret > 0) add_rchar(current, ret); inc_syscr(current); =20 + if (ret !=3D -EIOCBQUEUED && ret !=3D -EAGAIN) + kfree(data); + return ret; } =20 static int btrfs_uring_encoded_write(struct io_uring_cmd *cmd, unsigned in= t issue_flags) { loff_t pos; struct kiocb kiocb; struct file *file; ssize_t ret; void __user *sqe_addr; - struct btrfs_uring_encoded_data *data =3D io_uring_cmd_get_async_data(cmd= )->op_data; + struct io_btrfs_cmd *bc =3D io_uring_cmd_to_pdu(cmd, struct io_btrfs_cmd); + struct btrfs_uring_encoded_data *data =3D NULL; + + if (cmd->flags & IORING_URING_CMD_REISSUE) + data =3D bc->data; =20 if (!capable(CAP_SYS_ADMIN)) { ret =3D -EPERM; goto out_acct; } @@ -4971,11 +4984,11 @@ static int btrfs_uring_encoded_write(struct io_urin= g_cmd *cmd, unsigned int issu if (!data) { ret =3D -ENOMEM; goto out_acct; } =20 - io_uring_cmd_get_async_data(cmd)->op_data =3D data; + bc->data =3D data; =20 if (issue_flags & IO_URING_F_COMPAT) { #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) struct btrfs_ioctl_encoded_io_args_32 args32; =20 @@ -5061,10 +5074,13 @@ static int btrfs_uring_encoded_write(struct io_urin= g_cmd *cmd, unsigned int issu kfree(data->iov); out_acct: if (ret > 0) add_wchar(current, ret); inc_syscw(current); + + if (ret !=3D -EAGAIN) + kfree(data); return ret; } =20 int btrfs_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags) { --=20 2.45.2 From nobody Tue Oct 7 14:46:49 2025 Received: from mail-vk1-f228.google.com (mail-vk1-f228.google.com [209.85.221.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AB3A241CA2 for ; Tue, 8 Jul 2025 20:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006146; cv=none; b=qzeUI1xZatxG/ACbc2vh3DCthYi6XtjaM+4gCpwhiup63JJU1RBjbl+n/jlvz2oxStCC0IO5GWaXIDNFGC/gLrfcoOgsvMxTjERVYC9hwito7uNd2gJIGP/yEE9HZiJMU00qFzbMGmsEs4Seu+XkL/48yK0aVchLuTovBKufZsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752006146; c=relaxed/simple; bh=ZVBrrHmhgsG6N59v7mULAw5I6M2l2CKSVzxTpP6rvro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rBpSqjglimr3Gs9GguAF1m74xVw5boljhR9AsI++YoXxrf70a5uzXOk2qMNOH7CtugIm+7a2fL6sFtVzGV3CUKemWvwLQUIvA/IJuweCIYClcEI8P9QOZ5UsKZMSIATPHxCOfi43CATni5pHVjWVAmtvYDLaP20klkAZigTxubQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=LHIXJY3u; arc=none smtp.client-ip=209.85.221.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="LHIXJY3u" Received: by mail-vk1-f228.google.com with SMTP id 71dfb90a1353d-53470a345e8so104096e0c.0 for ; Tue, 08 Jul 2025 13:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1752006144; x=1752610944; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YJ6ufLrTJ+dfNDDuxAhQi2WJ2AhmuL1ORSeAN7H3r9I=; b=LHIXJY3uEF3Q/tcu/TiuuXHgWXapogpJCAE3yUDxjUQz0MoQR+jKCeOpTMw4dDBKTz IesygsEWLFd2hy0sIyk8q13Ao2/jZLwB5THXzu9mFHoOdv/lKzmD2JTcjGcDriuCNPX2 ICMYEFzovVJiCEflk7vQetioE+MP6YZz9lMj4qsQPr4kYuNr5PxwS7kdywDGgRzi0LnM RI48oE+5TA+dzwbfYS6nRvfnPTvw5QnqnpkDoDKVs7VebA0ogKG9vir+AqjStxgp3Cb0 1iKsbDEoDKNkcAcQwkGX4ZdZUdn547e0fnM/pU3uMeyGaZaHen1ke1E6p+jaCdesjhZn hl+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752006144; x=1752610944; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YJ6ufLrTJ+dfNDDuxAhQi2WJ2AhmuL1ORSeAN7H3r9I=; b=mdCbbsfks4yz9P5aefk2ouIxa1RbsGlP6LFZ39Sb6AXgIZU+O3i8W3HKt2eqWEHZxk CGXD7LV5bRjJzH7JfZImuimR69UwjIdhz+uTd4/PEnpRi/H9ZAtXeVQ3eyQFRgqgMtTw hpQK5GMyT41zEIluWxPLBU3kzMxJY5LR7NkM2mwbyiJs82/T6k2fPk2OQ8w8r6ZW38KG UgXQsN9iZxk6ci+T5tQKyu627Wmd4GwxRlqsy1mTm3/efS4+xgzSGG0mgdBsriOJTfTl K+P/m6I0xHkCeXzWy2xSg0YGjt+53622ZAfhN8FQXbX3ri6xBaHl8gd7JaH3ZoeN6l/v e9Qw== X-Forwarded-Encrypted: i=1; AJvYcCU+lqEf36A7uLpfHOxyhujekmeq9nIr88fJ/125FOwRPhYAoVXum3rzMPU0zzYpyW/5OCOo+XJ+9XjrnPQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwbSkWOXas7QEQw2Ug+HP/WlkChCebWIe93lGVrS2M4GdAyd7p3 jMLpRv+ofN2NXHo2fMQVbqPOLz2LPwzEEOFtJEWGXJ4nZRfG0B3gxSIvwx5qPJ/tNLWfSLfiLRQ ZF8/EhJ3G3/C2zZAa2Uj9neo2rqUlXnFDLIEe X-Gm-Gg: ASbGncvBXctXWAUl+yYwTC1loP6iXPZ/iFJcDprx6PK93LxPmAjYK2+pWSqDBSoD98o kx+ZCNznGUHC1NvNx8sJ3x1YrP77vaYE+8Z+5nW2Jz910E6xXYn/PiNQ4S8AA71SqSXluwaIayx 8b7uaOhyeYJhliOU6D4D7bVeVTyWYTuRgzvfvx/m5DmXd0BnQUulRTpYCzskCL+I44e9I5BLDTK tvtlReeVGcOoxYjGdSBu8VI6oYfx1kxswK++MiYLG4C5xCkoTSwylSIUEA5wPrrUtrBW8V30Dfn uE00Lbfq9uNloaq1zUNu8wLM6/vpI1QnZmuJQn7BjOAEviQDgDliYXY= X-Google-Smtp-Source: AGHT+IFJUSFN4ZOpjMCeamxy/173A4wpLk3i5AJortHDDnjHVKBklDx3ykVDiJk3P1pvSv9lOH+Dxcj5TVey X-Received: by 2002:a05:6122:8606:b0:531:c315:f787 with SMTP id 71dfb90a1353d-5347c274f0amr4289125e0c.2.1752006143793; Tue, 08 Jul 2025 13:22:23 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 71dfb90a1353d-5347906c808sm536733e0c.7.2025.07.08.13.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jul 2025 13:22:23 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.7.70.37]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id C1D3934069F; Tue, 8 Jul 2025 14:22:22 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id BF952E41CDE; Tue, 8 Jul 2025 14:22:22 -0600 (MDT) From: Caleb Sander Mateos To: Chris Mason , Josef Bacik , David Sterba , Jens Axboe Cc: Mark Harmstone , linux-btrfs@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH v2 4/4] io_uring/cmd: remove struct io_uring_cmd_data Date: Tue, 8 Jul 2025 14:22:12 -0600 Message-ID: <20250708202212.2851548-5-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250708202212.2851548-1-csander@purestorage.com> References: <20250708202212.2851548-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There are no more users of struct io_uring_cmd_data and its op_data field. Remove it to shave 8 bytes from struct io_async_cmd and eliminate a store and load for every uring_cmd. Signed-off-by: Caleb Sander Mateos Acked-by: David Sterba --- include/linux/io_uring/cmd.h | 9 --------- io_uring/uring_cmd.c | 12 +----------- io_uring/uring_cmd.h | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h index 29892f54e0ac..cfa6d0c0c322 100644 --- a/include/linux/io_uring/cmd.h +++ b/include/linux/io_uring/cmd.h @@ -19,14 +19,10 @@ struct io_uring_cmd { u32 cmd_op; u32 flags; u8 pdu[32]; /* available inline for free use */ }; =20 -struct io_uring_cmd_data { - void *op_data; -}; - static inline const void *io_uring_sqe_cmd(const struct io_uring_sqe *sqe) { return sqe->cmd; } =20 @@ -135,15 +131,10 @@ static inline void io_uring_cmd_complete_in_task(stru= ct io_uring_cmd *ioucmd, static inline struct task_struct *io_uring_cmd_get_task(struct io_uring_cm= d *cmd) { return cmd_to_io_kiocb(cmd)->tctx->task; } =20 -static inline struct io_uring_cmd_data *io_uring_cmd_get_async_data(struct= io_uring_cmd *cmd) -{ - return cmd_to_io_kiocb(cmd)->async_data; -} - /* * Return uring_cmd's context reference as its context handle for driver to * track per-context resource, such as registered kernel IO buffer */ static inline void *io_uring_cmd_ctx_handle(struct io_uring_cmd *cmd) diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index 58964a2f8582..053bac89b6c0 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -24,25 +24,19 @@ void io_cmd_cache_free(const void *entry) =20 static void io_req_uring_cleanup(struct io_kiocb *req, unsigned int issue_= flags) { struct io_uring_cmd *ioucmd =3D io_kiocb_to_cmd(req, struct io_uring_cmd); struct io_async_cmd *ac =3D req->async_data; - struct io_uring_cmd_data *cache =3D &ac->data; - - if (cache->op_data) { - kfree(cache->op_data); - cache->op_data =3D NULL; - } =20 if (issue_flags & IO_URING_F_UNLOCKED) return; =20 io_alloc_cache_vec_kasan(&ac->vec); if (ac->vec.nr > IO_VEC_CACHE_SOFT_CAP) io_vec_free(&ac->vec); =20 - if (io_alloc_cache_put(&req->ctx->cmd_cache, cache)) { + if (io_alloc_cache_put(&req->ctx->cmd_cache, ac)) { ioucmd->sqe =3D NULL; req->async_data =3D NULL; req->flags &=3D ~(REQ_F_ASYNC_DATA|REQ_F_NEED_CLEANUP); } } @@ -191,13 +185,10 @@ EXPORT_SYMBOL_GPL(io_uring_cmd_done); int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) { struct io_uring_cmd *ioucmd =3D io_kiocb_to_cmd(req, struct io_uring_cmd); struct io_async_cmd *ac; =20 - /* see io_uring_cmd_get_async_data() */ - BUILD_BUG_ON(offsetof(struct io_async_cmd, data) !=3D 0); - if (sqe->__pad1) return -EINVAL; =20 ioucmd->flags =3D READ_ONCE(sqe->uring_cmd_flags); if (ioucmd->flags & ~IORING_URING_CMD_MASK) @@ -209,11 +200,10 @@ int io_uring_cmd_prep(struct io_kiocb *req, const str= uct io_uring_sqe *sqe) ioucmd->cmd_op =3D READ_ONCE(sqe->cmd_op); =20 ac =3D io_uring_alloc_async_data(&req->ctx->cmd_cache, req); if (!ac) return -ENOMEM; - ac->data.op_data =3D NULL; ioucmd->sqe =3D sqe; return 0; } =20 void io_uring_cmd_sqe_copy(struct io_kiocb *req) diff --git a/io_uring/uring_cmd.h b/io_uring/uring_cmd.h index 9e11da10ecab..041aef8a8aa3 100644 --- a/io_uring/uring_cmd.h +++ b/io_uring/uring_cmd.h @@ -2,11 +2,10 @@ =20 #include #include =20 struct io_async_cmd { - struct io_uring_cmd_data data; struct iou_vec vec; struct io_uring_sqe sqes[2]; }; =20 int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags); --=20 2.45.2