Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3133562pxb; Tue, 12 Oct 2021 22:46:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8VsO85DSMtdeDN06pMM3gy1t4F0U0n0K/wGPVVkBESgujsVxpFNv2sjVYe8fKeiKLEQm/ X-Received: by 2002:a17:906:a4e:: with SMTP id x14mr7981742ejf.1.1634103999049; Tue, 12 Oct 2021 22:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634103999; cv=none; d=google.com; s=arc-20160816; b=Q/a8chC0MYcvMZtiF9vzw3p1VH2KcGG/sS0bqX6T8yQ0gIwThGSaxtn4NepMIjKJt3 B1vlhrBg62XmNXIX58DPkJMSCvPW4yUFD3xOBx/9wm7v3cgsNpC5ASiyHkC5kdevffkn 9o4QuyDLtQ4ta2TsAf3Lv4e4OKZDALAa5nnWqchrNTRv020pxDRHzishz6hW+Y/6yETa 4jZlBXum6R2bQtM+vgWMUEys5jJlvNYOelNvITXzEMutZoq1SL7ERoVhfqG5nxmOvJs5 xeULi/vwJTfIIL8i+SN612y2JG/nsTYDXzhx5R5zanIFLflgn3LCApNRsHE96N2NDJsX lhoQ== 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=kwfQLb7O9l96WELHgKkQp9uAWAHVStsZsqmvY42uDo4=; b=QHUbahUKIk03T8GAWYAw+wbwF5d5mwIYv8d7q8P4HKJ/V2iH2JQOwNkD2gMgzDR9mm cLsW4836XWRQkHE8HPwaTRB2hlI72AyNiYiqEc172ThekFLnyl9pxpVhZSAd62Bg/oDy 57kwDkjX0+qSkMCUFfbXMYwgZDPXPLghpeMoPaSxinyQk5NYtulpO4710+ES0L9dqjaz isNrIFiW1us9DDhp/fCZhspW4VHu7Q1w/Rk82Lfzkb6+FgD1bdoqHPa3YD7nw+vJ3e8D vNtt7OPouuItW2XOIM/OpB0QsdA/AwofY1evhtfBEV1kdONoXTQq3sK789nFrfNMWtHC yJpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Js2OVKVf; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si22695971ejn.389.2021.10.12.22.46.15; Tue, 12 Oct 2021 22:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Js2OVKVf; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232366AbhJMFsD (ORCPT + 99 others); Wed, 13 Oct 2021 01:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbhJMFsC (ORCPT ); Wed, 13 Oct 2021 01:48:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E6DC061570; Tue, 12 Oct 2021 22:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=kwfQLb7O9l96WELHgKkQp9uAWAHVStsZsqmvY42uDo4=; b=Js2OVKVfiBuoQhUaPUfmkclx7M vrcm9EA/k/58MnCVYR8evsjUq/8YSxHWrce4AslfsXGvyvTdhhqIyGJPATvDxpqQoD9IScte+hEkz DnB3FboglDfnuxse6DhZbT7kv4ybTwHy3r7ZExgrRfNsTj/EtZ/9HExURYmOO5GKGASY9oD12P8bt oLK99Yr3VXl9XkDp+Wc1ZhWpJWTkh33e4joQUxjU/cGOr5BdZGSsLck2z425Mw/QlOZ43bY9ROw+f Tq43ONvwIFJHr+HX+y1s/mwjBNvb8CC05HJyiYVwEqZEtf52eABp80sHiXOw2OyQ26fsS7F3Q7HqZ 7cPBt4fA==; Received: from 089144212063.atnat0021.highway.a1.net ([89.144.212.63] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1maWzm-0078GH-5A; Wed, 13 Oct 2021 05:40:38 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Coly Li , Mike Snitzer , Song Liu , David Sterba , Josef Bacik , "Theodore Ts'o" , OGAWA Hirofumi , Dave Kleikamp , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Kees Cook , Phillip Lougher , Jan Kara , linux-block@vger.kernel.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, reiserfs-devel@vger.kernel.org Subject: [PATCH 25/29] ext4: use sb_bdev_nr_blocks Date: Wed, 13 Oct 2021 07:10:38 +0200 Message-Id: <20211013051042.1065752-26-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013051042.1065752-1-hch@lst.de> References: <20211013051042.1065752-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0775950ee84e3..3dde8be5df490 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4468,7 +4468,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto cantfind_ext4; /* check blocks count against device size */ - blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits; + blocks_count = sb_bdev_nr_blocks(sb); if (blocks_count && ext4_blocks_count(es) > blocks_count) { ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu " "exceeds size of device (%llu blocks)", -- 2.30.2