aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ext4_fs_extents.h
diff options
context:
space:
mode:
authorAmit Arora <aarora@in.ibm.com>2007-07-17 21:42:41 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-07-17 21:42:41 -0400
commita2df2a63407803a833f82e1fa6693826c8c9d584 (patch)
treedb761e8d82dbbe53e166511a9f8af9162541a212 /include/linux/ext4_fs_extents.h
parent97ac73506c0ba93f30239bb57b4cfc5d73e68a62 (diff)
downloadkernel_samsung_smdk4412-a2df2a63407803a833f82e1fa6693826c8c9d584.zip
kernel_samsung_smdk4412-a2df2a63407803a833f82e1fa6693826c8c9d584.tar.gz
kernel_samsung_smdk4412-a2df2a63407803a833f82e1fa6693826c8c9d584.tar.bz2
fallocate support in ext4
This patch implements ->fallocate() inode operation in ext4. With this patch users of ext4 file systems will be able to use fallocate() system call for persistent preallocation. Current implementation only supports preallocation for regular files (directories not supported as of date) with extent maps. This patch does not support block-mapped files currently. Only FALLOC_ALLOCATE and FALLOC_RESV_SPACE modes are being supported as of now. Signed-off-by: Amit Arora <aarora@in.ibm.com>
Diffstat (limited to 'include/linux/ext4_fs_extents.h')
-rw-r--r--include/linux/ext4_fs_extents.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index acfe597..e3d5afc 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -188,6 +188,21 @@ ext4_ext_invalidate_cache(struct inode *inode)
EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO;
}
+static inline void ext4_ext_mark_uninitialized(struct ext4_extent *ext)
+{
+ ext->ee_len |= cpu_to_le16(0x8000);
+}
+
+static inline int ext4_ext_is_uninitialized(struct ext4_extent *ext)
+{
+ return (int)(le16_to_cpu((ext)->ee_len) & 0x8000);
+}
+
+static inline int ext4_ext_get_actual_len(struct ext4_extent *ext)
+{
+ return (int)(le16_to_cpu((ext)->ee_len) & 0x7FFF);
+}
+
extern int ext4_extent_tree_init(handle_t *, struct inode *);
extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);