aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 72e46e6f0d9a..394bb5e96f87 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -476,6 +476,29 @@ int filemap_fdatawait_range(struct address_space *mapping, loff_t start_byte,
476EXPORT_SYMBOL(filemap_fdatawait_range); 476EXPORT_SYMBOL(filemap_fdatawait_range);
477 477
478/** 478/**
479 * file_fdatawait_range - wait for writeback to complete
480 * @file: file pointing to address space structure to wait for
481 * @start_byte: offset in bytes where the range starts
482 * @end_byte: offset in bytes where the range ends (inclusive)
483 *
484 * Walk the list of under-writeback pages of the address space that file
485 * refers to, in the given range and wait for all of them. Check error
486 * status of the address space vs. the file->f_wb_err cursor and return it.
487 *
488 * Since the error status of the file is advanced by this function,
489 * callers are responsible for checking the return value and handling and/or
490 * reporting the error.
491 */
492int file_fdatawait_range(struct file *file, loff_t start_byte, loff_t end_byte)
493{
494 struct address_space *mapping = file->f_mapping;
495
496 __filemap_fdatawait_range(mapping, start_byte, end_byte);
497 return file_check_and_advance_wb_err(file);
498}
499EXPORT_SYMBOL(file_fdatawait_range);
500
501/**
479 * filemap_fdatawait_keep_errors - wait for writeback without clearing errors 502 * filemap_fdatawait_keep_errors - wait for writeback without clearing errors
480 * @mapping: address space structure to wait for 503 * @mapping: address space structure to wait for
481 * 504 *