Add support for kernel 4.14 (#61)

* Add support for kernel 4.14

'vfs_read' is no longer exported (see kernel commit
https://github.com/torvalds/linux/commit/bd8df82be6).

Update .travis.yml with newer kernels
This commit is contained in:
Christian Pommranz
2017-11-13 14:39:14 +01:00
committed by Carlos Garcés
parent 2eb28be744
commit 49a0fb5020
4 changed files with 40 additions and 10 deletions

View File

@@ -1910,10 +1910,12 @@ static int readFile(struct file *fp,char *buf,int len)
return -EPERM;
while(sum<len) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
rlen = __vfs_read(fp, buf+sum, len-sum, &fp->f_pos);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
rlen = kernel_read(fp, buf + sum, len - sum, &fp->f_pos);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos);
#else
rlen = fp->f_op->read(fp, buf+sum, len-sum, &fp->f_pos);
rlen = fp->f_op->read(fp, buf + sum, len - sum, &fp->f_pos);
#endif
if(rlen>0)
sum+=rlen;