Skip to content

Commit 43b62ce

Browse files
Mike Christieaxboe
authored andcommitted
block: move bio io prio to a new field
In the next patch, we move drop the compat code and make the op a separate value that is hidden in bi_rw. To give the op and rq bits flags room to grow this moves prio to its own field. Signed-off-by: Mike Christie <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 8e45c6f commit 43b62ce

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

include/linux/bio.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,8 @@
4747
#define bio_op(bio) (op_from_rq_bits((bio)->bi_rw))
4848
#define bio_set_op_attrs(bio, op, flags) ((bio)->bi_rw |= (op | flags))
4949

50-
/*
51-
* upper 16 bits of bi_rw define the io priority of this bio
52-
*/
53-
#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
54-
#define bio_prio(bio) ((bio)->bi_rw >> BIO_PRIO_SHIFT)
55-
#define bio_prio_valid(bio) ioprio_valid(bio_prio(bio))
56-
57-
#define bio_set_prio(bio, prio) do { \
58-
WARN_ON(prio >= (1 << IOPRIO_BITS)); \
59-
(bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1); \
60-
(bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT); \
61-
} while (0)
50+
#define bio_prio(bio) (bio)->bi_ioprio
51+
#define bio_set_prio(bio, prio) ((bio)->bi_ioprio = prio)
6252

6353
/*
6454
* various member access, note that bio_data should of course not be used

include/linux/blk_types.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ struct bio {
4848
struct block_device *bi_bdev;
4949
unsigned int bi_flags; /* status, command, etc */
5050
int bi_error;
51-
unsigned long bi_rw; /* bottom bits READ/WRITE,
52-
* top bits priority
53-
*/
51+
unsigned long bi_rw; /* READ/WRITE */
52+
unsigned short bi_ioprio;
5453

5554
struct bvec_iter bi_iter;
5655

0 commit comments

Comments
 (0)