Message ID | 7ca779a61ee5e166e535d70df9c7f07b15d8a0ce.1726072086.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 49BD3EE57C0 for <linux-mm@archiver.kernel.org>; Wed, 11 Sep 2024 16:34:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E15E940065; Wed, 11 Sep 2024 12:34:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9688994004F; Wed, 11 Sep 2024 12:34:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76DF5940065; Wed, 11 Sep 2024 12:34:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4AE9794004F for <linux-mm@kvack.org>; Wed, 11 Sep 2024 12:34:28 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 007B91C405F for <linux-mm@kvack.org>; Wed, 11 Sep 2024 16:34:27 +0000 (UTC) X-FDA: 82553005374.08.9F11550 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf16.hostedemail.com (Postfix) with ESMTP id 20E23180003 for <linux-mm@kvack.org>; Wed, 11 Sep 2024 16:34:24 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Z7sSPBXH; spf=pass (imf16.hostedemail.com: domain of asml.silence@gmail.com designates 209.85.218.45 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=1726072412; a=rsa-sha256; cv=none; b=k7UPkHIjZzXoEOcQXaUlIwXs+axdtJjnYlwbwqVhDPzX2oC9i+OVv/VekFeNCrWjYZ7stg fG//5lGsGJys9ghfinLV5LA6YqZiOwZsyI5Du9jDs8o4rpKfIe9dwtop1xha8IB0X1UKsL KJGD2m8F9SEcoPDIi4AydoKLpqtJA8k= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Z7sSPBXH; spf=pass (imf16.hostedemail.com: domain of asml.silence@gmail.com designates 209.85.218.45 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=1726072412; 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=rzhnzOvUgQZ6hXDVL/EExhok//J2ZbJ53NMBPA3XrBwAcXavsn25QqX4NNIQmG+YHSAXhc pEBEv/TZ7KxGZENI0B2ghr+IvWp3Xx8PBWFw7Qx4rFR4EiyKL9jHHygtM5V0h4xjfhjy8U zh0x+K3nPbgeIZkJuehJFyCtd6KA8Z4= Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a8ce5db8668so5403866b.1 for <linux-mm@kvack.org>; Wed, 11 Sep 2024 09:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726072463; x=1726677263; 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=Z7sSPBXHV8GNXyLn3Qi6gg56CILK1Iy+LqhJ4kTL/zKwdSt3XJGdTZmSxC0HJCUB6L ZvtGyI5Pa2+Pv6vwDwaG5LlFWLhndUe67+gD39+JqI7g+/znXDw+GWqBqa3tYGyXDacY wIVy0UH7bGWuRC33OVi3HWnLudv6cuontC369argqFbIoGIpGmzMcD/QXXzRm/1wNV/u rV0CePGg1H0gTDRnycoBZmTMnx9koCkKB2UiOPBXnerzli14SOYcSih5MNXn+Em4be7j wf/BiKRLFElHKFWIcdzvnmvn5HYCWW+NeonhFTkvcjtRu23IIRUYONv/0ctOU2PIbO4l kmlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726072463; x=1726677263; 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=eNs4nu64XTnCuIGRUbyGrF6tDr8lwaB75uJDHl1yxFZLU6BdrYJpD796SrT+8zDBi3 31KpPwVE7CKFTj4035PMeDodi6ZLAku8O85cRvopvm7B8xARLNLAHRV48lju1VAcTsNV Su4KT0bAVoo9j2v79NC7eUWHIShU/ihh97ErgUqODqKJ0rGRIcBqcx9pCOJCL7bM7H70 uCuE79a2Fb1J9m88MuxAU10Md2eFMWmPIYG8sAwtDYaBe3RNL6sjBk5p/dZvACBOtI0r HSlMTwUQptM2LiihYa+1FNaRWei2rDVLKjED2ON79y1jHxHDb4CNjrQjjoFxt+2xUIiw r1ag== X-Forwarded-Encrypted: i=1; AJvYcCViX3orsQR5sRFU23Cj5GYLAOrczroGUVZkCZ87y19UEhNzD90rNwqaaxBH++1BdiPEeTE5g2cDIQ==@kvack.org X-Gm-Message-State: AOJu0YzN+hFHeCW22HMaxavNbFIr0b+Y8hioYYD+dvpC7foN3ap0+c9X eDcicOesdWuODKZ8iacRAPHohb3MmphSkEu9v4JgHehxafSCgXDzONuX2fqM X-Google-Smtp-Source: AGHT+IELcXHRTUSdLyLG5jnLYvW4/fqCNo1EAgwvWA0FaGjFDUj4/njuzwhpx/wmLaysANwmyDI4Hw== X-Received: by 2002:a17:907:2da3:b0:a7d:9f92:9107 with SMTP id a640c23a62f3a-a9029690793mr5422666b.58.1726072463487; Wed, 11 Sep 2024 09:34:23 -0700 (PDT) Received: from 127.0.0.1localhost ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25c72ed3sm631820866b.135.2024.09.11.09.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 09:34:22 -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, linux-block@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig <hch@infradead.org> Subject: [PATCH v5 2/8] io_uring/cmd: give inline space in request to cmds Date: Wed, 11 Sep 2024 17:34:38 +0100 Message-ID: <7ca779a61ee5e166e535d70df9c7f07b15d8a0ce.1726072086.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <cover.1726072086.git.asml.silence@gmail.com> References: <cover.1726072086.git.asml.silence@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: 6oodc43o5s89udh87now44nrw78cngf7 X-Rspamd-Queue-Id: 20E23180003 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1726072464-974554 X-HE-Meta: U2FsdGVkX1+S8mk+KzNTivCR2mrj07sf9WY54XPZZ/mzRbh3qzdZT06E3eTTpXF8jkxWqJ+hR5JAqF00hAxV/+zIypx0I8K8Yx/38BVTk10frb0IXdIXu+cyQlRmB0HyVM2tl9q8t3357erKKftV4Gsu/X6OvPGWigEGyvPE/9cK21QtG1hoK85+SRt7XgK5EUFmqDleELxj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z4suYRzoCtg2GXpgXwuCYPqiUkCjoeg590NIKyHMYPXycLecpHZ33elPT7+hGWwxa7P0sl6amCnxre7ijvykZbdUdzvZpbjeiRgpYCDho4v4klc2AVxv+HqeqwIlCxaDJck35zHyGFkpCOYomdeqQ3u98sLBQ1AMLLEkeIkJURyTT7QXA7mJcUXaKLL4GIIsjaqLDv+slA4H5vmf6OCA+994X/U6Aa9VZnlueig20OHI5pRrLU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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(+)