aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/request.c
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2018-10-08 08:41:09 -0400
committerJens Axboe <axboe@kernel.dk>2018-10-08 10:19:40 -0400
commit752f66a75abad2ae40b4570b3c77b422389cffcf (patch)
treec8ca90145fc8dc948f2722a11b932aefb0b74940 /drivers/md/bcache/request.c
parent502b291568fc7faf1ebdb2c2590f12851db0ff76 (diff)
bcache: use REQ_PRIO to indicate bio for metadata
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>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r--drivers/md/bcache/request.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 4946d486f734..ee15fb039fd0 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -395,7 +395,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
395 * unless the read-ahead request is for metadata (eg, for gfs2). 395 * unless the read-ahead request is for metadata (eg, for gfs2).
396 */ 396 */
397 if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) && 397 if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) &&
398 !(bio->bi_opf & REQ_META)) 398 !(bio->bi_opf & REQ_PRIO))
399 goto skip; 399 goto skip;
400 400
401 if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) || 401 if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) ||
@@ -877,7 +877,7 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s,
877 } 877 }
878 878
879 if (!(bio->bi_opf & REQ_RAHEAD) && 879 if (!(bio->bi_opf & REQ_RAHEAD) &&
880 !(bio->bi_opf & REQ_META) && 880 !(bio->bi_opf & REQ_PRIO) &&
881 s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA) 881 s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA)
882 reada = min_t(sector_t, dc->readahead >> 9, 882 reada = min_t(sector_t, dc->readahead >> 9,
883 get_capacity(bio->bi_disk) - bio_end_sector(bio)); 883 get_capacity(bio->bi_disk) - bio_end_sector(bio));