従来のファイルシステムは、VFS機能を実装するために構造体file_operations構造体を作成します。たとえば、ext4(Linux 4.0以前)の場合、の構造体file_operations ext4_file_operationsをnew_sync_readを指すようにします。新しいLinuxでは、ext4のどの機能が読み込みを担当していますか?
のLinux 4.0 /fs/ext4/file.c
const struct file_operations ext4_dax_file_operations = {
.read = new_sync_read,
.read_iter = generic_file_read_iter,
....
}
はしかし、Linux 4.1以降では、リードポインタのためのそのような割り当ては存在しないが、splice_readポインタが付加されます。
のLinux 4.1 /fs/ext4/file.c
const struct file_operations ext4_file_operations = {
.read_iter = generic_file_read_iter,
.splice_read = generic_file_splice_read,
...
}
しかし、 "/include/linux/fs.h" で定義されているたstruct file_operationsはまだリードポインタを持っています。ですから、ext4のどの機能が従来の読み取り機能を担っていますか?
これまでのバージョンではread_iterによって間接的に実装されていたように、従来のreadは新しいバージョンのread_iterによって直接実装されていると思います。これが正しければ、新しいバージョンのVFSの読み込みの役割は何ですか? – Akr