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 42B8FC433EF for ; Thu, 14 Oct 2021 06:28:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2580761029 for ; Thu, 14 Oct 2021 06:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbhJNGay (ORCPT ); Thu, 14 Oct 2021 02:30:54 -0400 Received: from verein.lst.de ([213.95.11.211]:48781 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbhJNGay (ORCPT ); Thu, 14 Oct 2021 02:30:54 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 5DA6768B05; Thu, 14 Oct 2021 08:28:44 +0200 (CEST) Date: Thu, 14 Oct 2021 08:28:44 +0200 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: Re: don't use ->bd_inode to access the block device size Message-ID: <20211014062844.GA25448@lst.de> References: <20211013051042.1065752-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013051042.1065752-1-hch@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-bcache@vger.kernel.org On Wed, Oct 13, 2021 at 07:10:13AM +0200, Christoph Hellwig wrote: > I wondered about adding a helper for looking at the size in byte units > to avoid the SECTOR_SHIFT shifts in various places. But given that > I could not come up with a good name and block devices fundamentally > work in sector size granularity I decided against that. So it seems like the biggest review feedback is that we should have such a helper. I think the bdev_size name is the worst as size does not imply a particular unit. bdev_nr_bytes is a little better but I'm not too happy. Any other suggestions or strong opinions?