aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 15:32:20 -0400
committerJens Axboe <axboe@fb.com>2016-06-07 15:41:38 -0400
commit43b62ce3ff0ac1f13b732cb1bd130f522af1dba4 (patch)
tree934a7feacfc4f6402a6519fd5c2091edfb41c0e5
parent8e45c6f8808357704519c217dc633bc43afc2a61 (diff)
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>
-rw-r--r--include/linux/bio.h14
-rw-r--r--include/linux/blk_types.h5
2 files changed, 4 insertions, 15 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4568647269a7..35108c2f8ea9 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -47,18 +47,8 @@
47#define bio_op(bio) (op_from_rq_bits((bio)->bi_rw)) 47#define bio_op(bio) (op_from_rq_bits((bio)->bi_rw))
48#define bio_set_op_attrs(bio, op, flags) ((bio)->bi_rw |= (op | flags)) 48#define bio_set_op_attrs(bio, op, flags) ((bio)->bi_rw |= (op | flags))
49 49
50/* 50#define bio_prio(bio) (bio)->bi_ioprio
51 * upper 16 bits of bi_rw define the io priority of this bio 51#define bio_set_prio(bio, prio) ((bio)->bi_ioprio = prio)
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)
62 52
63/* 53/*
64 * various member access, note that bio_data should of course not be used 54 * various member access, note that bio_data should of course not be used
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 6e60baa583da..27384134f8a0 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -48,9 +48,8 @@ struct bio {
48 struct block_device *bi_bdev; 48 struct block_device *bi_bdev;
49 unsigned int bi_flags; /* status, command, etc */ 49 unsigned int bi_flags; /* status, command, etc */
50 int bi_error; 50 int bi_error;
51 unsigned long bi_rw; /* bottom bits READ/WRITE, 51 unsigned long bi_rw; /* READ/WRITE */
52 * top bits priority 52 unsigned short bi_ioprio;
53 */
54 53
55 struct bvec_iter bi_iter; 54 struct bvec_iter bi_iter;
56 55