• Qu Wenruo's avatar
    btrfs: qgroup: Introduce functions to release/free qgroup reserve data · f695fdce
    Qu Wenruo authored
    space
    
    Introduce functions btrfs_qgroup_release/free_data() to release/free
    reserved data range.
    
    Release means, just remove the data range from io_tree, but doesn't
    free the reserved space.
    This is for normal buffered write case, when data is written into disc
    and its metadata is added into tree, its reserved space should still be
    kept until commit_trans().
    So in that case, we only release dirty range, but keep the reserved
    space recorded some other place until commit_tran().
    
    Free means not only remove data range, but also free reserved space.
    This is used for case for cleanup and invalidate page.
    Signed-off-by: default avatarQu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    f695fdce
qgroup.c 63.5 KB