Merge pull request #504 from sarangnemo/master
replace deprecated vfs_read with kernel_read
This commit is contained in:
commit
b21e5d9313
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue