aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-10 16:19:33 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:01 -0400
commitf29844623de29a12358d7fba35d0959465b64adf (patch)
tree0268addb1a152cc1dbfdef1a50e32d6a7e97bdcf /fs/btrfs/volumes.c
parent16432985920f3c45af82da214e2498f3e2f9066b (diff)
Btrfs: Write out all super blocks on commit, and bring back proper barrier support
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3b927f698320..07d43553141c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -125,6 +125,7 @@ static int device_list_add(const char *path,
125 return -ENOMEM; 125 return -ENOMEM;
126 } 126 }
127 device->devid = devid; 127 device->devid = devid;
128 device->barriers = 1;
128 device->name = kstrdup(path, GFP_NOFS); 129 device->name = kstrdup(path, GFP_NOFS);
129 if (!device->name) { 130 if (!device->name) {
130 kfree(device); 131 kfree(device);
@@ -208,6 +209,7 @@ int btrfs_scan_one_device(const char *path, int flags, void *holder,
208 struct buffer_head *bh; 209 struct buffer_head *bh;
209 int ret; 210 int ret;
210 u64 devid; 211 u64 devid;
212 u64 transid;
211 213
212 mutex_lock(&uuid_mutex); 214 mutex_lock(&uuid_mutex);
213 215
@@ -236,14 +238,14 @@ int btrfs_scan_one_device(const char *path, int flags, void *holder,
236 goto error_brelse; 238 goto error_brelse;
237 } 239 }
238 devid = le64_to_cpu(disk_super->dev_item.devid); 240 devid = le64_to_cpu(disk_super->dev_item.devid);
239 printk("found device %Lu on %s\n", devid, path); 241 transid = btrfs_super_generation(disk_super);
242 printk("found device %Lu transid %Lu on %s\n", devid, transid, path);
240 ret = device_list_add(path, disk_super, devid, fs_devices_ret); 243 ret = device_list_add(path, disk_super, devid, fs_devices_ret);
241 244
242error_brelse: 245error_brelse:
243 brelse(bh); 246 brelse(bh);
244error_close: 247error_close:
245 close_bdev_excl(bdev); 248 close_bdev_excl(bdev);
246 printk("scan one closes bdev %s\n", path);
247error: 249error:
248 mutex_unlock(&uuid_mutex); 250 mutex_unlock(&uuid_mutex);
249 return ret; 251 return ret;
@@ -1143,7 +1145,7 @@ static int read_one_dev(struct btrfs_root *root,
1143 device = btrfs_find_device(root, devid); 1145 device = btrfs_find_device(root, devid);
1144 if (!device) { 1146 if (!device) {
1145 printk("warning devid %Lu not found already\n", devid); 1147 printk("warning devid %Lu not found already\n", devid);
1146 device = kmalloc(sizeof(*device), GFP_NOFS); 1148 device = kzalloc(sizeof(*device), GFP_NOFS);
1147 if (!device) 1149 if (!device)
1148 return -ENOMEM; 1150 return -ENOMEM;
1149 list_add(&device->dev_list, 1151 list_add(&device->dev_list,