Message ID | 54b2273600884f077b1564d4353c77ce2d9b1051.1724297388.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 A9377C3DA4A for <linux-mm@archiver.kernel.org>; Thu, 22 Aug 2024 03:35:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C90BC6B0256; Wed, 21 Aug 2024 23:35:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C3FAF6B0258; Wed, 21 Aug 2024 23:35:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABB976B0295; Wed, 21 Aug 2024 23:35:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 85B896B0256 for <linux-mm@kvack.org>; Wed, 21 Aug 2024 23:35:41 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4152EC1224 for <linux-mm@kvack.org>; Thu, 22 Aug 2024 03:35:41 +0000 (UTC) X-FDA: 82478466882.13.947E3D7 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by imf06.hostedemail.com (Postfix) with ESMTP id 609D4180010 for <linux-mm@kvack.org>; Thu, 22 Aug 2024 03:35:39 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=grqfWCND; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of asml.silence@gmail.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=asml.silence@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724297674; a=rsa-sha256; cv=none; b=B1nr2rs7XynGzrJU3xdDQ6/y4ogmjEd9fMMJ36TwmjwsC+RL9JTsFHE/R3nQCPN2KkaQHD 4eoGCuio7ySoKCH2I9y636Aab75uhTl/2WvRWTIjlYS9/y6HTgmGljmzlFrlJso9ojIQJV xh6eKYCeVBuC0hsRwgntGMyrQr74tjg= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=grqfWCND; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of asml.silence@gmail.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=asml.silence@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724297674; 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=ZDiwRdD8xHUYQFaa/cBKD1MsA/5zu5dNJqq/Z/tWori0YoX1KXxztyVJgN5eJEUf6N2pHk agpEgfFqqorGJy2+qHqRuHU8UH6GmOCmOyKe1MJ089G9GmdV4/pD0+Wj9LJfjNlb4/Hrd+ Bvrew29MiwAW0hzhyML26ubv8e6uw0k= Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-42808071810so2037335e9.1 for <linux-mm@kvack.org>; Wed, 21 Aug 2024 20:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724297738; x=1724902538; 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=grqfWCNDxrwhsX7h4zRbSHfwCWCwVdK3YzLgHe9s9VdijDy1+TGfqv3yqp/IKxi5jx R2sae20H/CkqOwAV/8u6QRGuowYggR1iVkLneitGz13n08XfVNXmYJHr7f3mPbJUW3YZ os7+pMKbSZXaWK0EeS/U15XlWfV4xVgJ73eXKjvgjAsq7APRYLrGoboS3szuIVlZu0CY sf7wnAtORY/6dASakxmxomIs6cPa9Jjn2ckyFQx/qkhnDgHKGNRSF3lw6pmOvf/h6qLv ePndzVVL9py4yNFlSrSPcWveXtTwTjwVqsxv1FEfmoX3dRTIOLNzKQbLInX+XaEPRG3Y 2G8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724297738; x=1724902538; 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=dHz/YtoyYPyE1F/cnu5pyqIt0ZDvnERldD2NU8oUAUlbSNPHc+oOgisKTOfJfZ1HEp ZNH7ydug+CiLyBXmeqgHBLzxf878gKZeaDgDhLLHreikylHJdtKE6Ma14R8++fDrA/n4 P3Tz9gIk1Vw2HUS8q3dQlxv8CFH4/hyn5ik4zYNt2/DzDeSbN+b/RzEuE2YPG9zr17Ud 2uj+Jr+YZI8lCCcig9XEiLIXQmTqW9QuG8NmQTP2SWkDdVbzL98de7mLvgSic1aBL6cL x9g8hqAfitFv59WEVsF9SCFWjgWwHeZpLCBXAkgknpLlJ/HXcCLktiDEn+lnC69LAIb4 1rdQ== X-Forwarded-Encrypted: i=1; AJvYcCXAyxDH4or6/X9rZG3zzgNn74FiHNUE8nDYSstrKwvVH3aRljMBdGk5fYrmLvwuOAEMP9mK/MSAcQ==@kvack.org X-Gm-Message-State: AOJu0YyzB/TSznBx96q5wxyyWt4QTeJNG/n8u8bnQkr78lZSi2iZDKes Lv9Bc1r97IaaQx2iElBFX8N0rLRjEYG9UPbzsFaVlSQEXu8zUt9QG+xyjA== X-Google-Smtp-Source: AGHT+IHDULdLquHnuYJwxgO4fQ1bzZiZlm+YOsZaNNDGdxrpbgmJfo4P3H5hO/VE8ik0Fzd4TfAAUQ== X-Received: by 2002:a05:600c:45cf:b0:428:fb7f:c831 with SMTP id 5b1f17b1804b1-42abd253e34mr32708315e9.32.1724297737617; Wed, 21 Aug 2024 20:35:37 -0700 (PDT) Received: from 127.0.0.1localhost ([148.252.128.6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42abefc626fsm45491995e9.31.2024.08.21.20.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 20:35:37 -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 Subject: [PATCH v2 2/7] io_uring/cmd: give inline space in request to cmds Date: Thu, 22 Aug 2024 04:35:52 +0100 Message-ID: <54b2273600884f077b1564d4353c77ce2d9b1051.1724297388.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <cover.1724297388.git.asml.silence@gmail.com> References: <cover.1724297388.git.asml.silence@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 609D4180010 X-Stat-Signature: sjeckg5o3pc1a6aqdbxrdi84h65u7ch8 X-Rspam-User: X-HE-Tag: 1724297739-517423 X-HE-Meta: U2FsdGVkX1/YCKkxvsapXq8oUBnIcSXNEednuXrV8KJrPkY12AWdDn3/TzlqoNbh5EG4RlQAaAq3msh/IFmUqRuJYofRUU65BEF2GnxTN0NW4r0qQWltBpKkXhu45lvBgKoF2tNHpDnEGjnv1SmJvMPun/bbMOsPtSFsc7EiVswjrz7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WM5oIOwESguFHKmIZkHNa3U/cktm/yVzUarn47smU7h1J+avXvCwToZeU3Usj2rbMciYYU+JrJZL0yaP0Fd0liNE87JS7XNnqnEyy4MG3Lv6M5UNfaAAJTFXs6y3cVgr7ndFfdZmNInvNBWu/EFnPPQy5NdMrt6AAAZCfgwWFEv6ws/Mhs3UEYfGBUMKvZzYmdnSzbnk79RDz6H4rrJKCs9b1uqRsW68AretuyVu4YlRfLmK4w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.001298, 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/etc. 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(+)