Skip to content

Commit

Permalink
xfs: Add support FALLOC_FL_INSERT_RANGE for fallocate
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Namjae Jeon <[email protected]>
Signed-off-by: Ashish Sangwan <[email protected]>
Reviewed-by: Brian Foster <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Signed-off-by: Dave Chinner <[email protected]>
  • Loading branch information
namjaejeon authored and dchinner committed Mar 25, 2015
1 parent dd46c78 commit a904b1c
Show file tree
Hide file tree
Showing 6 changed files with 461 additions and 83 deletions.
Loading

0 comments on commit a904b1c

Please sign in to comment.