mm: page allocator: do not call direct reclaim for THP allocations while compaction...
[linux-2.6-block.git] / fs / btrfs / disk-io.c
index f44b3928dc2dc94cb62cefe72f1063f282dc09c2..1375494c8cb60c691a555b947f022bb8d0a439a7 100644 (file)
@@ -872,7 +872,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
 
 #ifdef CONFIG_MIGRATION
 static int btree_migratepage(struct address_space *mapping,
-                       struct page *newpage, struct page *page)
+                       struct page *newpage, struct page *page, bool sync)
 {
        /*
         * we can't safely write a btree page from here,
@@ -887,7 +887,7 @@ static int btree_migratepage(struct address_space *mapping,
        if (page_has_private(page) &&
            !try_to_release_page(page, GFP_KERNEL))
                return -EAGAIN;
-       return migrate_page(mapping, newpage, page);
+       return migrate_page(mapping, newpage, page, sync);
 }
 #endif
 
@@ -1579,9 +1579,7 @@ static int cleaner_kthread(void *arg)
                        btrfs_run_defrag_inodes(root->fs_info);
                }
 
-               if (freezing(current)) {
-                       refrigerator();
-               } else {
+               if (!try_to_freeze()) {
                        set_current_state(TASK_INTERRUPTIBLE);
                        if (!kthread_should_stop())
                                schedule();
@@ -1635,9 +1633,7 @@ sleep:
                wake_up_process(root->fs_info->cleaner_kthread);
                mutex_unlock(&root->fs_info->transaction_kthread_mutex);
 
-               if (freezing(current)) {
-                       refrigerator();
-               } else {
+               if (!try_to_freeze()) {
                        set_current_state(TASK_INTERRUPTIBLE);
                        if (!kthread_should_stop() &&
                            !btrfs_transaction_blocked(root->fs_info))