Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3135415pxb; Tue, 12 Oct 2021 22:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRS18FnwBQ9DXtCki/sNVcdb37SZSnGNmiCr1WePLO9pilixY3jDzSkIbv4H+Hf9FH2VDT X-Received: by 2002:a05:6402:34f:: with SMTP id r15mr5257404edw.111.1634104185879; Tue, 12 Oct 2021 22:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634104185; cv=none; d=google.com; s=arc-20160816; b=ofcib9BlxPguYCsO5q1H4wBw7DiUnWrPN3xizShVOM0XciWlf3HDrbxkb+kk/ZMnZ8 HdSZf45Gk6w8GRjhzu3HXKVBCogz8c8X+w2f+grlN5WWRJyJ2m0LvXT66JTsuapBztn1 5OtxREMcitdHk4abdqBzJDp9f+qtqKqU7+s7fsTVQo0i41XnCtqwOzEyOJyz9UsDyHiL HmLLSUJcM//uMHkQOUNyI8IZBEm06vfJ019bnJS2q97I9HLxBeDgUMMZkd0mNU2G/I8R 4P7L1ozz+C6VVDNllIiitlgGrNTr4tQXrgawXREgZOVchiHdtanRHyHV44g7lNyXwCar e+Fw== 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=Vyix3XnNewPbitJtfxF/KE3HcfFXjFKv1GQk4gXWQ44=; b=DeTmbn8Ak1+wq68KArItKwyOhokcNRRRFtAc0slxXMpSsUeQ926lE2OkWhlJysXg4V H4+qmX3WPJ/4N22kScq6vzvyGls3GJo2OCZh3ZisR85PpipUwoy6J6sBqEmL4dzJ6H8I gIG/avnRw8rtCWoZp3DamJI2IIEX2okD5EgX0fUq50QV5bF5Qmt6rOad+Chz9azBHtnW jdI4nfO63d6IxuZVb+o9W5rs+g2DYJ1OCo1wuzppS1Vox3Dk1FuK2PsPRz6aTtQDrl6o lZvD6c/WLnsbt0EsCoSDtH9OtZnK9n3PWiKqN2AMP1IgPMbSDQeVkTNtKVa9G062t1eu DD1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mS1vt9+l; 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 de1si17475314edb.375.2021.10.12.22.49.22; Tue, 12 Oct 2021 22:49:45 -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=mS1vt9+l; 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 S237831AbhJMFvT (ORCPT + 99 others); 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-ext4@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