Skip to content

Commit

Permalink
mm: export filemap_check_errors() to modules
Browse files Browse the repository at this point in the history
Can be used by fuse, btrfs and f2fs to replace opencoded variants.

Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
Miklos Szeredi committed Jul 29, 2016
1 parent 9446385 commit d72d9e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,7 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
loff_t start, loff_t end, int sync_mode);
extern int filemap_fdatawrite_range(struct address_space *mapping,
loff_t start, loff_t end);
extern int filemap_check_errors(struct address_space *mapping);

extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
int datasync);
Expand Down
3 changes: 2 additions & 1 deletion mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void delete_from_page_cache(struct page *page)
}
EXPORT_SYMBOL(delete_from_page_cache);

static int filemap_check_errors(struct address_space *mapping)
int filemap_check_errors(struct address_space *mapping)
{
int ret = 0;
/* Check for outstanding write errors */
Expand All @@ -266,6 +266,7 @@ static int filemap_check_errors(struct address_space *mapping)
ret = -EIO;
return ret;
}
EXPORT_SYMBOL(filemap_check_errors);

/**
* __filemap_fdatawrite_range - start writeback on mapping dirty pages in range
Expand Down

0 comments on commit d72d9e2

Please sign in to comment.