Search code examples
linuxkernelsystemtap

equivalence of pread in linux kernel space (with O_DIRECT)


I am working with systemtap probe which is in linux kernel space and so I can't use the regular pread syscall. Is there a equivalence of pread syscall in kernel space?

my friend found this: http://lxr.free-electrons.com/source/fs/read_write.c?v=2.6.32#L433 but what is the header file that I need to include?

Thanks!

Erben


Solution

  • The pread system call is actually calling vfs_read(), so you can use vfs_read() in the kernel space.

    vfs_read is an exported symbol and you don't need to include any header file.