Skip to content

Commit ba13e83

Browse files
committed
mm: make __swap_writepage() use bio_set_op_attrs()
Cleaner than manipulating bio->bi_rw flags directly. Signed-off-by: Jens Axboe <[email protected]>
1 parent c11f0c0 commit ba13e83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mm/page_io.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,10 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
319319
ret = -ENOMEM;
320320
goto out;
321321
}
322-
bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
323322
if (wbc->sync_mode == WB_SYNC_ALL)
324-
bio->bi_rw |= REQ_SYNC;
323+
bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_SYNC);
324+
else
325+
bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
325326
count_vm_event(PSWPOUT);
326327
set_page_writeback(page);
327328
unlock_page(page);

0 commit comments

Comments
 (0)