• Chao Yu's avatar
    f2fs: support FALLOC_FL_COLLAPSE_RANGE · b4ace337
    Chao Yu authored
    Now, FALLOC_FL_COLLAPSE_RANGE flag in ->fallocate is supported in ext4/xfs.
    In commit, the semantics of this flag is descripted as following:"
    1) It collapses the range lying between offset and length by removing any
       data blocks which are present in this range and than updates all the
       logical offsets of extents beyond "offset + len" to nullify the hole
       created by removing blocks. In short, it does not leave a hole.
    2) It should be used exclusively. No other fallocate flag in combination.
    3) Offset and length supplied to fallocate should be fs block size aligned
       in case of xfs and ext4.
    4) Collaspe range does not work beyond i_size."
    This patch implements fallocate's FALLOC_FL_COLLAPSE_RANGE for f2fs.
    Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
file.c 30 KB