I have an old kernel module, which assigns my my_readdir
function to file_operations::readdir
. I would like to update my module to be compatible with 6.X kernels. I’ve already fixed issues with the arguments of .create
and .mkdir
.
On https://www.kernel.org/doc/html/latest/filesystems/locking.html#file-operations it talks about file_operations::readdir
moving. It is not in file_operations
on that page, so I assume that the comment below is stale.
->readdir() and ->ioctl() on directories must be changed. Ideally we would move ->readdir() to inode_operations and use a separate method
for directory ->ioctl() or kill the latter completely. One of the
problems is that for anything that resembles union-mount we won’t have
a struct file for all components. And there are other reasons why the
current interface is a mess…
readdir()
didn’t go to inode_operations
: https://elixir.bootlin.com/linux/v6.8.7/source/include/linux/fs.h#L2035
How do I tell a modern 6.X kernel about my module’s my_readdir
function, which I used to do by assigning it to file_operations::readdir
?
2