]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: implement readahead(2) using POSIX_FADV_WILLNEED
authorAmir Goldstein <amir73il@gmail.com>
Wed, 29 Aug 2018 05:41:29 +0000 (08:41 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 30 Aug 2018 18:01:32 +0000 (20:01 +0200)
commit79a99169767000719fba4eb50393ce3a264263be
treef7f5c2be4f572892747e47c9fc1001e86f74ca61
parent0911ed78b272f0ef6ee9a1eb549926fb11793eb3
vfs: implement readahead(2) using POSIX_FADV_WILLNEED

The implementation of readahead(2) syscall is identical to that of
fadvise64(POSIX_FADV_WILLNEED) with a few exceptions:
1. readahead(2) returns -EINVAL for !mapping->a_ops and fadvise64()
   ignores the request and returns 0.
2. fadvise64() checks for integer overflow corner case
3. fadvise64() calls the optional filesystem fadvise() file operation

Unite the two implementations by calling vfs_fadvise() from readahead(2)
syscall. Check the !mapping->a_ops in readahead(2) syscall to preserve
documented syscall ABI behaviour.

Suggested-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 9e28c8f24d7a ("ovl: stack file ops")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
mm/Makefile
mm/fadvise.c
mm/readahead.c