From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: don't use ->bd_inode to access the block device size v3 Date: Mon, 18 Oct 2021 19:49:01 +0200 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 Return-path: Content-Disposition: inline In-Reply-To: <2f5dcf79-8419-45ff-c27c-68d43242ccfe@kernel.dk> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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.ke 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.