Re: [PATCH 5/9] block: introduce holder ops

Christoph Hellwig
2023-05-18T13:13:45Z

On Thu, May 18, 2023 at 10:13:04AM +0200, Christian Brauner wrote:
> Fwiw, I didn't mean to have a special device handler for an O_PATH fd.
> I really just tried to figure out whether it would make sense to have an
> fd-based block device lookup function because right now we only have
> blkdev_get_by_path() and we'd be passing blkdev fds through the mount
> api. But I understand now how I'd likely do it. So now just finding time
> to actually implement it.

What's wrong with blkdev_get_by_dev(file_inode(file)->i_rdev) after
the sanity checks from lookup_bdev (S_ISBLK and may_open_dev)?