]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/btrfs/extent_io.c
Merge branch 'linus' into perf/urgent, to synchronize with upstream
[linux.git] / fs / btrfs / extent_io.c
index bbfb102d65b86f7f80fdfc59aa5bbf7e370ed128..e2d30287e2d562f18a517adb1eba44d282a36df9 100644 (file)
@@ -3492,22 +3492,11 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
                 */
                if (compressed || block_start == EXTENT_MAP_HOLE ||
                    block_start == EXTENT_MAP_INLINE) {
-                       /*
-                        * end_io notification does not happen here for
-                        * compressed extents
-                        */
-                       if (!compressed)
-                               btrfs_writepage_endio_finish_ordered(page, cur,
-                                                           cur + iosize - 1,
-                                                           1);
-                       else if (compressed) {
-                               /* we don't want to end_page_writeback on
-                                * a compressed extent.  this happens
-                                * elsewhere
-                                */
+                       if (compressed)
                                nr++;
-                       }
-
+                       else
+                               btrfs_writepage_endio_finish_ordered(page, cur,
+                                                       cur + iosize - 1, 1);
                        cur += iosize;
                        pg_offset += iosize;
                        continue;
@@ -3930,6 +3919,11 @@ int btree_write_cache_pages(struct address_space *mapping,
        if (wbc->range_cyclic) {
                index = mapping->writeback_index; /* Start from prev offset */
                end = -1;
+               /*
+                * Start from the beginning does not need to cycle over the
+                * range, mark it as scanned.
+                */
+               scanned = (index == 0);
        } else {
                index = wbc->range_start >> PAGE_SHIFT;
                end = wbc->range_end >> PAGE_SHIFT;
@@ -3947,7 +3941,6 @@ int btree_write_cache_pages(struct address_space *mapping,
                        tag))) {
                unsigned i;
 
-               scanned = 1;
                for (i = 0; i < nr_pages; i++) {
                        struct page *page = pvec.pages[i];
 
@@ -4076,6 +4069,11 @@ static int extent_write_cache_pages(struct address_space *mapping,
        if (wbc->range_cyclic) {
                index = mapping->writeback_index; /* Start from prev offset */
                end = -1;
+               /*
+                * Start from the beginning does not need to cycle over the
+                * range, mark it as scanned.
+                */
+               scanned = (index == 0);
        } else {
                index = wbc->range_start >> PAGE_SHIFT;
                end = wbc->range_end >> PAGE_SHIFT;
@@ -4109,7 +4107,6 @@ static int extent_write_cache_pages(struct address_space *mapping,
                                                &index, end, tag))) {
                unsigned i;
 
-               scanned = 1;
                for (i = 0; i < nr_pages; i++) {
                        struct page *page = pvec.pages[i];