]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate
authorNamjae Jeon <namjae.jeon@samsung.com>
Sun, 23 Feb 2014 23:58:19 +0000 (10:58 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 23 Feb 2014 23:58:19 +0000 (10:58 +1100)
commitfc18a41fe7871e8bcd8fdfa024c1c36bf31a2952
treeec95b7acd9f3182e683ea16fab40092d9f038ec6
parent189141a0eebfbeebc4680b504e281dec8e2174cb
xfs: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate

This patch implements fallocate's FALLOC_FL_COLLAPSE_RANGE for XFS.

The semantics of this flag are 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.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_bmap.c
fs/xfs/xfs_bmap.h
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_bmap_util.h
fs/xfs/xfs_file.c
fs/xfs/xfs_trace.h