block/null_blk: Fix completion processing from LIFO to FIFO
authorShlomo Pongratz <shlomop@mellanox.com>
Wed, 25 Jun 2014 19:42:29 +0000 (13:42 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:46 +0000 (12:54 -0600)
commite867a74eafafc7a0bffdc123901612df14f83e6a
tree2d4d56cca88511956c6745f5af01dd0da16021c9
parentc163d13fbc9f8b914d25543e4e3284aec5e76e44
block/null_blk: Fix completion processing from LIFO to FIFO

The completion queue is implemented using lockless list.

The llist_add is adds the events to the list head which is a push operation.
The processing of the completion elements is done by disconnecting all the
pushed elements and iterating over the disconnected list. The problem is
that the processing is done in reverse order w.r.t order of the insertion
i.e. LIFO processing. By reversing the disconnected list which is done in
linear time the desired FIFO processing is achieved.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/null_blk.c