[JFFS2] Reduce time for which erase_free_sem is held during erase.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Tue, 26 Jun 2007 23:24:09 +0000 (01:24 +0200)
committerDavid Woodhouse <dwmw2@infradead.org>
Thu, 28 Jun 2007 18:02:15 +0000 (19:02 +0100)
commitd364fb18cd991734eb54aa8840e70030b0c9f699
treed007845c788cb2a5b2d35ab01fc38a944e36c087
parentf79c44980aae3f50fe73e50789641df265953cc6
[JFFS2] Reduce time for which erase_free_sem is held during erase.

With current desing erase_free_sem is locked every time the flash
block is being erased. For NOR flashes - ~1 second is needed to erase
single flash block. In the worst case scenario erase_free_sem may be
locked for a couple of seconds when the number of blocks is being
erased (e.g. after large file was removed). When erase_free_sem is
locked all read/write operations for given JFFS2 partition are locked
too - in effect from time to time access to the JFFS2 partition is
locked for a number of seconds. This fix makes critical section in
flash erasing procedure shorter - now erase_free_sem is locked around
erase_completion_lock spinlock only.

Originally from Radoslaw Bisewski
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
fs/jffs2/erase.c