Skip to content

Commit a775ad9

Browse files
jankaragregkh
authored andcommitted
fs: Export generic_fadvise()
commit cf1ea05 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>
1 parent f811fce commit a775ad9

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎include/linux/fs.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,6 +3544,8 @@ extern void inode_nohighmem(struct inode *inode);
35443544
/* mm/fadvise.c */
35453545
extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
35463546
int advice);
3547+
extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
3548+
int advice);
35473549

35483550
#if defined(CONFIG_IO_URING)
35493551
extern struct sock *io_uring_get_socket(struct file *file);

‎mm/fadvise.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
* deactivate the pages and clear PG_Referenced.
2828
*/
2929

30-
static int generic_fadvise(struct file *file, loff_t offset, loff_t len,
31-
int advice)
30+
int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
3231
{
3332
struct inode *inode;
3433
struct address_space *mapping;
@@ -178,6 +177,7 @@ static int generic_fadvise(struct file *file, loff_t offset, loff_t len,
178177
}
179178
return 0;
180179
}
180+
EXPORT_SYMBOL(generic_fadvise);
181181

182182
int vfs_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
183183
{

0 commit comments

Comments
 (0)