]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate
authorNamjae Jeon <namjae.jeon@samsung.com>
Sun, 23 Feb 2014 20:18:59 +0000 (15:18 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 23 Feb 2014 20:18:59 +0000 (15:18 -0500)
commit6033aab64c51881645f65fb2ed9e7def63081899
treef6a7c5c7c3de4cae54c9453d3457a0504e9aa070
parent9f23264054087f47fa4fd204c0a8bf08ee183074
ext4: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate

This patch implements fallocate's FALLOC_FL_COLLAPSE_RANGE for Ext4.

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>
Tested-by: Dongsu Park <dongsu.park@profitbricks.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/move_extent.c
include/trace/events/ext4.h