aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2008-10-30 14:25:28 -0400
committerChris Mason <chris.mason@oracle.com>2008-10-30 14:25:28 -0400
commitd899e05215178fed903ad0e7fc1cb4d8e0cc0a88 (patch)
tree2969e3558f5c50ec0f9ac4201099c0d5d1d6e2c2 /fs/btrfs/ctree.h
parent80ff385665b7fca29fefe358a60ab0d09f9b8e87 (diff)
Btrfs: Add fallocate support v2
This patch updates btrfs-progs for fallocate support. fallocate is a little different in Btrfs because we need to tell the COW system that a given preallocated extent doesn't need to be cow'd as long as there are no snapshots of it. This leverages the -o nodatacow checks. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 8bf6a085a730..d5ba3d1aaf9a 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -462,8 +462,9 @@ struct btrfs_root_item {
462 u8 level; 462 u8 level;
463} __attribute__ ((__packed__)); 463} __attribute__ ((__packed__));
464 464
465#define BTRFS_FILE_EXTENT_REG 0 465#define BTRFS_FILE_EXTENT_INLINE 0
466#define BTRFS_FILE_EXTENT_INLINE 1 466#define BTRFS_FILE_EXTENT_REG 1
467#define BTRFS_FILE_EXTENT_PREALLOC 2
467 468
468struct btrfs_file_extent_item { 469struct btrfs_file_extent_item {
469 /* 470 /*
@@ -868,6 +869,7 @@ struct btrfs_root {
868#define BTRFS_INODE_NODATACOW (1 << 1) 869#define BTRFS_INODE_NODATACOW (1 << 1)
869#define BTRFS_INODE_READONLY (1 << 2) 870#define BTRFS_INODE_READONLY (1 << 2)
870#define BTRFS_INODE_NOCOMPRESS (1 << 3) 871#define BTRFS_INODE_NOCOMPRESS (1 << 3)
872#define BTRFS_INODE_PREALLOC (1 << 4)
871#define btrfs_clear_flag(inode, flag) (BTRFS_I(inode)->flags &= \ 873#define btrfs_clear_flag(inode, flag) (BTRFS_I(inode)->flags &= \
872 ~BTRFS_INODE_##flag) 874 ~BTRFS_INODE_##flag)
873#define btrfs_set_flag(inode, flag) (BTRFS_I(inode)->flags |= \ 875#define btrfs_set_flag(inode, flag) (BTRFS_I(inode)->flags |= \
@@ -1924,6 +1926,9 @@ extern struct file_operations btrfs_file_operations;
1924int btrfs_drop_extents(struct btrfs_trans_handle *trans, 1926int btrfs_drop_extents(struct btrfs_trans_handle *trans,
1925 struct btrfs_root *root, struct inode *inode, 1927 struct btrfs_root *root, struct inode *inode,
1926 u64 start, u64 end, u64 inline_limit, u64 *hint_block); 1928 u64 start, u64 end, u64 inline_limit, u64 *hint_block);
1929int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
1930 struct btrfs_root *root,
1931 struct inode *inode, u64 start, u64 end);
1927int btrfs_release_file(struct inode *inode, struct file *file); 1932int btrfs_release_file(struct inode *inode, struct file *file);
1928 1933
1929/* tree-defrag.c */ 1934/* tree-defrag.c */