On Sat, Apr 06, 2024 at 05:09:26PM +0800, Yu Kuai wrote: > From: Yu Kuai <yukuai3@xxxxxxxxxx> > > So that iomap and bffer_head can convert to use bdev_file in following > patches. Let me see if I got it straight. You introduce dummy struct file instances (no methods, nothing). The *ONLY* purpose they serve is to correspond to opened instances of struct bdev. No other use is possible. You shove them into ->i_private of bdevfs inodes. Lifetime rules are... odd. In bdev_open() you arrange for such beast to be present. You never return it anywhere, they only get accessed via ->i_private, exposing it at least to fs/buffer.c. Reference to those suckers get stored (without grabbing refcount) into buffer_head instances. And all of that is for... what, exactly?