• Bob Peterson's avatar
    gfs2: Wipe jdata and ail1 in gfs2_journal_wipe, formerly gfs2_meta_wipe · 68942870
    Bob Peterson authored
    Before this patch, when blocks were freed, it called gfs2_meta_wipe to
    take the metadata out of the pending journal blocks. It did this mostly
    by calling another function called gfs2_remove_from_journal. This is
    shortsighted because it does not do anything with jdata blocks which
    may also be in the journal.
    
    This patch expands the function so that it wipes out jdata blocks from
    the journal as well, and it wipes it from the ail1 list if it hasn't
    been written back yet. Since it now processes jdata blocks as well,
    the function has been renamed from gfs2_meta_wipe to gfs2_journal_wipe.
    
    New function gfs2_ail1_wipe wants a static view of the ail list, so it
    locks the sd_ail_lock when removing items. To accomplish this, function
    gfs2_remove_from_journal no longer locks the sd_ail_lock, and it's now
    the caller's responsibility to do so.
    
    I was going to make sd_ail_lock locking conditional, but the practice is
    generally frowned upon. For details, see: https://lwn.net/Articles/109066/Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
    Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
    68942870
log.c 34.4 KB