"vfs_read undefined" warning when building the kernel module for kernel 4.14
Apparently vfs_read was deprecated in favour of kernel_read in kernel 4.14. vfs_read still exists but it's not exported. kernel_read wraps vfs_read and the associated code. See fs/read_write.c in the kernel source.
The module can be fixed by changing your file_read function in driver/gps-pps-io.c to the following:
(the same solution has been used by various projects)
int file_read(struct file* file, unsigned long long offset, unsigned char* data, unsigned int size) {
int ret;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
mm_segment_t oldfs;
oldfs = get_fs();
set_fs(get_ds());
ret = vfs_read(file, data, size, &offset);
set_fs(oldfs);
#else
ret = kernel_read(file, data, size, &offset);
#endif
return ret;
}
The above also requires #include <linux/version.h>
Apologies for not providing a pull request but you may prefer a different solution to #ifdef. Unfortunately, kernel_read has only had its current parameters since September 2017.
"vfs_read undefined" warning when building the kernel module for kernel 4.14
Apparently
vfs_read
was deprecated in favour ofkernel_read
in kernel 4.14.vfs_read
still exists but it's not exported.kernel_read
wrapsvfs_read
and the associated code. See fs/read_write.c in the kernel source.The module can be fixed by changing your
file_read
function indriver/gps-pps-io.c
to the following: (the same solution has been used by various projects)The above also requires
#include <linux/version.h>
Apologies for not providing a pull request but you may prefer a different solution to
#ifdef
. Unfortunately,kernel_read
has only had its current parameters since September 2017.Thanks for your code and the impressive docs.