From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24BA4C433F5 for ; Mon, 18 Oct 2021 17:57:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D72E060F0F for ; Mon, 18 Oct 2021 17:57:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D72E060F0F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m4iEGbscF67yNO4NRuzcQmEmbPSlh65Fo1hYQ3vpXzc=; b=MYsweL8S5kG1Gp7/NkEDiejum5 lOAurwDXkL5N5PXddoDDUN1ERzPGl24KglCSUof16DItLTHGMwQcnsTdDuAhm/ip72XpiOhxQUouW cCmlLPZfSuHU4i+aWRA7iilCp705SUTYWeBvd5tm52qOiSyRpN8D2ZYrrf53X+gcbGPp24gbdoNKn 7ITgfyRAueoavNW1uHhvId/ynoEMW+mLR2Lgnjt5xmYJ7FKSys7t659E9m/FqKbp3KkNEgE/6nlYA ocBstNCmCll6+2Ho6ViJujZOJYkeMYihRLRYKLl2Kilz7djvaPPKvH+60MhpSczIT0eY6C+Rq0ws0 B3d4dcNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcWsr-00GjCB-Sr; Mon, 18 Oct 2021 17:57:13 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcWky-00GhIZ-Rh for linux-nvme@lists.infradead.org; Mon, 18 Oct 2021 17:49:06 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 67F2A68BFE; Mon, 18 Oct 2021 19:49:01 +0200 (CEST) Date: Mon, 18 Oct 2021 19:49:01 +0200 From: Christoph Hellwig To: Jens Axboe Cc: Christoph Hellwig , 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: Re: don't use ->bd_inode to access the block device size v3 Message-ID: <20211018174901.GA3990@lst.de> References: <20211018101130.1838532-1-hch@lst.de> <4a8c3a39-9cd3-5b2f-6d0f-a16e689755e6@kernel.dk> <20211018171843.GA3338@lst.de> <2f5dcf79-8419-45ff-c27c-68d43242ccfe@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f5dcf79-8419-45ff-c27c-68d43242ccfe@kernel.dk> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_104905_065201_156B0C90 X-CRM114-Status: GOOD ( 11.10 ) X-Mailman-Approved-At: Mon, 18 Oct 2021 10:57:13 -0700 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Mon, Oct 18, 2021 at 11:40:51AM -0600, Jens Axboe wrote: > static inline loff_t bdev_nr_bytes(struct block_device *bdev) > { > - return i_size_read(bdev->bd_inode); > + return bdev->bd_nr_sectors; This hunk needs to go into bdev_nr_sectors, and the bdev_nr_bytes probably wants to call bdev_nr_sectors and do the shifting.