UPSTREAM: spi: rockchip: remove xfer_completion from rockchip_spi
[firefly-linux-kernel-4.4.55.git] / block / blk-ioc.c
index 9c4bb8266bc80327926f0e68e3a85c2eb8315773..381cb50a673c33ed86f6f5d597331137f2881ce3 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/init.h>
 #include <linux/bio.h>
 #include <linux/blkdev.h>
-#include <linux/bootmem.h>     /* for max_pfn/max_low_pfn */
 #include <linux/slab.h>
 
 #include "blk.h"
@@ -69,7 +68,7 @@ static void ioc_destroy_icq(struct io_cq *icq)
         * under queue_lock.  If it's not pointing to @icq now, it never
         * will.  Hint assignment itself can race safely.
         */
-       if (rcu_dereference_raw(ioc->icq_hint) == icq)
+       if (rcu_access_pointer(ioc->icq_hint) == icq)
                rcu_assign_pointer(ioc->icq_hint, NULL);
 
        ioc_exit_icq(icq);
@@ -144,7 +143,8 @@ void put_io_context(struct io_context *ioc)
        if (atomic_long_dec_and_test(&ioc->refcount)) {
                spin_lock_irqsave(&ioc->lock, flags);
                if (!hlist_empty(&ioc->icq_list))
-                       schedule_work(&ioc->release_work);
+                       queue_work(system_power_efficient_wq,
+                                       &ioc->release_work);
                else
                        free_ioc = true;
                spin_unlock_irqrestore(&ioc->lock, flags);
@@ -289,7 +289,7 @@ struct io_context *get_task_io_context(struct task_struct *task,
 {
        struct io_context *ioc;
 
-       might_sleep_if(gfp_flags & __GFP_WAIT);
+       might_sleep_if(gfpflags_allow_blocking(gfp_flags));
 
        do {
                task_lock(task);
@@ -366,7 +366,7 @@ struct io_cq *ioc_create_icq(struct io_context *ioc, struct request_queue *q,
        if (!icq)
                return NULL;
 
-       if (radix_tree_preload(gfp_mask) < 0) {
+       if (radix_tree_maybe_preload(gfp_mask) < 0) {
                kmem_cache_free(et->icq_cache, icq);
                return NULL;
        }