Merge pull request #504 from sarangnemo/master

replace deprecated vfs_read with kernel_read
This commit is contained in:
Simon Fels 2018-01-23 07:44:37 +02:00 • committed by GitHub
commit b21e5d9313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -312,8 +312,14 @@ static ssize_t ashmem_read(struct file *file, char __user *buf,
* once asma->file is set it will never be changed, and will not
* be destroyed until all references to the file are dropped and
* ashmem_release is called.
*
* kernel_read supersedes vfs_read from kernel version 3.9
*/
ret = __vfs_read(asma->file, buf, len, pos);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
ret = __vfs_read(asma->file, buf, len, pos);
#else
ret = kernel_read(asma->file, buf, len, pos);
#endif
if (ret >= 0)
/** Update backing file pos, since f_ops->read() doesn't */
asma->file->f_pos = *pos;