• Javier González's avatar
    lightnvm: pblk: take write semaphore on metadata · 253babc3
    Javier González authored
    pblk guarantees write ordering at a chunk level through a per open chunk
    semaphore. At this point, since we only have an open I/O stream for both
    user and GC data, the semaphore is per parallel unit.
    
    For the metadata I/O that is synchronous, the semaphore is not needed as
    ordering is guaranteed. However, if the metadata scheme changes or
    multiple streams are open, this guarantee might not be preserved.
    
    This patch makes sure that all writes go through the semaphore, even for
    synchronous I/O. This is consistent with pblk's write I/O model. It also
    simplifies maintenance since changes in the metadata scheme could cause
    ordering issues.
    Signed-off-by: default avatarJavier González <javier@cnexlabs.com>
    Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    253babc3
pblk.h 39 KB