Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70fd7614 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

block,fs: use REQ_* flags directly



Remove the WRITE_* and READ_SYNC wrappers, and just use the flags
directly.  Where applicable this also drops usage of the
bio_set_op_attrs wrapper.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent a2b80967
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -330,7 +330,7 @@ static bool blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq)
	}

	flush_rq->cmd_type = REQ_TYPE_FS;
	flush_rq->cmd_flags = REQ_OP_FLUSH | WRITE_FLUSH;
	flush_rq->cmd_flags = REQ_OP_FLUSH | REQ_PREFLUSH;
	flush_rq->rq_flags |= RQF_FLUSH_SEQ;
	flush_rq->rq_disk = first_rq->rq_disk;
	flush_rq->end_io = flush_end_io;
@@ -486,7 +486,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,

	bio = bio_alloc(gfp_mask, 0);
	bio->bi_bdev = bdev;
	bio_set_op_attrs(bio, REQ_OP_WRITE, WRITE_FLUSH);
	bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;

	ret = submit_bio_wait(bio);

+1 −1
Original line number Diff line number Diff line
@@ -1266,7 +1266,7 @@ static void submit_one_flush(struct drbd_device *device, struct issue_flush_cont
	bio->bi_bdev = device->ldev->backing_bdev;
	bio->bi_private = octx;
	bio->bi_end_io = one_flush_endio;
	bio_set_op_attrs(bio, REQ_OP_FLUSH, WRITE_FLUSH);
	bio->bi_opf = REQ_OP_FLUSH | REQ_PREFLUSH;

	device->flush_jif = jiffies;
	set_bit(FLUSH_PENDING, &device->flags);
+5 −5
Original line number Diff line number Diff line
@@ -1253,14 +1253,14 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
	case BLKIF_OP_WRITE:
		ring->st_wr_req++;
		operation = REQ_OP_WRITE;
		operation_flags = WRITE_ODIRECT;
		operation_flags = REQ_SYNC | REQ_IDLE;
		break;
	case BLKIF_OP_WRITE_BARRIER:
		drain = true;
	case BLKIF_OP_FLUSH_DISKCACHE:
		ring->st_f_req++;
		operation = REQ_OP_WRITE;
		operation_flags = WRITE_FLUSH;
		operation_flags = REQ_PREFLUSH;
		break;
	default:
		operation = 0; /* make gcc happy */
@@ -1272,7 +1272,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
	nseg = req->operation == BLKIF_OP_INDIRECT ?
	       req->u.indirect.nr_segments : req->u.rw.nr_segments;

	if (unlikely(nseg == 0 && operation_flags != WRITE_FLUSH) ||
	if (unlikely(nseg == 0 && operation_flags != REQ_PREFLUSH) ||
	    unlikely((req->operation != BLKIF_OP_INDIRECT) &&
		     (nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) ||
	    unlikely((req->operation == BLKIF_OP_INDIRECT) &&
@@ -1334,7 +1334,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
	}

	/* Wait on all outstanding I/O's and once that has been completed
	 * issue the WRITE_FLUSH.
	 * issue the flush.
	 */
	if (drain)
		xen_blk_drain_io(pending_req->ring);
@@ -1380,7 +1380,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,

	/* This will be hit if the operation was a flush or discard. */
	if (!bio) {
		BUG_ON(operation_flags != WRITE_FLUSH);
		BUG_ON(operation_flags != REQ_PREFLUSH);

		bio = bio_alloc(GFP_KERNEL, 0);
		if (unlikely(bio == NULL))
+2 −2
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@ static void bch_btree_node_read(struct btree *b)
	bio->bi_iter.bi_size = KEY_SIZE(&b->key) << 9;
	bio->bi_end_io	= btree_node_read_endio;
	bio->bi_private	= &cl;
	bio_set_op_attrs(bio, REQ_OP_READ, REQ_META|READ_SYNC);
	bio->bi_opf = REQ_OP_READ | REQ_META;

	bch_bio_map(bio, b->keys.set[0].data);

@@ -393,7 +393,7 @@ static void do_btree_node_write(struct btree *b)
	b->bio->bi_end_io	= btree_node_write_endio;
	b->bio->bi_private	= cl;
	b->bio->bi_iter.bi_size	= roundup(set_bytes(i), block_bytes(b->c));
	bio_set_op_attrs(b->bio, REQ_OP_WRITE, REQ_META|WRITE_SYNC|REQ_FUA);
	b->bio->bi_opf		= REQ_OP_WRITE | REQ_META | REQ_FUA;
	bch_bio_map(b->bio, i);

	/*
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ void bch_btree_verify(struct btree *b)
	bio->bi_bdev		= PTR_CACHE(b->c, &b->key, 0)->bdev;
	bio->bi_iter.bi_sector	= PTR_OFFSET(&b->key, 0);
	bio->bi_iter.bi_size	= KEY_SIZE(&v->key) << 9;
	bio_set_op_attrs(bio, REQ_OP_READ, REQ_META|READ_SYNC);
	bio->bi_opf		= REQ_OP_READ | REQ_META;
	bch_bio_map(bio, sorted);

	submit_bio_wait(bio);
@@ -113,7 +113,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio)
	check = bio_clone(bio, GFP_NOIO);
	if (!check)
		return;
	bio_set_op_attrs(check, REQ_OP_READ, READ_SYNC);
	check->bi_opf = REQ_OP_READ;

	if (bio_alloc_pages(check, GFP_NOIO))
		goto out_put;
Loading