Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2837899rdh; Sun, 26 Nov 2023 23:10:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmLdtTopXq76D5nHq6dCTEZvZ6h6hnuB10n92g0fls6ZUS+X8CRDWcyQxNGYNdswqswsrP X-Received: by 2002:a05:6e02:170e:b0:357:a049:91c4 with SMTP id u14-20020a056e02170e00b00357a04991c4mr7189062ill.22.1701069027745; Sun, 26 Nov 2023 23:10:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701069027; cv=none; d=google.com; s=arc-20160816; b=oU7RE6+1AbuFQa1aSTBBGfFYao2UAersu+yV4ItT9B0dwB2P6SjJt1ghuub6eyxI1I p2MHHuOv1MfmH73cvBJeF6MH3CpgMO9MOI3RIE+N9GSCgR9xWMDY7ofxit0KU5sHxbpT iWKH2QiGBxyxMvc5fANcoyU6MfOyt0X/2DcEZGrUtuCNclLVHgL0/vP4Ftntlf1+lHYX sgKQJeaREevKDfpbFz0MEHOVSzh8jH0kGCh3MS/Sk0pb+hm3WoYy//vf4+P0/ERK+wdr KTB89obIaygDjDST3XO5xPZzQUWRqXZXZ9h6nrDPfMhOkVk0E4PguCF0O6yKXClvDaYl zMuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=XPf2AtiwQ2FQ0ccJ0Z/7TTlcwI3rp+w7qwo94ih5ipc=; fh=xEwhtycjGGcypgimylg3lbVWoqulv1a7ajK43MCOBLE=; b=Idmysu3iPA70nHU0agbBAfD/wCvBLvsIN4+xTTb2g2cJGBDebLe6iMa49gKIlzARlq ILks4vePPiXhCiniJzDITnnN6tNZCK17kjih9kojaihEA2bNPJlGSoW4FpcFIROYFvjR mhHn7RgnhI1AcDKp08CRwnnLIemimldzhmOhMv9Y1rWvjTupjzZz2e/GkvCTJXPRzOZ0 WBCwJXnU74ojikJ7QOGVdkD9X1Ya72Q+razSCN+bIcAt3y/FQyvPxPFkZ7jJsQeu1FKG 7om1OZERuTKY/FImXNHwfsRrntlDHgMyc55uSJJ9+RK4YG/90u554YFYnPMvHN4aimiT 95+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VRPuFgHz; spf=pass (google.com: domain of linux-ext4+bounces-191-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-191-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bm27-20020a656e9b000000b005b91192c628si9744714pgb.369.2023.11.26.23.10.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 23:10:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-191-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VRPuFgHz; spf=pass (google.com: domain of linux-ext4+bounces-191-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-191-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E3BD1B209A4 for ; Mon, 27 Nov 2023 07:10:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B3A6101C2; Mon, 27 Nov 2023 07:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VRPuFgHz" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41A38FBEE; Mon, 27 Nov 2023 07:09:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 996CFC433C7; Mon, 27 Nov 2023 07:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701068997; bh=rnicohsvfFaSTeb42azhK+SpajDI1T+vJboqkZ88aAw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=VRPuFgHzyDdTKsrT6v2s4trEAs1zQA4cvx634pNpuoQtKkSCdvaCJbelneF1Ip3l4 3R2XpX9ULxFTLpvYZKC+OlVq1tQIg76lPle5uK1IXkDVPKpxfksILf6SRdY2YXiVx8 +7dKkjw2ixB7N6vQIrVxt9xKL7YlIHvL3xsDc8NMjznTj873bGKZp7GuQibnlnSWQy ysSVDOissl1B8bF0lV/M0VJ7ULdDRCNYUqiH8Y50kpQs3OK75m1qeIPmc8MbFbLlTF UDMB8ntMGz+OWj0fdv08z2PCWBrrlD9/8Y+uzFUqcbmYmX6+lodrokeIPhbDBGbkVC Bn0mDn1QrfPEw== Message-ID: Date: Mon, 27 Nov 2023 16:09:47 +0900 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH block/for-next v2 07/16] bcachefs: use new helper to get inode from block_device To: Yu Kuai , hch@infradead.org, ming.lei@redhat.com, axboe@kernel.dk, roger.pau@citrix.com, colyli@suse.de, kent.overstreet@gmail.com, joern@lazybastard.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, sth@linux.ibm.com, hoeppner@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, jejb@linux.ibm.com, martin.petersen@oracle.com, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, viro@zeniv.linux.org.uk, brauner@kernel.org, nico@fluxnic.net, xiang@kernel.org, chao@kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, agruenba@redhat.com, jack@suse.com, konishi.ryusuke@gmail.com, dchinner@redhat.com, linux@weissschuh.net, min15.li@samsung.com, yukuai3@huawei.com, willy@infradead.org, akpm@linux-foundation.org, hare@suse.de, p.raghav@samsung.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, gfs2@lists.linux.dev, linux-nilfs@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com References: <20231127062116.2355129-1-yukuai1@huaweicloud.com> <20231127062116.2355129-8-yukuai1@huaweicloud.com> Content-Language: en-US From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20231127062116.2355129-8-yukuai1@huaweicloud.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/27/23 15:21, Yu Kuai wrote: > From: Yu Kuai > > Which is more efficiency, and also prepare to remove the field > 'bd_inode' from block_device. > > Signed-off-by: Yu Kuai > --- > fs/bcachefs/util.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h > index 2984b57b2958..fe7ccb3a3517 100644 > --- a/fs/bcachefs/util.h > +++ b/fs/bcachefs/util.h > @@ -518,7 +518,7 @@ int bch2_bio_alloc_pages(struct bio *, size_t, gfp_t); > > static inline sector_t bdev_sectors(struct block_device *bdev) > { > - return bdev->bd_inode->i_size >> 9; > + return bdev_inode(bdev)->i_size >> 9; shouldn't this use i_size_read() ? I missed the history with this but why not use bdev_nr_sectors() and delete this helper ? > } > > #define closure_bio_submit(bio, cl) \ -- Damien Le Moal Western Digital Research