summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason2007-12-18 02:14:01 +0100
committerChris Mason2008-09-25 17:03:58 +0200
commitbe20aa9dbadc8c06283784ee12bbc0d97dea3418 (patch)
tree52bd8b7e21b36d10dbb48f8b163eea992c9cfd4a /fs/btrfs/ctree.h
parentBtrfs: Add mount -o nodatasum to turn of file data checksumming (diff)
downloadkernel-qcow2-linux-be20aa9dbadc8c06283784ee12bbc0d97dea3418.tar.gz
kernel-qcow2-linux-be20aa9dbadc8c06283784ee12bbc0d97dea3418.tar.xz
kernel-qcow2-linux-be20aa9dbadc8c06283784ee12bbc0d97dea3418.zip
Btrfs: Add mount option to turn off data cow
A number of workloads do not require copy on write data or checksumming. mount -o nodatasum to disable checksums and -o nodatacow to disable both copy on write and checksumming. In nodatacow mode, copy on write is still performed when a given extent is under snapshot. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 5e255cabfd10..b51b021fff85 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -431,6 +431,7 @@ struct btrfs_root {
#define BTRFS_STRING_ITEM_KEY 253
#define BTRFS_MOUNT_NODATASUM 0x1
+#define BTRFS_MOUNT_NODATACOW 0x2
#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
@@ -915,6 +916,9 @@ static inline u32 btrfs_level_size(struct btrfs_root *root, int level) {
btrfs_item_offset_nr(leaf, slot)))
/* extent-tree.c */
+u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
+ struct btrfs_path *count_path,
+ u64 first_extent);
int btrfs_extent_post_op(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
int btrfs_copy_pinned(struct btrfs_root *root, struct extent_map_tree *copy);
@@ -974,6 +978,10 @@ int btrfs_cow_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct extent_buffer *buf,
struct extent_buffer *parent, int parent_slot,
struct extent_buffer **cow_ret);
+int btrfs_copy_root(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root,
+ struct extent_buffer *buf,
+ struct extent_buffer **cow_ret, u64 new_root_objectid);
int btrfs_extend_item(struct btrfs_trans_handle *trans, struct btrfs_root
*root, struct btrfs_path *path, u32 data_size);
int btrfs_truncate_item(struct btrfs_trans_handle *trans,