diff options
-rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index d119d95d139a..f00c4be59ad6 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -247,6 +247,7 @@ struct btrfs_header { | |||
247 | * room to translate 14 chunks with 3 stripes each. | 247 | * room to translate 14 chunks with 3 stripes each. |
248 | */ | 248 | */ |
249 | #define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048 | 249 | #define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048 |
250 | #define BTRFS_LABEL_SIZE 256 | ||
250 | 251 | ||
251 | /* | 252 | /* |
252 | * the super block basically lists the main trees of the FS | 253 | * the super block basically lists the main trees of the FS |
@@ -276,6 +277,7 @@ struct btrfs_super_block { | |||
276 | u8 root_level; | 277 | u8 root_level; |
277 | u8 chunk_root_level; | 278 | u8 chunk_root_level; |
278 | struct btrfs_dev_item dev_item; | 279 | struct btrfs_dev_item dev_item; |
280 | char label[BTRFS_LABEL_SIZE]; | ||
279 | u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE]; | 281 | u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE]; |
280 | } __attribute__ ((__packed__)); | 282 | } __attribute__ ((__packed__)); |
281 | 283 | ||
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index cdf0019cca2e..93aa36e2436e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -57,9 +57,7 @@ int btrfs_cleanup_fs_uuids(void) | |||
57 | devices_cur = fs_devices->devices.next; | 57 | devices_cur = fs_devices->devices.next; |
58 | dev = list_entry(devices_cur, struct btrfs_device, | 58 | dev = list_entry(devices_cur, struct btrfs_device, |
59 | dev_list); | 59 | dev_list); |
60 | printk("uuid cleanup finds %s\n", dev->name); | ||
61 | if (dev->bdev) { | 60 | if (dev->bdev) { |
62 | printk("closing\n"); | ||
63 | close_bdev_excl(dev->bdev); | 61 | close_bdev_excl(dev->bdev); |
64 | } | 62 | } |
65 | list_del(&dev->dev_list); | 63 | list_del(&dev->dev_list); |
@@ -149,7 +147,6 @@ static int device_list_add(const char *path, | |||
149 | } | 147 | } |
150 | if (fs_devices->lowest_devid > devid) { | 148 | if (fs_devices->lowest_devid > devid) { |
151 | fs_devices->lowest_devid = devid; | 149 | fs_devices->lowest_devid = devid; |
152 | printk("lowest devid now %Lu\n", devid); | ||
153 | } | 150 | } |
154 | *fs_devices_ret = fs_devices; | 151 | *fs_devices_ret = fs_devices; |
155 | return 0; | 152 | return 0; |
@@ -166,7 +163,6 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) | |||
166 | device = list_entry(cur, struct btrfs_device, dev_list); | 163 | device = list_entry(cur, struct btrfs_device, dev_list); |
167 | if (device->bdev) { | 164 | if (device->bdev) { |
168 | close_bdev_excl(device->bdev); | 165 | close_bdev_excl(device->bdev); |
169 | printk("close devices closes %s\n", device->name); | ||
170 | } | 166 | } |
171 | device->bdev = NULL; | 167 | device->bdev = NULL; |
172 | } | 168 | } |
@@ -220,11 +216,9 @@ int btrfs_scan_one_device(const char *path, int flags, void *holder, | |||
220 | 216 | ||
221 | mutex_lock(&uuid_mutex); | 217 | mutex_lock(&uuid_mutex); |
222 | 218 | ||
223 | printk("scan one opens %s\n", path); | ||
224 | bdev = open_bdev_excl(path, flags, holder); | 219 | bdev = open_bdev_excl(path, flags, holder); |
225 | 220 | ||
226 | if (IS_ERR(bdev)) { | 221 | if (IS_ERR(bdev)) { |
227 | printk("open failed\n"); | ||
228 | ret = PTR_ERR(bdev); | 222 | ret = PTR_ERR(bdev); |
229 | goto error; | 223 | goto error; |
230 | } | 224 | } |
@@ -240,13 +234,20 @@ int btrfs_scan_one_device(const char *path, int flags, void *holder, | |||
240 | disk_super = (struct btrfs_super_block *)bh->b_data; | 234 | disk_super = (struct btrfs_super_block *)bh->b_data; |
241 | if (strncmp((char *)(&disk_super->magic), BTRFS_MAGIC, | 235 | if (strncmp((char *)(&disk_super->magic), BTRFS_MAGIC, |
242 | sizeof(disk_super->magic))) { | 236 | sizeof(disk_super->magic))) { |
243 | printk("no btrfs found on %s\n", path); | ||
244 | ret = -EINVAL; | 237 | ret = -EINVAL; |
245 | goto error_brelse; | 238 | goto error_brelse; |
246 | } | 239 | } |
247 | devid = le64_to_cpu(disk_super->dev_item.devid); | 240 | devid = le64_to_cpu(disk_super->dev_item.devid); |
248 | transid = btrfs_super_generation(disk_super); | 241 | transid = btrfs_super_generation(disk_super); |
249 | printk("found device %Lu transid %Lu on %s\n", devid, transid, path); | 242 | if (disk_super->label[0]) |
243 | printk("device label %s ", disk_super->label); | ||
244 | else { | ||
245 | /* FIXME, make a readl uuid parser */ | ||
246 | printk("device fsid %llx-%llx ", | ||
247 | *(unsigned long long *)disk_super->fsid, | ||
248 | *(unsigned long long *)(disk_super->fsid + 8)); | ||
249 | } | ||
250 | printk("devid %Lu transid %Lu %s\n", devid, transid, path); | ||
250 | ret = device_list_add(path, disk_super, devid, fs_devices_ret); | 251 | ret = device_list_add(path, disk_super, devid, fs_devices_ret); |
251 | 252 | ||
252 | error_brelse: | 253 | error_brelse: |