summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-08-29 09:04:11 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 13:14:15 +0200
commita775ad97ce7720bf94a703008d611a007e4423b7 (patch)
treee39087c531c30f652a4c9b83d23880ab9cca71fe
parentf811fce3971f951bab0ac90a4283634f62343b81 (diff)
downloadlinux-stable-a775ad97ce7720bf94a703008d611a007e4423b7.tar.gz
linux-stable-a775ad97ce7720bf94a703008d611a007e4423b7.tar.bz2
linux-stable-a775ad97ce7720bf94a703008d611a007e4423b7.zip
fs: Export generic_fadvise()
commit cf1ea0592dbf109e7e7935b7d5b1a47a1ba04174 upstream. Filesystems will need to call this function from their fadvise handlers. CC: stable@vger.kernel.org Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--include/linux/fs.h2
-rw-r--r--mm/fadvise.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5186ac5b2a29..3b84dd5523a9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3544,6 +3544,8 @@ extern void inode_nohighmem(struct inode *inode);
/* mm/fadvise.c */
extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
int advice);
+extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
+ int advice);
#if defined(CONFIG_IO_URING)
extern struct sock *io_uring_get_socket(struct file *file);
diff --git a/mm/fadvise.c b/mm/fadvise.c
index 467bcd032037..4f17c83db575 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -27,8 +27,7 @@
* deactivate the pages and clear PG_Referenced.
*/
-static int generic_fadvise(struct file *file, loff_t offset, loff_t len,
- int advice)
+int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
{
struct inode *inode;
struct address_space *mapping;
@@ -178,6 +177,7 @@ static int generic_fadvise(struct file *file, loff_t offset, loff_t len,
}
return 0;
}
+EXPORT_SYMBOL(generic_fadvise);
int vfs_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
{