Since discard requests are not as common as read and write requests mark REQ_OP_DISCARD condition unlikely in the null_handle_rq() and null_handle_bio(). Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx> --- drivers/block/null_blk_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 99328ded60d1..cbbbb89e89ab 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c @@ -1061,7 +1061,7 @@ static int null_handle_rq(struct nullb_cmd *cmd) sector = blk_rq_pos(rq); - if (req_op(rq) == REQ_OP_DISCARD) { + if (unlikely(req_op(rq) == REQ_OP_DISCARD)) { null_handle_discard(nullb, sector, blk_rq_bytes(rq)); return 0; } @@ -1095,7 +1095,7 @@ static int null_handle_bio(struct nullb_cmd *cmd) sector = bio->bi_iter.bi_sector; - if (bio_op(bio) == REQ_OP_DISCARD) { + if (unlikely(bio_op(bio) == REQ_OP_DISCARD)) { null_handle_discard(nullb, sector, bio_sectors(bio) << SECTOR_SHIFT); return 0; -- 2.17.0