diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 550996cf419c68..0efa25abcc1c88 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -216,6 +216,25 @@ static inline unsigned short req_get_ioprio(struct request *req) #define rq_dma_dir(rq) \ (op_is_write(req_op(rq)) ? DMA_TO_DEVICE : DMA_FROM_DEVICE) +/** + * rq_list_move() - move a struct request from one list to another + * @src: The source list @rq is currently in + * @dst: The destination list that @rq will be appended to + * @rq: The request to move + * @prv: The request preceding @rq in @src (NULL if @rq is the head) + * @nxt: The request following @rq in @src (NULL if @rq is the tail) + */ +static void inline rq_list_move(struct request **src, struct request **dst, + struct request *rq, struct request *prv, + struct request *nxt) +{ + if (prv) + prv->rq_next = nxt; + else + *src = nxt; + rq_list_add(dst, rq); +} + enum blk_eh_timer_return { BLK_EH_DONE, /* drivers has completed the command */ BLK_EH_RESET_TIMER, /* reset timer and try again */