From nobody Fri Dec 19 18:42:58 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E07C0C00140 for ; Mon, 15 Aug 2022 23:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245427AbiHOXZr (ORCPT ); Mon, 15 Aug 2022 19:25:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345768AbiHOXVH (ORCPT ); Mon, 15 Aug 2022 19:21:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C675D7D790; Mon, 15 Aug 2022 13:04:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 79153B80EAD; Mon, 15 Aug 2022 20:04:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D17B1C433C1; Mon, 15 Aug 2022 20:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593868; bh=RhcSSngBtNJqlypII+iNFiSmycad2c4LfRwUEb29heI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OngrY+iYwanTr5cQLbCGZNvXM1+zZWU0nandkupwb8Lxf6nGcF7/SNx4nBwU75967 nMoTd8CmXaLewa8DtGdnAcs/3x7o61Ohe9hAZE9D//ax1ZRNLuR5bQ4CbvXTCefwXX Wym1r4ilTx6/x0O3rDkEX2Ldr0tlK+ywSvZvGihY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Thumshirn , Jens Axboe , Christoph Hellwig , Naohiro Aota , David Sterba , Sasha Levin Subject: [PATCH 5.18 1018/1095] block: add bdev_max_segments() helper Date: Mon, 15 Aug 2022 20:06:57 +0200 Message-Id: <20220815180511.200844214@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Naohiro Aota [ Upstream commit 65ea1b66482f415d51cd46515b02477257330339 ] Add bdev_max_segments() like other queue parameters. Reviewed-by: Johannes Thumshirn Reviewed-by: Jens Axboe Reviewed-by: Christoph Hellwig Signed-off-by: Naohiro Aota Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- include/linux/blkdev.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 34f2b88dfd6e..7927480b9cf7 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1196,6 +1196,11 @@ bdev_max_zone_append_sectors(struct block_device *bd= ev) return queue_max_zone_append_sectors(bdev_get_queue(bdev)); } =20 +static inline unsigned int bdev_max_segments(struct block_device *bdev) +{ + return queue_max_segments(bdev_get_queue(bdev)); +} + static inline unsigned queue_logical_block_size(const struct request_queue= *q) { int retval =3D 512; --=20 2.35.1