Message ID | 7ca779a61ee5e166e535d70df9c7f07b15d8a0ce.1725621577.git.asml.silence@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E7BDE6FE49 for <linux-mm@archiver.kernel.org>; Fri, 6 Sep 2024 22:57:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A08A6B008A; Fri, 6 Sep 2024 18:57:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FF4B6B008C; Fri, 6 Sep 2024 18:57:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62B306B0092; Fri, 6 Sep 2024 18:57:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4276C6B008A for <linux-mm@kvack.org>; Fri, 6 Sep 2024 18:57:02 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B5A121611A5 for <linux-mm@kvack.org>; Fri, 6 Sep 2024 22:57:01 +0000 (UTC) X-FDA: 82535825442.19.96A08E9 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by imf02.hostedemail.com (Postfix) with ESMTP id DBAFA8000E for <linux-mm@kvack.org>; Fri, 6 Sep 2024 22:56:59 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KLu9uuQZ; spf=pass (imf02.hostedemail.com: domain of asml.silence@gmail.com designates 209.85.167.43 as permitted sender) smtp.mailfrom=asml.silence@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725663370; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yyZRXxiAI12SAMIbkwT8bn9l7S8e/TKEaLOeKBVDL1c=; b=Mlc9mARmezwImZp5W4m09oVNuZf+CSyX7yilNyuCb1JquiPiw5rsiZD3urDcIh+X3U1SfE yCGRLs6OZ92PaVKIbTwkBai/2qPEyNnD8fBY+k28Y5S0vAu3Q/9yvCaiy+jpYFOq9oylrK JtpL/6M9OKwBruqzvU1/+vHbLuTCKMU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KLu9uuQZ; spf=pass (imf02.hostedemail.com: domain of asml.silence@gmail.com designates 209.85.167.43 as permitted sender) smtp.mailfrom=asml.silence@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725663370; a=rsa-sha256; cv=none; b=DDET5dbMLn7Rh0RrSWYPJ9lUAahD2LfNK1vnZEwXMUS8oQMYmczAdUeVi8ZB+K2ZtuGEpI qwoHIb2m/Hl8YnKxwFoFF4Fbs96+0G5161MjEuc7uEcklzV9RN8Qel9SKxDLlOFKz1H4KS zxVD274URZosUyFKln7avOQ8AZ5N8CA= Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5353cd2fa28so3004924e87.3 for <linux-mm@kvack.org>; Fri, 06 Sep 2024 15:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725663418; x=1726268218; darn=kvack.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=yyZRXxiAI12SAMIbkwT8bn9l7S8e/TKEaLOeKBVDL1c=; b=KLu9uuQZ0u2h9qVWiRscki6SURUEut3+pZEO93I02PU0SNzq7R00r3nykW+BcmH8xc FB+Bg8PVo+fXsSRt4SmF0aTDTbAS//5yEdLA89BHaA8/LTBVxGlzH3976v95ZQgHPDTW NtoOcEymFKLn0s8A72YFsuYiPxmX3ptIUPGkNwSrvaTmd1hORmN+/oCFmt6wG6x1stYm Nb7teliREyvwfULi+yR/gt2znPDRx507tsmByFjhxpFyDf0mVsq5vfrqTUKk3Yy/DHa0 juQGw4ZZsARofKKnWbGeh8Vbf0xWGX+6AFhBGCPw7554WUvKSNQIxbHXVrkm0DpAJy94 gPVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725663418; x=1726268218; 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=yyZRXxiAI12SAMIbkwT8bn9l7S8e/TKEaLOeKBVDL1c=; b=T8UNPCVwiNVk7/EebL1XjwBFoRV+J4EtmR3wNY/o3uL7HPi8OOo+hefkTDBUgKQiw8 ZljVdBI3obUeOP4T1kCfSUe7Kj2Bsk4FO9z14Egj+KYu4kSDVyIhc4ZFqPF9KFQ0+G27 28Z3OUDrRa8jqCsvF1VdV92zLSsSyl0b8AN3rHEv6mFGpBU2P/voBV26WRzwPr/7gaO7 JTqtayrgH46N4SRuD4c4zGzXSvMP4RMTQU1x3MYtFuPKNCcWRKpSAFN55qH5kTBSeVsi /+nVUVrtHvGjUN58xdtuUTBH+d3NKUO9ENwoOJyuv8AWXhZ2joJa9yNTfGt9w0/KWC4v jwDQ== X-Forwarded-Encrypted: i=1; AJvYcCV+7ogp9ARiSbYGYpw80P5NZyoLQIe8uhPTNHiiERYith70TPvFEIntkzA5ULtsGG6OsAihlmMPBw==@kvack.org X-Gm-Message-State: AOJu0YwYd8mdM5ArHD1sCuDKdDec/rPGBH56HAQ+8MRXSS1V93jj3dk/ T3sQn9dQWdUBfkMxeIRzwNTzbdmVounzwD/yg7YMfO8GgsIA4kYC X-Google-Smtp-Source: AGHT+IHXnXfbkaF7u3VX1p6hb15jHuT8Sz6pGMKxR+NPrjTVAbIbg44Z7wW3wwKJC6QGwAd3IjyH4Q== X-Received: by 2002:a05:6512:e88:b0:52e:7542:f471 with SMTP id 2adb3069b0e04-536587b8ec7mr3170548e87.29.1725663416985; Fri, 06 Sep 2024 15:56:56 -0700 (PDT) Received: from 127.0.0.1localhost ([148.252.146.236]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25d54978sm2679566b.199.2024.09.06.15.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 15:56:56 -0700 (PDT) From: Pavel Begunkov <asml.silence@gmail.com> To: io-uring@vger.kernel.org Cc: Jens Axboe <axboe@kernel.dk>, asml.silence@gmail.com, Conrad Meyer <conradmeyer@meta.com>, linux-block@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig <hch@infradead.org> Subject: [PATCH v4 2/8] io_uring/cmd: give inline space in request to cmds Date: Fri, 6 Sep 2024 23:57:19 +0100 Message-ID: <7ca779a61ee5e166e535d70df9c7f07b15d8a0ce.1725621577.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <cover.1725621577.git.asml.silence@gmail.com> References: <cover.1725621577.git.asml.silence@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: DBAFA8000E X-Stat-Signature: mdtfa6swmuik9cyc8tdinx8swfqjy47p X-HE-Tag: 1725663419-529889 X-HE-Meta: U2FsdGVkX184fRIJFc6yzx5nuqAC8SNKXsDNSAHlSE/0JJZi2KWdKwo3TFepNjyKeAcjY9aw2Nd+2GX55/So5a1At79pyldYdZQLJ3xLuIAE/9oXscX9CP7Fb42GykX0/wbDNo/uq1BivSGs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K2EeqGTC304PWxQYRrvS6zQ6BOBWFJfMOYnrS+EVOgiR1S9j++MiXNmnwzAOJDkVLW3WX4gWS5jJJ1wSQxphRsRpx20ydT+DOVlMWNQ6PmPW+ODEXoJJELYygx++sCqJg87OTvliK7Amk8TslVARLh7BQNgWr75kT+mJq9Bp8HEg5vKqknQJCmC6yT8w+EjabeOlBUm3bGPCNraRm4AZFGkE2qyQnsWleSyaXXXHT4OucB8HOvlhn2sIK+/aRoZkYiWqwdziBxiw8qG3kA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000010, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
implement async block discards and other ops via io_uring
|
expand
|
diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h index 86ceb3383e49..c189d36ad55e 100644 --- a/include/linux/io_uring/cmd.h +++ b/include/linux/io_uring/cmd.h @@ -23,6 +23,15 @@ static inline const void *io_uring_sqe_cmd(const struct io_uring_sqe *sqe) return sqe->cmd; } +static inline void io_uring_cmd_private_sz_check(size_t cmd_sz) +{ + BUILD_BUG_ON(cmd_sz > sizeof_field(struct io_uring_cmd, pdu)); +} +#define io_uring_cmd_to_pdu(cmd, pdu_type) ( \ + io_uring_cmd_private_sz_check(sizeof(pdu_type)), \ + ((pdu_type *)&(cmd)->pdu) \ +) + #if defined(CONFIG_IO_URING) int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, struct iov_iter *iter, void *ioucmd);
Some io_uring commands can use some inline space in io_kiocb. We have 32 bytes in struct io_uring_cmd, expose it. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> --- include/linux/io_uring/cmd.h | 9 +++++++++ 1 file changed, 9 insertions(+)