UBI: correct ubi_wl_flush locking
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thu, 7 Jun 2012 12:15:30 +0000 (15:15 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thu, 7 Jun 2012 12:22:21 +0000 (15:22 +0300)
commit12027f1b3fd69a4e9017e6b13c72547a99c6cf54
tree19b7b41b12f4c1eb0a0efdbd494c58e2381e1dd9
parent818039c7d597db3b1d30964a8f9489ac42c0642d
UBI: correct ubi_wl_flush locking

Commit "62f38455 UBI: modify ubi_wl_flush function to clear work queue for a lnum"
takes the 'work_sem' semaphore in write mode for the entire loop, which is not
very good because it will block other workers for potentially long time. We do
not need to have it in write mode - read mode is enough, and we do not need to
hole it over the entire loop. So this patch turns changes the locking: takes
'work_sem' in read mode and pushes it down to the loop.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/ubi/wl.c