|
@@ -306,6 +306,26 @@ int wait_on_page_writeback_range(struct address_space *mapping,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * filemap_fdatawait_range - wait for all under-writeback pages to complete in a given range
|
|
|
+ * @mapping: address space structure to wait for
|
|
|
+ * @start: offset in bytes where the range starts
|
|
|
+ * @end: offset in bytes where the range ends (inclusive)
|
|
|
+ *
|
|
|
+ * Walk the list of under-writeback pages of the given address space
|
|
|
+ * in the given range and wait for all of them.
|
|
|
+ *
|
|
|
+ * This is just a simple wrapper so that callers don't have to convert offsets
|
|
|
+ * to page indexes themselves
|
|
|
+ */
|
|
|
+int filemap_fdatawait_range(struct address_space *mapping, loff_t start,
|
|
|
+ loff_t end)
|
|
|
+{
|
|
|
+ return wait_on_page_writeback_range(mapping, start >> PAGE_CACHE_SHIFT,
|
|
|
+ end >> PAGE_CACHE_SHIFT);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(filemap_fdatawait_range);
|
|
|
+
|
|
|
/**
|
|
|
* sync_page_range - write and wait on all pages in the passed range
|
|
|
* @inode: target inode
|