Skip to content

Commit f6f99c4

Browse files
calebsanderkawasaki
authored andcommitted
ublk: optimize ublk_rq_has_data()
ublk_rq_has_data() currently uses bio_has_data(), which involves 2 indirections and several branches. Use blk_rq_bytes() instead, which performs a single indirection with no branches. Signed-off-by: Caleb Sander Mateos <[email protected]>
1 parent 3b54e52 commit f6f99c4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/block/ublk_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ static inline struct ublk_queue *ublk_get_queue(struct ublk_device *dev,
11741174

11751175
static inline bool ublk_rq_has_data(const struct request *rq)
11761176
{
1177-
return bio_has_data(rq->bio);
1177+
return blk_rq_bytes(rq);
11781178
}
11791179

11801180
static inline struct ublksrv_io_desc *

0 commit comments

Comments
 (0)