• Zheng Liu's avatar
    ext4: track all extent status in extent status tree · f7fec032
    Zheng Liu authored
    By recording the phycisal block and status, extent status tree is able
    to track the status of every extents.  When we call _map_blocks
    functions to lookup an extent or create a new written/unwritten/delayed
    extent, this extent will be inserted into extent status tree.
    
    We don't load all extents from disk in alloc_inode() because it costs
    too much memory, and if a file is opened and closed frequently it will
    takes too much time to load all extent information.  So currently when
    we create/lookup an extent, this extent will be inserted into extent
    status tree.  Hence, the extent status tree may not comprehensively
    contain all of the extents found in the file.
    
    Here a condition we need to take care is that an extent might contains
    unwritten and delayed status simultaneously because an extent is delayed
    allocated and could be allocated by fallocate.  At this time we need to
    keep delayed status because later we need to update delayed reservation
    space using it.
    Signed-off-by: default avatarZheng Liu <wenqing.lz@taobao.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    Cc: Jan kara <jack@suse.cz>
    f7fec032
extents.c 132 KB