UBI: Fastmap: Make ubi_refill_pools() fair
authorRichard Weinberger <richard@nod.at>
Mon, 10 Nov 2014 14:39:17 +0000 (15:39 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 26 Mar 2015 21:17:47 +0000 (22:17 +0100)
Currently ubi_refill_pools() first fills the first and then
the second one.
If only very few free PEBs are available the second pool can get
zero PEBs.
Change ubi_refill_pools() to distribute free PEBs fair between
all pools.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Guido Martínez <guido@vanguardiasur.com.ar>
drivers/mtd/ubi/wl.c

Simple merge