added kernel version check for calling kernel_read vs vfs_read
added kernel version check for calling kernel_read vs vfs_read, as suggested here:
55d5699429
This commit is contained in:
parent
6f98e76e0c
commit
0af5a76743
1 changed files with 5 additions and 1 deletions
|
|
@ -313,7 +313,11 @@ static ssize_t ashmem_read(struct file *file, char __user *buf,
|
||||||
* be destroyed until all references to the file are dropped and
|
* be destroyed until all references to the file are dropped and
|
||||||
* ashmem_release is called.
|
* ashmem_release is called.
|
||||||
*/
|
*/
|
||||||
ret = kernel_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)
|
if (ret >= 0)
|
||||||
/** Update backing file pos, since f_ops->read() doesn't */
|
/** Update backing file pos, since f_ops->read() doesn't */
|
||||||
asma->file->f_pos = *pos;
|
asma->file->f_pos = *pos;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue