Merge tag 'wireless-drivers-next-for-davem-2015-11-25' of git://git.kernel.org/pub...
[linux-2.6-block.git] / fs / fscache / page.c
index 483bbc613bf04528cbc66d5d54a5b54b6a8dc85b..6b35fc4860a0381ab33ccc6162ca5184555373b6 100644 (file)
@@ -58,7 +58,7 @@ bool release_page_wait_timeout(struct fscache_cookie *cookie, struct page *page)
 
 /*
  * decide whether a page can be released, possibly by cancelling a store to it
- * - we're allowed to sleep if __GFP_WAIT is flagged
+ * - we're allowed to sleep if __GFP_DIRECT_RECLAIM is flagged
  */
 bool __fscache_maybe_release_page(struct fscache_cookie *cookie,
                                  struct page *page,
@@ -122,7 +122,7 @@ page_busy:
         * allocator as the work threads writing to the cache may all end up
         * sleeping on memory allocation, so we may need to impose a timeout
         * too. */
-       if (!(gfp & __GFP_WAIT) || !(gfp & __GFP_FS)) {
+       if (!(gfp & __GFP_DIRECT_RECLAIM) || !(gfp & __GFP_FS)) {
                fscache_stat(&fscache_n_store_vmscan_busy);
                return false;
        }
@@ -132,7 +132,7 @@ page_busy:
                _debug("fscache writeout timeout page: %p{%lx}",
                        page, page->index);
 
-       gfp &= ~__GFP_WAIT;
+       gfp &= ~__GFP_DIRECT_RECLAIM;
        goto try_again;
 }
 EXPORT_SYMBOL(__fscache_maybe_release_page);
@@ -816,7 +816,7 @@ static void fscache_write_op(struct fscache_operation *_op)
                goto superseded;
        page = results[0];
        _debug("gang %d [%lx]", n, page->index);
-       if (page->index > op->store_limit) {
+       if (page->index >= op->store_limit) {
                fscache_stat(&fscache_n_store_pages_over_limit);
                goto superseded;
        }