Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp822483pxb; Fri, 15 Oct 2021 17:18:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEGkCEPikoiiz3ON8JOKmV4DJv0laml108LYiM/pJt7Y+pXb1ycf80V6FQdFVgZT9twyyZ X-Received: by 2002:a05:6a00:855:b0:44d:4d1e:9080 with SMTP id q21-20020a056a00085500b0044d4d1e9080mr14788675pfk.66.1634343534627; Fri, 15 Oct 2021 17:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634343534; cv=none; d=google.com; s=arc-20160816; b=qL0BxFUBmhKMJZahlOGdRMCEDnoLJxMyG9BTY2F/eIx4yv9lE6IDxdseIbJKEWpz9e oFRNef3MuNdjgePJJR6VXMfmRPAcR1kGc4Y1r/zLjrfJsdU5B+xvhblEJMF2p2cXVhfi 40cryB+5985FCoTMjzlQnIND2EsxVZkZxT7Zh6DxX1jxBjUG6aCq96LiSKCWKCSVZtYW n3ivg/Ryg+89GMkQAnpU10nuYO0XiwdI+0K+ZxIOJcRt9Qvj/yGAaAmMqfghnOuPx7K6 zt+bwq8d6nw8KSBk9KtaJ4evbR9PIAeMN3OuU5t1aRk+hZU05M6UPyRfOXhrlyiKJ3Ne lQ+Q== 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=AcEX6OpFDERvfacKxgLT0Jy2T+5w2Rz/ks1kzajBMSE=; b=QWJL8b/ce8PT0vAgnsiYD/aK4fnOucy3Age4+ilF6INdmOC6jyJ8PSwlzu5TEu8i7N gW4wzCqslicM1skdoAs/s4W4qX+CssjCbSlP/B5SJtTL+DCVVJyYv6yPrJyQQt/QxB// ips4+nyOglm6aoeNmrhTgtFTcw8HPvrxwuwBCLpe/YkBxxNqGXqWLWtMcBdOlJtkV5ZN apD/yeNgXGSPRjX2zwQ6piXeDU9JsTUKd/O05/G+TM/m1S8Sq2th0VJiRfDg3U2tI2AT pfzznSmNmdepLeLasLe8MkkIjixko/nvIx56/PfV9LzLmXPCQgJ9SqP0/j0S/EnZ+JJ+ Diog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=HfrK1GIc; 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 x3si9441341pgp.147.2021.10.15.17.18.41; Fri, 15 Oct 2021 17:18:54 -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=bombadil.20210309 header.b=HfrK1GIc; 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 S239606AbhJONa4 (ORCPT + 99 others); Fri, 15 Oct 2021 09:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239613AbhJON34 (ORCPT ); Fri, 15 Oct 2021 09:29:56 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 671BFC061570; Fri, 15 Oct 2021 06:27:36 -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=AcEX6OpFDERvfacKxgLT0Jy2T+5w2Rz/ks1kzajBMSE=; b=HfrK1GIcSpNTBGSg2LI4ERqY2S W+i7Xbd8j9znkMdl1J268MRsqcN335wRXFVmMZlzEgW+QCvzZ8KfZnVNaeGdLDrWfTXt0em7TOeic Uld3vieJNiglw95gjDQZmu7ul+FrWm8JwOv3gM7ZiocCPmj1/u4C/AA0J4KfbPwQ1IveNlzZ5f6Yw lzgJa4BKZxfTFpLI0dlUmEe3tere8eUaQeuHnZIDFimilsqhMFzf7hS5AZX/1khYRxt4crf0R8V84 dJPLv84JRFlFes8pOMQFQxBJe/yu+u8O33FgTLMrkG0ZFLE5v0PtrmKL7gPQtj5w11MN0fq2EwkRl 3AKFl1tw==; Received: from [2001:4bb8:199:73c5:ddfe:9587:819b:83b0] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbNF1-007D5b-QU; Fri, 15 Oct 2021 13:27: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-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 13/30] cramfs: use bdev_nr_bytes instead of open coding it Date: Fri, 15 Oct 2021 15:26:26 +0200 Message-Id: <20211015132643.1621913-14-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211015132643.1621913-1-hch@lst.de> References: <20211015132643.1621913-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 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/cramfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 2be65269a987c..666aa380011e0 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -209,7 +209,7 @@ static void *cramfs_blkdev_read(struct super_block *sb, unsigned int offset, return read_buffers[i] + blk_offset; } - devsize = mapping->host->i_size >> PAGE_SHIFT; + devsize = bdev_nr_bytes(sb->s_bdev) >> PAGE_SHIFT; /* Ok, read in BLKS_PER_BUF pages completely first. */ for (i = 0; i < BLKS_PER_BUF; i++) { -- 2.30.2