From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB055C433EF for ; Wed, 13 Oct 2021 05:49:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1BC060FDC for ; Wed, 13 Oct 2021 05:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237795AbhJMFvT (ORCPT ); Wed, 13 Oct 2021 01:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237586AbhJMFvS (ORCPT ); Wed, 13 Oct 2021 01:51:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE4D1C061570; Tue, 12 Oct 2021 22:49:15 -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=Vyix3XnNewPbitJtfxF/KE3HcfFXjFKv1GQk4gXWQ44=; b=mS1vt9+lp4Lk5R6YaPr1obdBn8 KoEmy3QGJkuDO5yqPjhbR2J6Y35wEBEx8L5h9ZFgVQGwQaJVnKOWe00E5WMgbx6SiqwFYRAXFMn3J npt+6QLZlLwFvVR2v4KRrRgZG/4tt+JsTBw549Rr6Qu21s4AJfCFL4rxxUh/P/4+ffzWAm/mMSBEw 8prgiYz3jDLt51CC4UGDhhFsOik5puVVqqy52XwRoA6a4eOU6py0UFQtBhDl0fBFb1oAV3VWTCZzX 5envLujGqZwrf69wZIkPd1uI+Me9ct8DV8azTzowHCLdhU5yRQUcp6Aq+qpbw3sHXrCNRreTeerNW vSIb/OXg==; 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 1maX2q-0078RU-3q; Wed, 13 Oct 2021 05:43:48 +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 27/29] ntfs: use sb_bdev_nr_blocks Date: Wed, 13 Oct 2021 07:10:40 +0200 Message-Id: <20211013051042.1065752-28-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-bcache@vger.kernel.org Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig --- fs/ntfs/super.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 0d7e948cb29c9..5ae8de09b271b 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -2772,13 +2772,12 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) ntfs_debug("Set device block size to %i bytes (block size bits %i).", blocksize, sb->s_blocksize_bits); /* Determine the size of the device in units of block_size bytes. */ - if (!i_size_read(sb->s_bdev->bd_inode)) { + vol->nr_blocks = sb_bdev_nr_blocks(sb); + if (!vol->nr_blocks) { if (!silent) ntfs_error(sb, "Unable to determine device size."); goto err_out_now; } - vol->nr_blocks = i_size_read(sb->s_bdev->bd_inode) >> - sb->s_blocksize_bits; /* Read the boot sector and return unlocked buffer head to it. */ if (!(bh = read_ntfs_boot_sector(sb, silent))) { if (!silent) @@ -2816,8 +2815,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) goto err_out_now; } BUG_ON(blocksize != sb->s_blocksize); - vol->nr_blocks = i_size_read(sb->s_bdev->bd_inode) >> - sb->s_blocksize_bits; + vol->nr_blocks = sb_bdev_nr_blocks(sb); ntfs_debug("Changed device block size to %i bytes (block size " "bits %i) to match volume sector size.", blocksize, sb->s_blocksize_bits); -- 2.30.2