Skip to content

Commit

Permalink
mm: make __swap_writepage() use bio_set_op_attrs()
Browse files Browse the repository at this point in the history
Cleaner than manipulating bio->bi_rw flags directly.

Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Jens Axboe committed Aug 7, 2016
1 parent c11f0c0 commit ba13e83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/page_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ba13e83

Please sign in to comment.