Merge branches 'pm-avs' and 'pm-cpuidle'
[sfrench/cifs-2.6.git] / mm / filemap.c
index bf6aa30be58dca822906d55001e563fa0b4d2e8a..1784478270e1506c22bcd5a1b7cc69066f20d89a 100644 (file)
@@ -632,33 +632,6 @@ static bool mapping_needs_writeback(struct address_space *mapping)
        return mapping->nrpages;
 }
 
-int filemap_write_and_wait(struct address_space *mapping)
-{
-       int err = 0;
-
-       if (mapping_needs_writeback(mapping)) {
-               err = filemap_fdatawrite(mapping);
-               /*
-                * Even if the above returned error, the pages may be
-                * written partially (e.g. -ENOSPC), so we wait for it.
-                * But the -EIO is special case, it may indicate the worst
-                * thing (e.g. bug) happened, so we avoid waiting for it.
-                */
-               if (err != -EIO) {
-                       int err2 = filemap_fdatawait(mapping);
-                       if (!err)
-                               err = err2;
-               } else {
-                       /* Clear any previously stored errors */
-                       filemap_check_errors(mapping);
-               }
-       } else {
-               err = filemap_check_errors(mapping);
-       }
-       return err;
-}
-EXPORT_SYMBOL(filemap_write_and_wait);
-
 /**
  * filemap_write_and_wait_range - write out & wait on a file range
  * @mapping:   the address_space for the pages
@@ -680,7 +653,12 @@ int filemap_write_and_wait_range(struct address_space *mapping,
        if (mapping_needs_writeback(mapping)) {
                err = __filemap_fdatawrite_range(mapping, lstart, lend,
                                                 WB_SYNC_ALL);
-               /* See comment of filemap_write_and_wait() */
+               /*
+                * Even if the above returned error, the pages may be
+                * written partially (e.g. -ENOSPC), so we wait for it.
+                * But the -EIO is special case, it may indicate the worst
+                * thing (e.g. bug) happened, so we avoid waiting for it.
+                */
                if (err != -EIO) {
                        int err2 = filemap_fdatawait_range(mapping,
                                                lstart, lend);