aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2014-02-23 15:18:59 -0500
committerTheodore Ts'o <tytso@mit.edu>2014-02-23 15:18:59 -0500
commit9eb79482a97152930b113b51dff530aba9e28c8e (patch)
treef6a7c5c7c3de4cae54c9453d3457a0504e9aa070 /fs/ext4/ext4.h
parenta633f5a319cf4116d977e25fea2830dce23a8e74 (diff)
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>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b7207db3107c..beec42750a8c 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2758,6 +2758,7 @@ extern int ext4_find_delalloc_cluster(struct inode *inode, ext4_lblk_t lblk);
2758extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, 2758extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
2759 __u64 start, __u64 len); 2759 __u64 start, __u64 len);
2760extern int ext4_ext_precache(struct inode *inode); 2760extern int ext4_ext_precache(struct inode *inode);
2761extern int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len);
2761 2762
2762/* move_extent.c */ 2763/* move_extent.c */
2763extern void ext4_double_down_write_data_sem(struct inode *first, 2764extern void ext4_double_down_write_data_sem(struct inode *first,
@@ -2767,6 +2768,8 @@ extern void ext4_double_up_write_data_sem(struct inode *orig_inode,
2767extern int ext4_move_extents(struct file *o_filp, struct file *d_filp, 2768extern int ext4_move_extents(struct file *o_filp, struct file *d_filp,
2768 __u64 start_orig, __u64 start_donor, 2769 __u64 start_orig, __u64 start_donor,
2769 __u64 len, __u64 *moved_len); 2770 __u64 len, __u64 *moved_len);
2771extern int mext_next_extent(struct inode *inode, struct ext4_ext_path *path,
2772 struct ext4_extent **extent);
2770 2773
2771/* page-io.c */ 2774/* page-io.c */
2772extern int __init ext4_init_pageio(void); 2775extern int __init ext4_init_pageio(void);