• Joakim Tjernlund's avatar
    [JFFS2] Reduce time for which erase_free_sem is held during erase. · d364fb18
    Joakim Tjernlund authored
    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: default avatarJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
    Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
    d364fb18
erase.c 14.4 KB