mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 13:22:55 +00:00
nilfs: use bio op accessors
Separate the op from the rq_flag_bits and have nilfs set/get the bio using bio_set_op_attrs/bio_op. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
eed25cd5bb
commit
b2d4586627
@ -346,7 +346,8 @@ static void nilfs_end_bio_write(struct bio *bio)
|
||||
}
|
||||
|
||||
static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
|
||||
struct nilfs_write_info *wi, int mode)
|
||||
struct nilfs_write_info *wi, int mode,
|
||||
int mode_flags)
|
||||
{
|
||||
struct bio *bio = wi->bio;
|
||||
int err;
|
||||
@ -364,7 +365,7 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
|
||||
|
||||
bio->bi_end_io = nilfs_end_bio_write;
|
||||
bio->bi_private = segbuf;
|
||||
bio->bi_rw = mode;
|
||||
bio_set_op_attrs(bio, mode, mode_flags);
|
||||
submit_bio(bio);
|
||||
segbuf->sb_nbio++;
|
||||
|
||||
@ -438,7 +439,7 @@ static int nilfs_segbuf_submit_bh(struct nilfs_segment_buffer *segbuf,
|
||||
return 0;
|
||||
}
|
||||
/* bio is FULL */
|
||||
err = nilfs_segbuf_submit_bio(segbuf, wi, mode);
|
||||
err = nilfs_segbuf_submit_bio(segbuf, wi, mode, 0);
|
||||
/* never submit current bh */
|
||||
if (likely(!err))
|
||||
goto repeat;
|
||||
@ -462,19 +463,19 @@ static int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf,
|
||||
{
|
||||
struct nilfs_write_info wi;
|
||||
struct buffer_head *bh;
|
||||
int res = 0, rw = WRITE;
|
||||
int res = 0;
|
||||
|
||||
wi.nilfs = nilfs;
|
||||
nilfs_segbuf_prepare_write(segbuf, &wi);
|
||||
|
||||
list_for_each_entry(bh, &segbuf->sb_segsum_buffers, b_assoc_buffers) {
|
||||
res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, rw);
|
||||
res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, REQ_OP_WRITE);
|
||||
if (unlikely(res))
|
||||
goto failed_bio;
|
||||
}
|
||||
|
||||
list_for_each_entry(bh, &segbuf->sb_payload_buffers, b_assoc_buffers) {
|
||||
res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, rw);
|
||||
res = nilfs_segbuf_submit_bh(segbuf, &wi, bh, REQ_OP_WRITE);
|
||||
if (unlikely(res))
|
||||
goto failed_bio;
|
||||
}
|
||||
@ -484,8 +485,8 @@ static int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf,
|
||||
* Last BIO is always sent through the following
|
||||
* submission.
|
||||
*/
|
||||
rw |= REQ_SYNC;
|
||||
res = nilfs_segbuf_submit_bio(segbuf, &wi, rw);
|
||||
res = nilfs_segbuf_submit_bio(segbuf, &wi, REQ_OP_WRITE,
|
||||
REQ_SYNC);
|
||||
}
|
||||
|
||||
failed_bio:
|
||||
|
Loading…
Reference in New Issue
Block a user