Skip to content

Commit

Permalink
fs: Export generic_fadvise()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jankara authored and djwong committed Aug 31, 2019
1 parent 692fe62 commit cf1ea05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3531,6 +3531,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);
Expand Down
4 changes: 2 additions & 2 deletions mm/fadvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit cf1ea05

Please sign in to comment.