37cf025 libgfs2: Superblock building and writing improvements

Authored and Committed by andyp 10 years ago
    libgfs2: Superblock building and writing improvements
    
    build_sb was creating the sb, setting its fields from an sdp and then
    writing it, and also zeroing the gap before the sb on the device in a
    block-by-block way using buffer_heads.
    
    This patch splits the build_sb function into lgfs2_sb_init and
    lgfs2_sb_write which operate on gfs2_sb structures instead of gfs2_sbds.
    lgfs2_sb_write now uses pwritev to zero the initial blocks and write the
    sb to an fd.
    
    get_random_bytes has been moved into structures.c and made static as
    only lgfs2_sb_init now uses it.
    
    Resolves: rhbz#1063842
    
    Signed-off-by: Andrew Price <anprice@redhat.com>
    
        
file modified
+2 -1
file modified
+2 -1
file modified
+8 -6
file modified
+4 -4
file modified
+0 -45
file modified
+4 -5
file modified
+90 -30
file modified
+0 -12
file modified
+22 -10