Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp722209pxr; Mon, 11 Apr 2022 05:40:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9xE7nzPWQVhTBEw+myGSSddnDtcsw+IXWGNxGm5DqINkdhxv27mbsYZ+/UxbAvu44hmVp X-Received: by 2002:a05:6402:2554:b0:41d:79:945f with SMTP id l20-20020a056402255400b0041d0079945fmr23649145edb.120.1649680847033; Mon, 11 Apr 2022 05:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649680847; cv=none; d=google.com; s=arc-20160816; b=Q++LpPL+Ad4y7EONmG2AMYSppAUcgYiWYMuZONQ0TGvECteC6aY4ToT1/92yeb/dAV 7H9mC8DnHoOr6g1Ra/5rqfRU6F0iDWmap5w0C2DbNaW8b90DSJUfoqPnjbumEElqcOqD hvwQZ9zIIaZm3lzF7dn70IjMRoZcgNOig4505R73e2psUZNuUxqGBElJhZdDecVUoLtu cxLWCVN9TDhwHGFMA3LdXHDFUKiT1c6Mn1VTBdET0dcJLgd+OpG8z/RgexB6Lt065cPE zKxB6RJXeX5IaYDth7AzSaRU7jiMUb8r+A3pTPDkYsSr62H2uHceYH1B7NEH4pRX0yNe GKpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V+N3WPhcjqbqmVRPAoIxuBjo6dgh1f5KuPVQDpaEGEs=; b=UlNEHJ234NUuqW25+KInrNgil5dYbDEhvyUCUZ4Jy2OfynecocGbqCJIlJIBu2cRkE cyXTohH+gYIAYvwWd3nqsOtQn31ZlTiJtNjbf399Rgxak7dYPogXcr06Oq1M5jC7dDr4 OcuKAko6WUoKilY1ZQiIpB9+jyXBy5xh7llVyNbRTW6zjrTMQJIPcW3Dgr9eFhUM/Rhc eQIRGseqAx3XhIYiP9PF0Tq31z1Q4ObmEQf6GrnBHCmAsSC/m9Ql93ThO3gZt1qM3cw4 RksdsT720NYr83NRy8Ms60Yr2HRYb1oZqUXr9iEJezcbNz9XGBfJ0zPY+0itaxeCQaSy 7iVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=tiIaiEVM; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a170906474500b006e8990303bcsi1409035ejs.375.2022.04.11.05.40.15; Mon, 11 Apr 2022 05:40:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=tiIaiEVM; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241230AbiDIEza (ORCPT + 99 others); Sat, 9 Apr 2022 00:55:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241111AbiDIEyi (ORCPT ); Sat, 9 Apr 2022 00:54:38 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D4D7E126D; Fri, 8 Apr 2022 21:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=V+N3WPhcjqbqmVRPAoIxuBjo6dgh1f5KuPVQDpaEGEs=; b=tiIaiEVMWAbVYZUjb2lOkfyysx dbx49Qpm+lo+UUevAGrVDIkvKOBa+44snHlQ0a+KaxdGF8tKMoYuXWs/fvRv0ae96tcME++4ORVYu qYaC1vBwLvlzDvH7/c4A7h9mvUaVl8+MzbhpnW7kmDycYjo20v3XRILfplXYTrbZMX8JEk4N43tKH ZGQP+OitiIrdN0xV7JNnkLHd6fyLWakKMo7lxXmk9Yj+ODdh4QMMFZVM+vhTm4zDm7nCREr0fmSsA waBKGG0G7evAOkXMc1HpZXEoglbkXIOtFpSCT7RrqLEic0YOHBHXQ9EKk4JuDHcopl0LFeqmVS4RI X94UE+Ww==; Received: from 213-147-167-116.nat.highway.webapn.at ([213.147.167.116] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nd34X-00217H-QX; Sat, 09 Apr 2022 04:51:42 +0000 From: Christoph Hellwig To: Jens Axboe Cc: dm-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-um@lists.infradead.org, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, nbd@other.debian.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org, "Martin K . Petersen" Subject: [PATCH 16/27] block: use bdev_alignment_offset in part_alignment_offset_show Date: Sat, 9 Apr 2022 06:50:32 +0200 Message-Id: <20220409045043.23593-17-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220409045043.23593-1-hch@lst.de> References: <20220409045043.23593-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Replace the open coded offset calculation with the proper helper. This is an ABI change in that the -1 for a misaligned partition is properly propagated, which can be considered a bug fix and matches what is done on the whole device. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/partitions/core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 2ef8dfa1e5c85..240b3fff521e4 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev, static ssize_t part_alignment_offset_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct block_device *bdev = dev_to_bdev(dev); - - return sprintf(buf, "%u\n", - queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits, - bdev->bd_start_sect)); + return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev))); } static ssize_t part_discard_alignment_show(struct device *dev, -- 2.30.2