Skip to content

Commit

Permalink
bcache: use REQ_PRIO to indicate bio for metadata
Browse files Browse the repository at this point in the history
In cached_dev_cache_miss() and check_should_bypass(), REQ_META is used
to check whether a bio is for metadata request. REQ_META is used for
blktrace, the correct REQ_ flag should be REQ_PRIO. This flag means the
bio should be prior to other bio, and frequently be used to indicate
metadata io in file system code.

This patch replaces REQ_META with correct flag REQ_PRIO.

CC Adam Manzanares because he explains to me what REQ_PRIO is for.

Signed-off-by: Coly Li <colyli@suse.de>
Cc: Adam Manzanares <adam.manzanares@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Coly Li authored and Jens Axboe committed Oct 8, 2018
1 parent 502b291 commit 752f66a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/bcache/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
* unless the read-ahead request is for metadata (eg, for gfs2).
*/
if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) &&
!(bio->bi_opf & REQ_META))
!(bio->bi_opf & REQ_PRIO))
goto skip;

if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) ||
Expand Down Expand Up @@ -877,7 +877,7 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s,
}

if (!(bio->bi_opf & REQ_RAHEAD) &&
!(bio->bi_opf & REQ_META) &&
!(bio->bi_opf & REQ_PRIO) &&
s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA)
reada = min_t(sector_t, dc->readahead >> 9,
get_capacity(bio->bi_disk) - bio_end_sector(bio));
Expand Down

0 comments on commit 752f66a

Please sign in to comment.