Commit Message

This patch implements fallocate's FALLOC_FL_INSERT_RANGE for XFS.
1) Make sure that both offset and len are block size aligned.
2) Update the i_size of inode by len bytes.
3) Compute the file's logical block number against offset. If the computed
block number is not the starting block of the extent, split the extent
such that the block number is the starting block of the extent.
4) Shift all the extents which are lying bewteen [offset, last allocated extent]
towards right by len bytes. This step will make a hole of len bytes
at offset.
5) Allocate unwritten extents for the hole created in step 4.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
---
fs/xfs/xfs_bmap.c | 372 ++++++++++++++++++++++++++++++++++++++++++++++++-
fs/xfs/xfs_bmap.h | 9 +-
fs/xfs/xfs_bmap_util.c | 129 ++++++++++++++++-
fs/xfs/xfs_bmap_util.h | 2 +
fs/xfs/xfs_file.c | 37 ++++-
fs/xfs/xfs_trace.h | 1 +
6 files changed, 545 insertions(+), 5 deletions(-)