diff options
author | Jens Axboe <axboe@fb.com> | 2016-08-06 00:35:16 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-08-07 23:41:02 +0300 |
commit | 1eff9d322a444245c67515edb52bc0eb68374aa8 (patch) | |
tree | aed4c3bfdf94202b93b9b5ce74c6e247f4c3ab85 /include | |
parent | 31c64f78767948986c6c4c6f488803722c6b0e7a (diff) | |
download | linux-1eff9d322a444245c67515edb52bc0eb68374aa8.tar.xz |
block: rename bio bi_rw to bi_opf
Since commit 63a4cc24867d, bio->bi_rw contains flags in the lower
portion and the op code in the higher portions. This means that
old code that relies on manually setting bi_rw is most likely
going to be broken. Instead of letting that brokeness linger,
rename the member, to force old and out-of-tree code to break
at compile time instead of at runtime.
No intended functional changes in this commit.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bio.h | 4 | ||||
-rw-r--r-- | include/linux/blk-cgroup.h | 4 | ||||
-rw-r--r-- | include/linux/blk_types.h | 15 | ||||
-rw-r--r-- | include/trace/events/bcache.h | 8 | ||||
-rw-r--r-- | include/trace/events/block.h | 14 |
5 files changed, 23 insertions, 22 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index e09a8895fc31..59ffaa68b11b 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -95,7 +95,7 @@ static inline bool bio_is_rw(struct bio *bio) static inline bool bio_mergeable(struct bio *bio) { - if (bio->bi_rw & REQ_NOMERGE_FLAGS) + if (bio->bi_opf & REQ_NOMERGE_FLAGS) return false; return true; @@ -318,7 +318,7 @@ struct bio_integrity_payload { static inline struct bio_integrity_payload *bio_integrity(struct bio *bio) { - if (bio->bi_rw & REQ_INTEGRITY) + if (bio->bi_opf & REQ_INTEGRITY) return bio->bi_integrity; return NULL; diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index f77150a4a96a..10648e300c93 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -714,9 +714,9 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, if (!throtl) { blkg = blkg ?: q->root_blkg; - blkg_rwstat_add(&blkg->stat_bytes, bio_op(bio), bio->bi_rw, + blkg_rwstat_add(&blkg->stat_bytes, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); - blkg_rwstat_add(&blkg->stat_ios, bio_op(bio), bio->bi_rw, 1); + blkg_rwstat_add(&blkg->stat_ios, bio_op(bio), bio->bi_opf, 1); } rcu_read_unlock(); diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index f254eb264924..436f43f87da9 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -27,8 +27,9 @@ struct bio { struct bio *bi_next; /* request queue link */ struct block_device *bi_bdev; int bi_error; - unsigned int bi_rw; /* bottom bits req flags, - * top bits REQ_OP + unsigned int bi_opf; /* bottom bits req flags, + * top bits REQ_OP. Use + * accessors. */ unsigned short bi_flags; /* status, command, etc */ unsigned short bi_ioprio; @@ -89,13 +90,13 @@ struct bio { }; #define BIO_OP_SHIFT (8 * sizeof(unsigned int) - REQ_OP_BITS) -#define bio_op(bio) ((bio)->bi_rw >> BIO_OP_SHIFT) +#define bio_op(bio) ((bio)->bi_opf >> BIO_OP_SHIFT) #define bio_set_op_attrs(bio, op, op_flags) do { \ WARN_ON(op >= (1 << REQ_OP_BITS)); \ - (bio)->bi_rw &= ((1 << BIO_OP_SHIFT) - 1); \ - (bio)->bi_rw |= ((unsigned int) (op) << BIO_OP_SHIFT); \ - (bio)->bi_rw |= op_flags; \ + (bio)->bi_opf &= ((1 << BIO_OP_SHIFT) - 1); \ + (bio)->bi_opf |= ((unsigned int) (op) << BIO_OP_SHIFT); \ + (bio)->bi_opf |= op_flags; \ } while (0) #define BIO_RESET_BYTES offsetof(struct bio, bi_max_vecs) @@ -138,7 +139,7 @@ struct bio { /* * Request flags. For use in the cmd_flags field of struct request, and in - * bi_rw of struct bio. Note that some flags are only valid in either one. + * bi_opf of struct bio. Note that some flags are only valid in either one. */ enum rq_flag_bits { /* common flags */ diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h index 65673d8b81ac..d336b890e31f 100644 --- a/include/trace/events/bcache.h +++ b/include/trace/events/bcache.h @@ -27,7 +27,7 @@ DECLARE_EVENT_CLASS(bcache_request, __entry->sector = bio->bi_iter.bi_sector; __entry->orig_sector = bio->bi_iter.bi_sector - 16; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); ), @@ -102,7 +102,7 @@ DECLARE_EVENT_CLASS(bcache_bio, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); ), @@ -138,7 +138,7 @@ TRACE_EVENT(bcache_read, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); __entry->cache_hit = hit; __entry->bypass = bypass; @@ -170,7 +170,7 @@ TRACE_EVENT(bcache_write, __entry->inode = inode; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); __entry->writeback = writeback; __entry->bypass = bypass; diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 5a2a7592068f..8f3a163b8166 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -274,7 +274,7 @@ TRACE_EVENT(block_bio_bounce, bio->bi_bdev->bd_dev : 0; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -313,7 +313,7 @@ TRACE_EVENT(block_bio_complete, __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); __entry->error = error; - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); ), @@ -341,7 +341,7 @@ DECLARE_EVENT_CLASS(block_bio_merge, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -409,7 +409,7 @@ TRACE_EVENT(block_bio_queue, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -439,7 +439,7 @@ DECLARE_EVENT_CLASS(block_get_rq, __entry->sector = bio ? bio->bi_iter.bi_sector : 0; __entry->nr_sector = bio ? bio_sectors(bio) : 0; blk_fill_rwbs(__entry->rwbs, bio ? bio_op(bio) : 0, - bio ? bio->bi_rw : 0, __entry->nr_sector); + bio ? bio->bi_opf : 0, __entry->nr_sector); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -573,7 +573,7 @@ TRACE_EVENT(block_split, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->new_sector = new_sector; - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -617,7 +617,7 @@ TRACE_EVENT(block_bio_remap, __entry->nr_sector = bio_sectors(bio); __entry->old_dev = dev; __entry->old_sector = from; - blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_rw, + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, bio->bi_iter.bi_size); ), |