mm/page_alloc: silence a KASAN false positive
[linux-2.6-microblaze.git] / mm / page_io.c
index e8726f3..9e36256 100644 (file)
@@ -277,6 +277,23 @@ static inline void count_swpout_vm_event(struct page *page)
        count_vm_events(PSWPOUT, hpage_nr_pages(page));
 }
 
+#if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP)
+static void bio_associate_blkg_from_page(struct bio *bio, struct page *page)
+{
+       struct cgroup_subsys_state *css;
+
+       if (!page->mem_cgroup)
+               return;
+
+       rcu_read_lock();
+       css = cgroup_e_css(page->mem_cgroup->css.cgroup, &io_cgrp_subsys);
+       bio_associate_blkg_from_css(bio, css);
+       rcu_read_unlock();
+}
+#else
+#define bio_associate_blkg_from_page(bio, page)                do { } while (0)
+#endif /* CONFIG_MEMCG && CONFIG_BLK_CGROUP */
+
 int __swap_writepage(struct page *page, struct writeback_control *wbc,
                bio_end_io_t end_write_func)
 {
@@ -424,7 +441,7 @@ int swap_readpage(struct page *page, bool synchronous)
                        break;
 
                if (!blk_poll(disk->queue, qc, true))
-                       io_schedule();
+                       blk_io_schedule();
        }
        __set_current_state(TASK_RUNNING);
        bio_put(bio);