[PATCHv2 2/3] block: introduce rq_list_move
Christoph Hellwig
hch at lst.de
Wed Dec 29 09:41:09 PST 2021
On Mon, Dec 27, 2021 at 08:41:37AM -0800, Keith Busch wrote:
> +/**
> + * 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);
> +}
Do we even need the nxt argument? I think it should always be
rq->rq_next?
Also I'd spell out prev and next for a little more readability.
More information about the Linux-nvme
mailing list