]> git.baikalelectronics.ru Git - kernel.git/commit
block/null_blk: Fix completion processing from LIFO to FIFO
authorShlomo Pongratz <shlomop@mellanox.com>
Thu, 6 Feb 2014 16:33:17 +0000 (18:33 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 7 Feb 2014 20:56:07 +0000 (13:56 -0700)
commit8d690a4a5d830b58bca662dff9982b3c0f5ab11f
treef764ae05d916c21bfd06a271b900bfbc9f4316ff
parent4c7a168d06cf107c5ab2b1ce7b09f1746325e929
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