From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 B5C295E095; Mon, 18 Mar 2024 23:22:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710804172; cv=none; b=m11bMA6e+vyJmsurDM3Jcv0rR11tFgPxr3fo9Pxl8QUMCRFj69GwY+2AOFPOs0djNi2LXncMg+f9fhVusEvhIaG8ENUC9augefVcGvPjuYkI7jhzBmwe8u7zCtt8TprbG2fbIyqYPjIcsUidaG7aTeRzydLsOM0QCdD5U5niiRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710804172; c=relaxed/simple; bh=HX7LG/+liOyF9Yphtpxw/AdVLRbvPxASNf7gfobkwRQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZKyGQmcSxJEmKBDwcAYNFpUIyM2Kmqqdom/7JTzRnzam9D/wgnnpEx9mAlXmZleRb2charNzkUXRFlmTf3LwTY5SlqlxJ5R2EnZ60U8iChalGmZHXSAUi66Kqngn6nzW/fmgWcV6xKq7BHtPnx8umP6FyYQPpRRYnBgmZr4e0iQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 6364068CFE; Tue, 19 Mar 2024 00:22:45 +0100 (CET) Date: Tue, 19 Mar 2024 00:22:45 +0100 From: Christoph Hellwig To: Yu Kuai Cc: Christoph Hellwig , jack@suse.cz, brauner@kernel.org, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, "yukuai (C)" Subject: Re: [RFC v4 linux-next 19/19] fs & block: remove bdev->bd_inode Message-ID: <20240318232245.GA17831@lst.de> References: <20240222124555.2049140-1-yukuai1@huaweicloud.com> <20240222124555.2049140-20-yukuai1@huaweicloud.com> <20240317213847.GD10665@lst.de> <022204e6-c387-b4b2-5982-970fd1ed5b5b@huaweicloud.com> <20240318013208.GA23711@lst.de> <5c231b60-a2bf-383e-e641-371e7e57da67@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Mar 18, 2024 at 03:19:03PM +0800, Yu Kuai wrote: > I come up with an ideal: > > While opening the block_device the first time, store the generated new > file in "bd_inode->i_private". And release it after the last opener > close the block_device. > > The advantages are: > - multiple openers can share the same bdev_file; > - raw block device ops can use the bdev_file as well, and there is no > need to distinguish iomap/buffer_head for raw block_device; > > Please let me know what do you think? That does sound very reasonable to me.