• Christoph Hellwig's avatar
    raid5-cache: free I/O units earlier · 17036461
    Christoph Hellwig authored
    There is no good reason to keep the I/O unit structures around after the
    stripe has been written back to the RAID array.  The only information
    we need is the log sequence number, and the checkpoint offset of the
    highest successfull writeback.  Store those in the log structure, and
    free the IO units from __r5l_stripe_write_finished.
    
    Besides simplifying the code this also avoid having to keep the allocation
    for the I/O unit around for a potentially long time as superblock updates
    that checkpoint the log do not happen very often.
    
    This also fixes the previously incorrect calculation of 'free' in
    r5l_do_reclaim as a side effect: previous if took the last unit which
    isn't checkpointed into account.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarShaohua Li <shli@fb.com>
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    17036461
raid5-cache.c 29.6 KB