1107036 gfs2_jadd: Don't fsync after each block written

Authored and Committed by andyp 3 years ago
    gfs2_jadd: Don't fsync after each block written
    
    gfs2_jadd has always called fsync() after writing each block of the
    journal. There doesn't seem to be any need for that so take the fsync()
    call out of the loop.
    
    Add an additional fsync() after preallocation to make sure we're in good
    shape before writing the log headers.
    
    In my tests this reduces the time to add one journal from 5 minutes to
    9 seconds.
    
    Resolves: rhbz#1942434
    
    Signed-off-by: Andrew Price <anprice@redhat.com>
    
        
file modified
+10 -5