Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3117814pxb; Tue, 12 Oct 2021 22:16:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz375jutyhhvAn+fnyxjrBfg20Hzz1qWjQuYMpoagYYrKQU34JFLHSCSTIUXzsqOCmTWi6z X-Received: by 2002:a17:902:d904:b0:13f:398e:a0df with SMTP id c4-20020a170902d90400b0013f398ea0dfmr15271918plz.47.1634102187312; Tue, 12 Oct 2021 22:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634102187; cv=none; d=google.com; s=arc-20160816; b=gwlkpR6HA9YCegF4qFLtW8gtthjIMwf2W7bB90USYLfg12g3G5qicW7JcY1AbTBSwJ +6DtSLMBonXOgKaDPmwxZglLI5kBMgx5D7PpnUfMdCbBtBsCKloLqpoHCNsIUEvXVYLg DWsQAk/4wUn1Jl2xmlpHQ+yDcUEn6+raPoeSAiWiusiAXE7elsqC/JhFhB/yjdhmZUcN ++aQ0eaiqpA+iY3eMREavjEH+NLr7VCe8Y5OSU7BJfO5IDQDxx84dM8maZ8xrEV2sBdQ moXtKpT+P03+3x+HVMos3JEuHYP7rka2016s/Qsl6/+nvOrFsM8JYreO05KxEuzBvnis NKmA== 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=g8zwkRt9/f1ewG9ciisUGRCziOVySw93pi5vyPemNAI=; b=obLbsoW0g6fZCNzMvg3Pe/XbSenuNamRZ05zBBuL5Mduzn9vk2UxG2jlCWObgSR342 zS93XW4qBii61PIL3+ocuoaY8ycWbjzku/mY+Q7t4gGdmEEAF/4JOUrRO+e734Edrz5a JshMCasm3lBnFevfh5zE5ibEQiQO/dRTX0Oj4yVjoS9jHRDBS5kKwEdxtTzSlo1nAFBD ekh+bd/gJL14LumLaeaVZXe2fdWZ2kjv5YI0Gcyt+CD40lqCdJX7/K/pSxCWuga3InAg LVTJQXJUvK9W0KDkQtGyCwvXX/Sqp2Dqaoae3owLLPEmg4AG/gXXCB8UpWi4X1AzgaJj urdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nWIotL3Q; 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 y3si6804072pjv.179.2021.10.12.22.16.13; Tue, 12 Oct 2021 22:16:27 -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=nWIotL3Q; 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 S229726AbhJMFSL (ORCPT + 99 others); Wed, 13 Oct 2021 01:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbhJMFSK (ORCPT ); Wed, 13 Oct 2021 01:18:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18318C061570; Tue, 12 Oct 2021 22:16:07 -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=g8zwkRt9/f1ewG9ciisUGRCziOVySw93pi5vyPemNAI=; b=nWIotL3QSRoDmvAA3o9BLxIx6i t4tgYxkL2iWa6feU3mcKjViBgV628kEI3j5cp2HTfHI5qbb5tmwpSC/812qJ+tIpOC0+6ZXF0Yhk1 5/9uLY7Z9un8Zx+wYevMd9WgJEXEPd+jf99pZpD/NqPCzIY0yzkTDeFs/A7NObgO/TsPUlUm00azm jzgcK41A7UnRgzQeKy8vk7Tjr/8htqPY0cCKS9erTgbsPAmZcQk05o5++x3yiFcAox9+NsbnoYLD2 XgiNG4Ra1ckwDmXmBiQEy6lDOHyfYSyUX1y5l6wMULdMarhxHkj1ybNbPpIss3/EZnwhnweR8ESQO YWkbaoTA==; 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 1maWZ8-0075yH-Vb; Wed, 13 Oct 2021 05:12:50 +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 02/29] drbd: use bdev_nr_sectors instead of open coding it Date: Wed, 13 Oct 2021 07:10:15 +0200 Message-Id: <20211013051042.1065752-3-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 --- drivers/block/drbd/drbd_int.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 5d9181382ce19..75fda53eed8cf 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -1826,8 +1826,7 @@ static inline sector_t drbd_md_last_sector(struct drbd_backing_dev *bdev) /* Returns the number of 512 byte sectors of the device */ static inline sector_t drbd_get_capacity(struct block_device *bdev) { - /* return bdev ? get_capacity(bdev->bd_disk) : 0; */ - return bdev ? i_size_read(bdev->bd_inode) >> 9 : 0; + return bdev ? bdev_nr_sectors(bdev) : 0; } /** -- 2.30.2