mm: make __swap_writepage() use bio_set_op_attrs()
authorJens Axboe <axboe@fb.com>
Mon, 1 Aug 2016 15:38:44 +0000 (09:38 -0600)
committerJens Axboe <axboe@fb.com>
Sun, 7 Aug 2016 20:41:02 +0000 (14:41 -0600)
Cleaner than manipulating bio->bi_rw flags directly.

Signed-off-by: Jens Axboe <axboe@fb.com>
mm/page_io.c

index fb1fa269d3a06416151a2b3ef9e57a1e99ae4db5..16bd82fad38c18f985ccf7092537c2cacee31427 100644 (file)
@@ -319,9 +319,10 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
                ret = -ENOMEM;
                goto out;
        }
-       bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
        if (wbc->sync_mode == WB_SYNC_ALL)
-               bio->bi_rw |= REQ_SYNC;
+               bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_SYNC);
+       else
+               bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
        count_vm_event(PSWPOUT);
        set_page_writeback(page);
        unlock_page(page);