block: rename bio bi_rw to bi_opf
Since commit 63a4cc2486
, 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>
此提交包含在:
@@ -208,7 +208,7 @@ static void bch_data_insert_start(struct closure *cl)
|
||||
* Journal writes are marked REQ_PREFLUSH; if the original write was a
|
||||
* flush, it'll wait on the journal write.
|
||||
*/
|
||||
bio->bi_rw &= ~(REQ_PREFLUSH|REQ_FUA);
|
||||
bio->bi_opf &= ~(REQ_PREFLUSH|REQ_FUA);
|
||||
|
||||
do {
|
||||
unsigned i;
|
||||
@@ -405,7 +405,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
|
||||
if (!congested &&
|
||||
mode == CACHE_MODE_WRITEBACK &&
|
||||
op_is_write(bio_op(bio)) &&
|
||||
(bio->bi_rw & REQ_SYNC))
|
||||
(bio->bi_opf & REQ_SYNC))
|
||||
goto rescale;
|
||||
|
||||
spin_lock(&dc->io_lock);
|
||||
@@ -668,7 +668,7 @@ static inline struct search *search_alloc(struct bio *bio,
|
||||
s->iop.write_prio = 0;
|
||||
s->iop.error = 0;
|
||||
s->iop.flags = 0;
|
||||
s->iop.flush_journal = (bio->bi_rw & (REQ_PREFLUSH|REQ_FUA)) != 0;
|
||||
s->iop.flush_journal = (bio->bi_opf & (REQ_PREFLUSH|REQ_FUA)) != 0;
|
||||
s->iop.wq = bcache_wq;
|
||||
|
||||
return s;
|
||||
@@ -796,8 +796,8 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s,
|
||||
goto out_submit;
|
||||
}
|
||||
|
||||
if (!(bio->bi_rw & REQ_RAHEAD) &&
|
||||
!(bio->bi_rw & REQ_META) &&
|
||||
if (!(bio->bi_opf & REQ_RAHEAD) &&
|
||||
!(bio->bi_opf & REQ_META) &&
|
||||
s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA)
|
||||
reada = min_t(sector_t, dc->readahead >> 9,
|
||||
bdev_sectors(bio->bi_bdev) - bio_end_sector(bio));
|
||||
@@ -920,7 +920,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s)
|
||||
bch_writeback_add(dc);
|
||||
s->iop.bio = bio;
|
||||
|
||||
if (bio->bi_rw & REQ_PREFLUSH) {
|
||||
if (bio->bi_opf & REQ_PREFLUSH) {
|
||||
/* Also need to send a flush to the backing device */
|
||||
struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0,
|
||||
dc->disk.bio_split);
|
||||
|
新增問題並參考
封鎖使用者