aboutsummaryrefslogtreecommitdiff
path: root/include/linux/ext4_fs.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.h
parent97ac73506c0ba93f30239bb57b4cfc5d73e68a62 (diff)
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.h')
-rw-r--r--include/linux/ext4_fs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index de1f9f78625..87c2d7a05b0 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -102,6 +102,7 @@
EXT4_GOOD_OLD_FIRST_INO : \
(s)->s_first_ino)
#endif
+#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
/*
* Macro-instructions used to manage fragments
@@ -225,6 +226,11 @@ struct ext4_new_group_data {
__u32 free_blocks_count;
};
+/*
+ * Following is used by preallocation code to tell get_blocks() that we
+ * want uninitialzed extents.
+ */
+#define EXT4_CREATE_UNINITIALIZED_EXT 2
/*
* ioctl commands
@@ -983,6 +989,8 @@ extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
extern void ext4_ext_truncate(struct inode *, struct page *);
extern void ext4_ext_init(struct super_block *);
extern void ext4_ext_release(struct super_block *);
+extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
+ loff_t len);
static inline int
ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
unsigned long max_blocks, struct buffer_head *bh,