4 ms·
One 'silly' question from this novice linux kernel driver developer: if the ->read() and ->write() operations in the Linux kernel file operations structure go a
by sohkamyung 2y ago
One 'silly' question from this novice linux kernel driver developer: if the ->read() and ->write() operations in the Linux kernel file operations structure go away, then what happens to read() and write() from user space? Which file operations do those call trigger in the kernel driver?
- dave4420 2y agoI thought it said ->read_iter() and ->write_iter()?
- sohkamyung 2y agoFrom the end of the article: "The final patch in the series removes read() and write() with a surprising lack of ceremony, given that they have been there for 32 years."
- gary_0 2y agoThe userspace read() and write() syscalls aren't the same thing as read()/write() in file_operations. Presumably the syscalls will be updated to use the new _iter operations. In fact, the syscalls already support f_op->read_iter/write_iter, so the code using the legacy f_op->read/write just needs to be removed. See the linux source code links below: vfs_read: https://elixir.bootlin.com/linux/latest/source/fs/read_write.c#L456 https://elixir.bootlin.com/linux/latest/source/fs/read_write... vfs_write: https://elixir.bootlin.com/linux/latest/source/fs/read_write.c#L570 https://elixir.bootlin.com/linux/latest/source/fs/read_write... Those functions are called by sys_read/sys_write, which are the functions implementing the syscalls (all the code is in fs/read_write.c).