mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
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 <mchristi@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
8e45c6f880
commit
43b62ce3ff
@ -47,18 +47,8 @@
|
|||||||
#define bio_op(bio) (op_from_rq_bits((bio)->bi_rw))
|
#define bio_op(bio) (op_from_rq_bits((bio)->bi_rw))
|
||||||
#define bio_set_op_attrs(bio, op, flags) ((bio)->bi_rw |= (op | flags))
|
#define bio_set_op_attrs(bio, op, flags) ((bio)->bi_rw |= (op | flags))
|
||||||
|
|
||||||
/*
|
#define bio_prio(bio) (bio)->bi_ioprio
|
||||||
* upper 16 bits of bi_rw define the io priority of this bio
|
#define bio_set_prio(bio, prio) ((bio)->bi_ioprio = prio)
|
||||||
*/
|
|
||||||
#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
|
|
||||||
#define bio_prio(bio) ((bio)->bi_rw >> BIO_PRIO_SHIFT)
|
|
||||||
#define bio_prio_valid(bio) ioprio_valid(bio_prio(bio))
|
|
||||||
|
|
||||||
#define bio_set_prio(bio, prio) do { \
|
|
||||||
WARN_ON(prio >= (1 << IOPRIO_BITS)); \
|
|
||||||
(bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1); \
|
|
||||||
(bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* various member access, note that bio_data should of course not be used
|
* various member access, note that bio_data should of course not be used
|
||||||
|
@ -48,9 +48,8 @@ struct bio {
|
|||||||
struct block_device *bi_bdev;
|
struct block_device *bi_bdev;
|
||||||
unsigned int bi_flags; /* status, command, etc */
|
unsigned int bi_flags; /* status, command, etc */
|
||||||
int bi_error;
|
int bi_error;
|
||||||
unsigned long bi_rw; /* bottom bits READ/WRITE,
|
unsigned long bi_rw; /* READ/WRITE */
|
||||||
* top bits priority
|
unsigned short bi_ioprio;
|
||||||
*/
|
|
||||||
|
|
||||||
struct bvec_iter bi_iter;
|
struct bvec_iter bi_iter;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user