diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-03-24 15:02:07 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | 8a4b83cc8bd75fca29ac68615896d9e92820e7c2 (patch) | |
tree | b7f99cf53c322665b78cca10742cc734ad070729 /fs/btrfs/ctree.h | |
parent | 239b14b32dc39232ebf9cce29ff77c4c564355fd (diff) |
Btrfs: Add support for device scanning and detection ioctls
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index acf22ad6115c..7556f8319c60 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -37,7 +37,7 @@ extern struct kmem_cache *btrfs_transaction_cachep; | |||
37 | extern struct kmem_cache *btrfs_bit_radix_cachep; | 37 | extern struct kmem_cache *btrfs_bit_radix_cachep; |
38 | extern struct kmem_cache *btrfs_path_cachep; | 38 | extern struct kmem_cache *btrfs_path_cachep; |
39 | 39 | ||
40 | #define BTRFS_MAGIC "_B4RfS_M" | 40 | #define BTRFS_MAGIC "_B5RfS_M" |
41 | 41 | ||
42 | #define BTRFS_MAX_LEVEL 8 | 42 | #define BTRFS_MAX_LEVEL 8 |
43 | 43 | ||
@@ -238,6 +238,7 @@ struct btrfs_super_block { | |||
238 | __le64 total_bytes; | 238 | __le64 total_bytes; |
239 | __le64 bytes_used; | 239 | __le64 bytes_used; |
240 | __le64 root_dir_objectid; | 240 | __le64 root_dir_objectid; |
241 | __le64 num_devices; | ||
241 | __le32 sectorsize; | 242 | __le32 sectorsize; |
242 | __le32 nodesize; | 243 | __le32 nodesize; |
243 | __le32 leafsize; | 244 | __le32 leafsize; |
@@ -440,6 +441,7 @@ struct btrfs_block_group_cache { | |||
440 | }; | 441 | }; |
441 | 442 | ||
442 | struct btrfs_device; | 443 | struct btrfs_device; |
444 | struct btrfs_fs_devices; | ||
443 | struct btrfs_fs_info { | 445 | struct btrfs_fs_info { |
444 | u8 fsid[BTRFS_FSID_SIZE]; | 446 | u8 fsid[BTRFS_FSID_SIZE]; |
445 | struct btrfs_root *extent_root; | 447 | struct btrfs_root *extent_root; |
@@ -489,7 +491,7 @@ struct btrfs_fs_info { | |||
489 | u64 total_pinned; | 491 | u64 total_pinned; |
490 | struct list_head dirty_cowonly_roots; | 492 | struct list_head dirty_cowonly_roots; |
491 | 493 | ||
492 | struct list_head devices; | 494 | struct btrfs_fs_devices *fs_devices; |
493 | struct list_head space_info; | 495 | struct list_head space_info; |
494 | spinlock_t delalloc_lock; | 496 | spinlock_t delalloc_lock; |
495 | spinlock_t new_trans_lock; | 497 | spinlock_t new_trans_lock; |
@@ -677,6 +679,19 @@ BTRFS_SETGET_FUNCS(device_io_width, struct btrfs_dev_item, io_width, 32); | |||
677 | BTRFS_SETGET_FUNCS(device_sector_size, struct btrfs_dev_item, sector_size, 32); | 679 | BTRFS_SETGET_FUNCS(device_sector_size, struct btrfs_dev_item, sector_size, 32); |
678 | BTRFS_SETGET_FUNCS(device_id, struct btrfs_dev_item, devid, 64); | 680 | BTRFS_SETGET_FUNCS(device_id, struct btrfs_dev_item, devid, 64); |
679 | 681 | ||
682 | BTRFS_SETGET_STACK_FUNCS(stack_device_type, struct btrfs_dev_item, type, 64); | ||
683 | BTRFS_SETGET_STACK_FUNCS(stack_device_total_bytes, struct btrfs_dev_item, | ||
684 | total_bytes, 64); | ||
685 | BTRFS_SETGET_STACK_FUNCS(stack_device_bytes_used, struct btrfs_dev_item, | ||
686 | bytes_used, 64); | ||
687 | BTRFS_SETGET_STACK_FUNCS(stack_device_io_align, struct btrfs_dev_item, | ||
688 | io_align, 32); | ||
689 | BTRFS_SETGET_STACK_FUNCS(stack_device_io_width, struct btrfs_dev_item, | ||
690 | io_width, 32); | ||
691 | BTRFS_SETGET_STACK_FUNCS(stack_device_sector_size, struct btrfs_dev_item, | ||
692 | sector_size, 32); | ||
693 | BTRFS_SETGET_STACK_FUNCS(stack_device_id, struct btrfs_dev_item, devid, 64); | ||
694 | |||
680 | static inline char *btrfs_device_uuid(struct btrfs_dev_item *d) | 695 | static inline char *btrfs_device_uuid(struct btrfs_dev_item *d) |
681 | { | 696 | { |
682 | return (char *)d + offsetof(struct btrfs_dev_item, uuid); | 697 | return (char *)d + offsetof(struct btrfs_dev_item, uuid); |
@@ -1106,6 +1121,8 @@ BTRFS_SETGET_STACK_FUNCS(super_stripesize, struct btrfs_super_block, | |||
1106 | stripesize, 32); | 1121 | stripesize, 32); |
1107 | BTRFS_SETGET_STACK_FUNCS(super_root_dir, struct btrfs_super_block, | 1122 | BTRFS_SETGET_STACK_FUNCS(super_root_dir, struct btrfs_super_block, |
1108 | root_dir_objectid, 64); | 1123 | root_dir_objectid, 64); |
1124 | BTRFS_SETGET_STACK_FUNCS(super_num_devices, struct btrfs_super_block, | ||
1125 | num_devices, 64); | ||
1109 | 1126 | ||
1110 | static inline unsigned long btrfs_leaf_data(struct extent_buffer *l) | 1127 | static inline unsigned long btrfs_leaf_data(struct extent_buffer *l) |
1111 | { | 1128 | { |