Merge tag 'block-5.9-2020-09-04' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / mm / page_io.c
index 9e36256..e485a6e 100644 (file)
@@ -40,7 +40,7 @@ static struct bio *get_swap_bio(gfp_t gfp_flags,
                bio->bi_iter.bi_sector <<= PAGE_SHIFT - 9;
                bio->bi_end_io = end_io;
 
-               bio_add_page(bio, page, PAGE_SIZE * hpage_nr_pages(page), 0);
+               bio_add_page(bio, page, thp_size(page), 0);
        }
        return bio;
 }
@@ -85,7 +85,7 @@ static void swap_slot_free_notify(struct page *page)
                return;
 
        sis = page_swap_info(page);
-       if (!(sis->flags & SWP_BLKDEV))
+       if (data_race(!(sis->flags & SWP_BLKDEV)))
                return;
 
        /*
@@ -274,7 +274,7 @@ static inline void count_swpout_vm_event(struct page *page)
        if (unlikely(PageTransHuge(page)))
                count_vm_event(THP_SWPOUT);
 #endif
-       count_vm_events(PSWPOUT, hpage_nr_pages(page));
+       count_vm_events(PSWPOUT, thp_nr_pages(page));
 }
 
 #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP)
@@ -302,7 +302,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
        struct swap_info_struct *sis = page_swap_info(page);
 
        VM_BUG_ON_PAGE(!PageSwapCache(page), page);
-       if (sis->flags & SWP_FS) {
+       if (data_race(sis->flags & SWP_FS)) {
                struct kiocb kiocb;
                struct file *swap_file = sis->swap_file;
                struct address_space *mapping = swap_file->f_mapping;
@@ -393,7 +393,7 @@ int swap_readpage(struct page *page, bool synchronous)
                goto out;
        }
 
-       if (sis->flags & SWP_FS) {
+       if (data_race(sis->flags & SWP_FS)) {
                struct file *swap_file = sis->swap_file;
                struct address_space *mapping = swap_file->f_mapping;
 
@@ -455,7 +455,7 @@ int swap_set_page_dirty(struct page *page)
 {
        struct swap_info_struct *sis = page_swap_info(page);
 
-       if (sis->flags & SWP_FS) {
+       if (data_race(sis->flags & SWP_FS)) {
                struct address_space *mapping = sis->swap_file->f_mapping;
 
                VM_BUG_ON_PAGE(!PageSwapCache(page), page);