Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3127047pxb; Tue, 12 Oct 2021 22:34:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEjLT5Cf3T5gab1dKjw19JmFSaByOMaWWMGGhvn4VKZGLw9tg1tDXlXe3VTzgN0wO26Clg X-Received: by 2002:a50:d9c9:: with SMTP id x9mr6480451edj.179.1634103256802; Tue, 12 Oct 2021 22:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634103256; cv=none; d=google.com; s=arc-20160816; b=nOjlHgVK5Gh7qQpjTiCr4612MuB4duYpBSV4FdqcJ/03Sc0q/5TBBfyHjkLRWXhnAQ y1DdxC7vaMkQcOlihQzLVF01Xb3j/T4eqB6n/YZmCZDm6ntauyjFD2xuQ+/ek3smXF7i uNFaFJClTy/O37oN2akGy1HQYbgU3VgWSXKaKdr+W66+j/x6IrrzJCPGxZHLDVNZjGEB X/xx0Wqrijjl4u4I8hBOLU5wWQHXDkv4G1dcnPbgteTlTPCU1pXSkO4KkYxCsE9u17yj Lk7H5X4I4wSiFRINvFlbFrDg4skfJJhIzgtHDyksrT1qgwd9FlKgY/ihZ4O95RHZO+G1 pd/g== 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=39HaYm26ck1Q/qs4DL8qNMVTN9Lr6ailLQ9qlOsD13M=; b=A8+jb9fWYJ9RKPMEbiKrT7UKZLOjX3AZbNJHZYgJCHod3+KfTdntwqd4TN+BcURjXY xXvdHlN4N9U/fdWhK7EvwXLQKahZD/wlZGpAQMGhEFqciVJOKwNpPmI7A6G3ZJm5hRB6 7NZSIKMNnwtVUskZl9/Lt2PcX1cZs/H+A7xOqe+mokmwefCKwy6OejZxfgSP/9SeH8s5 mJW+2OW5TKxh+eU37gkootePTlLwTK5wwGbRVvCa6A86h7AcQWKOI0GxTyJ/5YeYUe0Z ezrCUv1cBUdEndGV6tIUzbx2cbyPAxqiuO97ay2RBDoWHGhyb0GtmVQo9aeSbjqXvaqE QOmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=aHtBe1dA; 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 w9si1246297edd.166.2021.10.12.22.33.53; Tue, 12 Oct 2021 22:34:16 -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=aHtBe1dA; 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 S229990AbhJMFfz (ORCPT + 99 others); Wed, 13 Oct 2021 01:35:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJMFfy (ORCPT ); Wed, 13 Oct 2021 01:35:54 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E48B2C061570; Tue, 12 Oct 2021 22:33:51 -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=39HaYm26ck1Q/qs4DL8qNMVTN9Lr6ailLQ9qlOsD13M=; b=aHtBe1dA8jDL6nkYC2gqw40U9v J2fj1CwwPytuisPEPT+QqIPqcQL8qeP8ILip+Ab7OKF8Cx1l6cNtRM/EKOEIlwVPeU2yAnCydCn02 5u1wUYf1tItlO+Foc4rbLhqVkm8H5CK71rLqliO7JH8trcJ02f6RyBGKMz31rFqWdXkW1y9L+sahA XT3nV+TPR5tCHZkQ1sh73RyDt4oqzC4ySRvveksjUfsWkiF3PDnWxnnnZEAmJmGo7foAgtHOJFrc0 9y30dbLL2dRtoiGyPWTr1JTuXiPxu5Toub70OO8IJovwwh2Mk+WsF1BpUNv2XXzXuIZ3LugovSGBs QWI9O5nQ==; 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 1maWpv-0077O7-6w; Wed, 13 Oct 2021 05:30:20 +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 17/29] nfs/blocklayout: use bdev_nr_sectors instead of open coding it Date: Wed, 13 Oct 2021 07:10:30 +0200 Message-Id: <20211013051042.1065752-18-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 proper helper to read the block device size. Signed-off-by: Christoph Hellwig --- fs/nfs/blocklayout/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c index acb1d22907daf..42772985cb43e 100644 --- a/fs/nfs/blocklayout/dev.c +++ b/fs/nfs/blocklayout/dev.c @@ -252,7 +252,7 @@ bl_parse_simple(struct nfs_server *server, struct pnfs_block_dev *d, d->bdev = bdev; - d->len = i_size_read(d->bdev->bd_inode); + d->len = bdev_nr_sectors(d->bdev) << SECTOR_SHIFT; d->map = bl_map_simple; printk(KERN_INFO "pNFS: using block device %s\n", @@ -367,7 +367,7 @@ bl_parse_scsi(struct nfs_server *server, struct pnfs_block_dev *d, return PTR_ERR(bdev); d->bdev = bdev; - d->len = i_size_read(d->bdev->bd_inode); + d->len = bdev_nr_sectors(d->bdev) << SECTOR_SHIFT; d->map = bl_map_simple; d->pr_key = v->scsi.pr_key; -- 2.30.2