aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-03-24 15:02:07 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:01 -0400
commit0d81ba5dbedef0c3970d6aa318aa84920943e6e3 (patch)
tree2c5256b4a4e4d544add986e654db56e660f4fb12 /fs/btrfs/ctree.h
parente085def2c4cc2d7c0c316376b4b66b86b10e3a4b (diff)
Btrfs: Move device information into the super block so it can be scanned
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 285fb7e46106..96a493217860 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -150,21 +150,11 @@ struct btrfs_dev_item {
150 /* minimal io size for this device */ 150 /* minimal io size for this device */
151 __le32 sector_size; 151 __le32 sector_size;
152 152
153 /* the kernel device number */
154 __le64 rdev;
155
156 /* type and info about this device */ 153 /* type and info about this device */
157 __le64 type; 154 __le64 type;
158 155
159 /* partition number, 0 for whole dev */ 156 /* btrfs generated uuid for this device */
160 __le32 partition;
161
162 /* length of the name data at the end of the item */
163 __le16 name_len;
164
165 /* physical drive uuid (or lvm uuid) */
166 u8 uuid[BTRFS_DEV_UUID_SIZE]; 157 u8 uuid[BTRFS_DEV_UUID_SIZE];
167 /* name goes here */
168} __attribute__ ((__packed__)); 158} __attribute__ ((__packed__));
169 159
170struct btrfs_stripe { 160struct btrfs_stripe {
@@ -255,6 +245,7 @@ struct btrfs_super_block {
255 __le32 sys_chunk_array_size; 245 __le32 sys_chunk_array_size;
256 u8 root_level; 246 u8 root_level;
257 u8 chunk_root_level; 247 u8 chunk_root_level;
248 struct btrfs_dev_item dev_item;
258 u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE]; 249 u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
259} __attribute__ ((__packed__)); 250} __attribute__ ((__packed__));
260 251
@@ -685,20 +676,12 @@ BTRFS_SETGET_FUNCS(device_io_align, struct btrfs_dev_item, io_align, 32);
685BTRFS_SETGET_FUNCS(device_io_width, struct btrfs_dev_item, io_width, 32); 676BTRFS_SETGET_FUNCS(device_io_width, struct btrfs_dev_item, io_width, 32);
686BTRFS_SETGET_FUNCS(device_sector_size, struct btrfs_dev_item, sector_size, 32); 677BTRFS_SETGET_FUNCS(device_sector_size, struct btrfs_dev_item, sector_size, 32);
687BTRFS_SETGET_FUNCS(device_id, struct btrfs_dev_item, devid, 64); 678BTRFS_SETGET_FUNCS(device_id, struct btrfs_dev_item, devid, 64);
688BTRFS_SETGET_FUNCS(device_rdev, struct btrfs_dev_item, rdev, 64);
689BTRFS_SETGET_FUNCS(device_partition, struct btrfs_dev_item, partition, 32);
690BTRFS_SETGET_FUNCS(device_name_len, struct btrfs_dev_item, name_len, 16);
691 679
692static inline char *btrfs_device_uuid(struct btrfs_dev_item *d) 680static inline char *btrfs_device_uuid(struct btrfs_dev_item *d)
693{ 681{
694 return (char *)d + offsetof(struct btrfs_dev_item, uuid); 682 return (char *)d + offsetof(struct btrfs_dev_item, uuid);
695} 683}
696 684
697static inline char *btrfs_device_name(struct btrfs_dev_item *d)
698{
699 return (char *)(d + 1);
700}
701
702BTRFS_SETGET_FUNCS(chunk_owner, struct btrfs_chunk, owner, 64); 685BTRFS_SETGET_FUNCS(chunk_owner, struct btrfs_chunk, owner, 64);
703BTRFS_SETGET_FUNCS(chunk_stripe_len, struct btrfs_chunk, stripe_len, 64); 686BTRFS_SETGET_FUNCS(chunk_stripe_len, struct btrfs_chunk, stripe_len, 64);
704BTRFS_SETGET_FUNCS(chunk_io_align, struct btrfs_chunk, io_align, 32); 687BTRFS_SETGET_FUNCS(chunk_io_align, struct btrfs_chunk, io_align, 32);