Hi,
在 2024/03/18 9:32, Christoph Hellwig 写道:
On Mon, Mar 18, 2024 at 09:26:48AM +0800, Yu Kuai wrote:
Because there is a real filesystem(devtmpfs) used for raw block devcie
file operations, open syscall to devtmpfs:
blkdev_open
bdev = blkdev_get_no_open
bdev_open -> pass in file is from devtmpfs
-> in this case, file inode is from devtmpfs,
But file->f_mapping->host should still point to the bdevfs inode,
and file->f_mapping->host is what everything in the I/O path should
be using.
Then later, in blkdev_iomap_begin(), bd_inode is passed in and there is
no access to the devtmpfs file, we can't use s_bdev_file() as other
filesystems here.
We can just pass the file down in iomap_iter.private
I can do this for blkdev_read_folio(), however, for other ops like
blkdev_writepages(), I can't find a way to pass the file to
iomap_iter.private yet.
Any suggestions?
Thanks,
Kuai
.