Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp986708pxb; Fri, 15 Oct 2021 22:16:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlSj1Zrb7yIEEc2A+pL2r7Q0WWzTNmd3G1ne7Xj/qIoIzY2aEz+aMjOO3zaNBvi8cag594 X-Received: by 2002:aa7:cfcd:: with SMTP id r13mr23587290edy.350.1634361409701; Fri, 15 Oct 2021 22:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634361409; cv=none; d=google.com; s=arc-20160816; b=qH1yKFh9Ikp5KQ2DIKLeiE+QuS9qNebBZEXny4CjTHmgRNH+myo9iV5TQHfHaAZHx/ ynJc3/8j1+2Jiof9j9eMShhlTtKUL44aTnD4kfZSuc765T/sJcEGlheOqean+TfjBXjb g6G6tiWJnfAX8CHQx8/d7EkCircOIAeWDTlVU5928QYoFSUHlMd/aIKtDlCk6Bo5zmlv vM5Ka6KW7rIric/WGSgJa9NwK+z8wvc85pm+2KUokeF5oa1It/jVJ/36hEEcIYLD5aXT oTq0uglEy7URfqXisN2uhTWETGxt3aFEXhdZD9MBq5G3L0vYUP8BeMh/vc7bLwDuoPTq frAg== 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=GSq2C7pgVoGuR+Arylph0pMkFwVZUJHKN+FvKz1CARs=; b=AKU+9SdMmerOQTRl93bJwfF6V7d1QLvjvprabc3fBVYCqjRg77XfFvtUlUEkzSAuY3 /Fe5oUH9JXLC3FO/3pCKK0UHVgj9vVqDeo04QIm9da7Jd8alb+5Nhqvdb+pMOOBtApLp nZPVnhzE5NAgNue1YLyq1IBlC4EhDNh+w0FA9Z0GGo2WMHjt2rlbmyBSzqWg0/ZgsRKE 2FxLwdZ0/Y70qVWUwWwPPJZ/Ncp0tH7D8uOF83+RT3cifx6ZV8I3NF94w6Db31bz1nh6 lNU0NOLSZY6m5t+eQVMdgJ2InClTCORSuUpKna12/T0BdE9bc4FaJLjMhyFRm66Tb5Qc iusw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=qlzziWpR; 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 g13si14880670edz.599.2021.10.15.22.16.18; Fri, 15 Oct 2021 22:16:49 -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=qlzziWpR; 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 S235003AbhJONda (ORCPT + 99 others); Fri, 15 Oct 2021 09:33:30 -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 S236418AbhJONb4 (ORCPT ); Fri, 15 Oct 2021 09:31:56 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E1FC061782; Fri, 15 Oct 2021 06:28:09 -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=GSq2C7pgVoGuR+Arylph0pMkFwVZUJHKN+FvKz1CARs=; b=qlzziWpRLzPlcQ8+KrbJ1klG8P tEb+7jaXNB4pXHBlQr+oBUv/PSIXRu0c7AYzHRdaYCbENng4sYsqCxDHJ1GM+aCIHXV9tICBrpDMI +fIfBUif1MVIPskFqWKR2mEJ5l4AfrzCUfiAgGPrgyCcaP5JSAF1+LyVweTjlqIvOgo5R5mZswdCw lvNpmeqkoxbn0mhzobmasSs5zM8KL/UVuoJqfIZRsUj6+I7dLoBLpNZlBnrTZ90CrsN3i/3ASfVSo u3TsKbP0JkJJTk7Y3koBdaJK3BJ7DHPHPte9e3MwQS9jKSyFyY+TjH/SOkz5cTB2HhwoCcNJDjAd9 WJhhks/w==; 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 1mbNFc-007Dll-0k; Fri, 15 Oct 2021 13:27:56 +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 27/30] jfs: use sb_bdev_nr_blocks Date: Fri, 15 Oct 2021 15:26:40 +0200 Message-Id: <20211015132643.1621913-28-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 sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- fs/jfs/resize.c | 3 +-- fs/jfs/super.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c index a42dbb0d3d28a..8b9a72ae5efa7 100644 --- a/fs/jfs/resize.c +++ b/fs/jfs/resize.c @@ -86,8 +86,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) goto out; } - VolumeSize = i_size_read(sb->s_bdev->bd_inode) >> sb->s_blocksize_bits; - + VolumeSize = sb_bdev_nr_blocks(sb); if (VolumeSize) { if (newLVSize > VolumeSize) { printk(KERN_WARNING "jfs_extendfs: invalid size\n"); diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 9241caa161163..24cbc9946e01c 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -284,8 +284,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize, } case Opt_resize_nosize: { - *newLVSize = i_size_read(sb->s_bdev->bd_inode) >> - sb->s_blocksize_bits; + *newLVSize = sb_bdev_nr_blocks(sb); if (*newLVSize == 0) pr_err("JFS: Cannot determine volume size\n"); break; -- 2.30.2