aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-12-14 15:30:32 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commitb6cda9bcb4df7544c67fc3548a53bc1607d59f46 (patch)
tree2bae71b1c9eca52bf1e37ca1b3bdd4525e0a43fd /fs/btrfs/ctree.h
parente9906a98497c26a3c1a7532b51b81cc1fbdf9e1d (diff)
Btrfs: Add mount -o nodatasum to turn of file data checksumming
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 052555ced44d..5e255cabfd10 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -321,6 +321,7 @@ struct btrfs_fs_info {
321 321
322 u64 generation; 322 u64 generation;
323 u64 last_trans_committed; 323 u64 last_trans_committed;
324 unsigned long mount_opt;
324 struct btrfs_transaction *running_transaction; 325 struct btrfs_transaction *running_transaction;
325 struct btrfs_super_block super_copy; 326 struct btrfs_super_block super_copy;
326 struct extent_buffer *sb_buffer; 327 struct extent_buffer *sb_buffer;
@@ -429,6 +430,13 @@ struct btrfs_root {
429 */ 430 */
430#define BTRFS_STRING_ITEM_KEY 253 431#define BTRFS_STRING_ITEM_KEY 253
431 432
433#define BTRFS_MOUNT_NODATASUM 0x1
434
435#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
436#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
437#define btrfs_test_opt(root, opt) ((root)->fs_info->mount_opt & \
438 BTRFS_MOUNT_##opt)
439
432/* some macros to generate set/get funcs for the struct fields. This 440/* some macros to generate set/get funcs for the struct fields. This
433 * assumes there is a lefoo_to_cpu for every type, so lets make a simple 441 * assumes there is a lefoo_to_cpu for every type, so lets make a simple
434 * one for u8: 442 * one for u8:
@@ -906,12 +914,6 @@ static inline u32 btrfs_level_size(struct btrfs_root *root, int level) {
906 ((unsigned long)(btrfs_leaf_data(leaf) + \ 914 ((unsigned long)(btrfs_leaf_data(leaf) + \
907 btrfs_item_offset_nr(leaf, slot))) 915 btrfs_item_offset_nr(leaf, slot)))
908 916
909/* mount option defines and helpers */
910#define BTRFS_MOUNT_SUBVOL 0x000001
911#define btrfs_clear_opt(o, opt) o &= ~BTRFS_MOUNT_##opt
912#define btrfs_set_opt(o, opt) o |= BTRFS_MOUNT_##opt
913#define btrfs_test_opt(sb, opt) (BTRFS_SB(sb)->s_mount_opt & \
914 BTRFS_MOUNT_##opt)
915/* extent-tree.c */ 917/* extent-tree.c */
916int btrfs_extent_post_op(struct btrfs_trans_handle *trans, 918int btrfs_extent_post_op(struct btrfs_trans_handle *trans,
917 struct btrfs_root *root); 919 struct btrfs_root *root);