aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-18 10:29:49 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:02 -0400
commit7ae9c09d8f001eb19ee2ba219dc5c3d4f6d60614 (patch)
tree9ad3de27fec0d73f145e8e9f9dd7a89851ae85bc /fs/btrfs/volumes.c
parenta443755f1ca3e190e12e3a845ddecb3ee1782512 (diff)
Btrfs: Add support for labels in the super block
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c17
1 files changed, 9 insertions, 8 deletions
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
252error_brelse: 253error_brelse: