bcachefs: Use wbc_to_write_flags()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
c32bd3ad1f
commit
50fe5bd69c
@ -1025,6 +1025,7 @@ static void bch2_writepage_do_io(struct bch_writepage_state *w)
|
||||
* possible, else allocating a new one:
|
||||
*/
|
||||
static void bch2_writepage_io_alloc(struct bch_fs *c,
|
||||
struct writeback_control *wbc,
|
||||
struct bch_writepage_state *w,
|
||||
struct bch_inode_info *inode,
|
||||
u64 sector,
|
||||
@ -1050,6 +1051,7 @@ static void bch2_writepage_io_alloc(struct bch_fs *c,
|
||||
op->write_point = writepoint_hashed(inode->ei_last_dirtied);
|
||||
op->pos = POS(inode->v.i_ino, sector);
|
||||
op->wbio.bio.bi_iter.bi_sector = sector;
|
||||
op->wbio.bio.bi_opf = wbc_to_write_flags(wbc);
|
||||
}
|
||||
|
||||
static int __bch2_writepage(struct folio *folio,
|
||||
@ -1161,7 +1163,7 @@ do_io:
|
||||
bch2_writepage_do_io(w);
|
||||
|
||||
if (!w->io)
|
||||
bch2_writepage_io_alloc(c, w, inode, sector,
|
||||
bch2_writepage_io_alloc(c, wbc, w, inode, sector,
|
||||
nr_replicas_this_write);
|
||||
|
||||
atomic_inc(&s->write_count);
|
||||
@ -1178,9 +1180,6 @@ do_io:
|
||||
w->io->op.i_sectors_delta -= dirty_sectors;
|
||||
w->io->op.new_i_size = i_size;
|
||||
|
||||
if (wbc->sync_mode == WB_SYNC_ALL)
|
||||
w->io->op.wbio.bio.bi_opf |= REQ_SYNC;
|
||||
|
||||
offset += sectors;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user