aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-01-05 21:25:51 -0500
committerChris Mason <chris.mason@oracle.com>2009-01-05 21:25:51 -0500
commitd397712bcc6a759a560fd247e6053ecae091f958 (patch)
tree9da8daebb870d8b8b1843507c4621715e23dd31a /fs/btrfs/volumes.c
parent1f3c79a28c8837e8572b98f6d14142d9a6133c56 (diff)
Btrfs: Fix checkpatch.pl warnings
There were many, most are fixed now. struct-funcs.c generates some warnings but these are bogus. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 6672adcec9f8..b187b537888e 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -140,7 +140,7 @@ static noinline struct btrfs_fs_devices *find_fsid(u8 *fsid)
140 * the list if the block device is congested. This way, multiple devices 140 * the list if the block device is congested. This way, multiple devices
141 * can make progress from a single worker thread. 141 * can make progress from a single worker thread.
142 */ 142 */
143static int noinline run_scheduled_bios(struct btrfs_device *device) 143static noinline int run_scheduled_bios(struct btrfs_device *device)
144{ 144{
145 struct bio *pending; 145 struct bio *pending;
146 struct backing_dev_info *bdi; 146 struct backing_dev_info *bdi;
@@ -187,7 +187,7 @@ loop:
187 } 187 }
188 spin_unlock(&device->io_lock); 188 spin_unlock(&device->io_lock);
189 189
190 while(pending) { 190 while (pending) {
191 cur = pending; 191 cur = pending;
192 pending = pending->bi_next; 192 pending = pending->bi_next;
193 cur->bi_next = NULL; 193 cur->bi_next = NULL;
@@ -458,7 +458,7 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
458 458
459 bdev = open_bdev_exclusive(device->name, flags, holder); 459 bdev = open_bdev_exclusive(device->name, flags, holder);
460 if (IS_ERR(bdev)) { 460 if (IS_ERR(bdev)) {
461 printk("open %s failed\n", device->name); 461 printk(KERN_INFO "open %s failed\n", device->name);
462 goto error; 462 goto error;
463 } 463 }
464 set_blocksize(bdev, 4096); 464 set_blocksize(bdev, 4096);
@@ -570,14 +570,15 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
570 devid = le64_to_cpu(disk_super->dev_item.devid); 570 devid = le64_to_cpu(disk_super->dev_item.devid);
571 transid = btrfs_super_generation(disk_super); 571 transid = btrfs_super_generation(disk_super);
572 if (disk_super->label[0]) 572 if (disk_super->label[0])
573 printk("device label %s ", disk_super->label); 573 printk(KERN_INFO "device label %s ", disk_super->label);
574 else { 574 else {
575 /* FIXME, make a readl uuid parser */ 575 /* FIXME, make a readl uuid parser */
576 printk("device fsid %llx-%llx ", 576 printk(KERN_INFO "device fsid %llx-%llx ",
577 *(unsigned long long *)disk_super->fsid, 577 *(unsigned long long *)disk_super->fsid,
578 *(unsigned long long *)(disk_super->fsid + 8)); 578 *(unsigned long long *)(disk_super->fsid + 8));
579 } 579 }
580 printk("devid %Lu transid %Lu %s\n", devid, transid, path); 580 printk(KERN_INFO "devid %llu transid %llu %s\n",
581 (unsigned long long)devid, (unsigned long long)transid, path);
581 ret = device_list_add(path, disk_super, devid, fs_devices_ret); 582 ret = device_list_add(path, disk_super, devid, fs_devices_ret);
582 583
583 brelse(bh); 584 brelse(bh);
@@ -683,9 +684,8 @@ no_more_items:
683 goto check_pending; 684 goto check_pending;
684 } 685 }
685 } 686 }
686 if (btrfs_key_type(&key) != BTRFS_DEV_EXTENT_KEY) { 687 if (btrfs_key_type(&key) != BTRFS_DEV_EXTENT_KEY)
687 goto next; 688 goto next;
688 }
689 689
690 start_found = 1; 690 start_found = 1;
691 dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent); 691 dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent);
@@ -1001,14 +1001,16 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
1001 1001
1002 if ((all_avail & BTRFS_BLOCK_GROUP_RAID10) && 1002 if ((all_avail & BTRFS_BLOCK_GROUP_RAID10) &&
1003 root->fs_info->fs_devices->rw_devices <= 4) { 1003 root->fs_info->fs_devices->rw_devices <= 4) {
1004 printk("btrfs: unable to go below four devices on raid10\n"); 1004 printk(KERN_ERR "btrfs: unable to go below four devices "
1005 "on raid10\n");
1005 ret = -EINVAL; 1006 ret = -EINVAL;
1006 goto out; 1007 goto out;
1007 } 1008 }
1008 1009
1009 if ((all_avail & BTRFS_BLOCK_GROUP_RAID1) && 1010 if ((all_avail & BTRFS_BLOCK_GROUP_RAID1) &&
1010 root->fs_info->fs_devices->rw_devices <= 2) { 1011 root->fs_info->fs_devices->rw_devices <= 2) {
1011 printk("btrfs: unable to go below two devices on raid1\n"); 1012 printk(KERN_ERR "btrfs: unable to go below two "
1013 "devices on raid1\n");
1012 ret = -EINVAL; 1014 ret = -EINVAL;
1013 goto out; 1015 goto out;
1014 } 1016 }
@@ -1031,7 +1033,8 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
1031 bh = NULL; 1033 bh = NULL;
1032 disk_super = NULL; 1034 disk_super = NULL;
1033 if (!device) { 1035 if (!device) {
1034 printk("btrfs: no missing devices found to remove\n"); 1036 printk(KERN_ERR "btrfs: no missing devices found to "
1037 "remove\n");
1035 goto out; 1038 goto out;
1036 } 1039 }
1037 } else { 1040 } else {
@@ -1060,7 +1063,8 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
1060 } 1063 }
1061 1064
1062 if (device->writeable && root->fs_info->fs_devices->rw_devices == 1) { 1065 if (device->writeable && root->fs_info->fs_devices->rw_devices == 1) {
1063 printk("btrfs: unable to remove the only writeable device\n"); 1066 printk(KERN_ERR "btrfs: unable to remove the only writeable "
1067 "device\n");
1064 ret = -EINVAL; 1068 ret = -EINVAL;
1065 goto error_brelse; 1069 goto error_brelse;
1066 } 1070 }
@@ -1286,9 +1290,8 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
1286 return -EINVAL; 1290 return -EINVAL;
1287 1291
1288 bdev = open_bdev_exclusive(device_path, 0, root->fs_info->bdev_holder); 1292 bdev = open_bdev_exclusive(device_path, 0, root->fs_info->bdev_holder);
1289 if (!bdev) { 1293 if (!bdev)
1290 return -EIO; 1294 return -EIO;
1291 }
1292 1295
1293 if (root->fs_info->fs_devices->seeding) { 1296 if (root->fs_info->fs_devices->seeding) {
1294 seeding_dev = 1; 1297 seeding_dev = 1;
@@ -1401,8 +1404,8 @@ error:
1401 goto out; 1404 goto out;
1402} 1405}
1403 1406
1404static int noinline btrfs_update_device(struct btrfs_trans_handle *trans, 1407static noinline int btrfs_update_device(struct btrfs_trans_handle *trans,
1405 struct btrfs_device *device) 1408 struct btrfs_device *device)
1406{ 1409{
1407 int ret; 1410 int ret;
1408 struct btrfs_path *path; 1411 struct btrfs_path *path;
@@ -1563,7 +1566,7 @@ static int btrfs_relocate_chunk(struct btrfs_root *root,
1563 int ret; 1566 int ret;
1564 int i; 1567 int i;
1565 1568
1566 printk("btrfs relocating chunk %llu\n", 1569 printk(KERN_INFO "btrfs relocating chunk %llu\n",
1567 (unsigned long long)chunk_offset); 1570 (unsigned long long)chunk_offset);
1568 root = root->fs_info->chunk_root; 1571 root = root->fs_info->chunk_root;
1569 extent_root = root->fs_info->extent_root; 1572 extent_root = root->fs_info->extent_root;
@@ -1748,7 +1751,7 @@ int btrfs_balance(struct btrfs_root *dev_root)
1748 key.offset = (u64)-1; 1751 key.offset = (u64)-1;
1749 key.type = BTRFS_CHUNK_ITEM_KEY; 1752 key.type = BTRFS_CHUNK_ITEM_KEY;
1750 1753
1751 while(1) { 1754 while (1) {
1752 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0); 1755 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0);
1753 if (ret < 0) 1756 if (ret < 0)
1754 goto error; 1757 goto error;
@@ -1916,7 +1919,7 @@ static int btrfs_add_system_chunk(struct btrfs_trans_handle *trans,
1916 return 0; 1919 return 0;
1917} 1920}
1918 1921
1919static u64 noinline chunk_bytes_by_type(u64 type, u64 calc_size, 1922static noinline u64 chunk_bytes_by_type(u64 type, u64 calc_size,
1920 int num_stripes, int sub_stripes) 1923 int num_stripes, int sub_stripes)
1921{ 1924{
1922 if (type & (BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP)) 1925 if (type & (BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP))
@@ -2041,7 +2044,7 @@ again:
2041 min_free += 1024 * 1024; 2044 min_free += 1024 * 1024;
2042 2045
2043 INIT_LIST_HEAD(&private_devs); 2046 INIT_LIST_HEAD(&private_devs);
2044 while(index < num_stripes) { 2047 while (index < num_stripes) {
2045 device = list_entry(cur, struct btrfs_device, dev_alloc_list); 2048 device = list_entry(cur, struct btrfs_device, dev_alloc_list);
2046 BUG_ON(!device->writeable); 2049 BUG_ON(!device->writeable);
2047 if (device->total_bytes > device->bytes_used) 2050 if (device->total_bytes > device->bytes_used)
@@ -2242,7 +2245,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
2242 return 0; 2245 return 0;
2243} 2246}
2244 2247
2245static int noinline init_first_rw_device(struct btrfs_trans_handle *trans, 2248static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
2246 struct btrfs_root *root, 2249 struct btrfs_root *root,
2247 struct btrfs_device *device) 2250 struct btrfs_device *device)
2248{ 2251{
@@ -2338,7 +2341,7 @@ void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree)
2338{ 2341{
2339 struct extent_map *em; 2342 struct extent_map *em;
2340 2343
2341 while(1) { 2344 while (1) {
2342 spin_lock(&tree->map_tree.lock); 2345 spin_lock(&tree->map_tree.lock);
2343 em = lookup_extent_mapping(&tree->map_tree, 0, (u64)-1); 2346 em = lookup_extent_mapping(&tree->map_tree, 0, (u64)-1);
2344 if (em) 2347 if (em)
@@ -2413,9 +2416,8 @@ static int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw,
2413 int max_errors = 0; 2416 int max_errors = 0;
2414 struct btrfs_multi_bio *multi = NULL; 2417 struct btrfs_multi_bio *multi = NULL;
2415 2418
2416 if (multi_ret && !(rw & (1 << BIO_RW))) { 2419 if (multi_ret && !(rw & (1 << BIO_RW)))
2417 stripes_allocated = 1; 2420 stripes_allocated = 1;
2418 }
2419again: 2421again:
2420 if (multi_ret) { 2422 if (multi_ret) {
2421 multi = kzalloc(btrfs_multi_bio_size(stripes_allocated), 2423 multi = kzalloc(btrfs_multi_bio_size(stripes_allocated),
@@ -2434,7 +2436,9 @@ again:
2434 return 0; 2436 return 0;
2435 2437
2436 if (!em) { 2438 if (!em) {
2437 printk("unable to find logical %Lu len %Lu\n", logical, *length); 2439 printk(KERN_CRIT "unable to find logical %llu len %llu\n",
2440 (unsigned long long)logical,
2441 (unsigned long long)*length);
2438 BUG(); 2442 BUG();
2439 } 2443 }
2440 2444
@@ -2541,9 +2545,8 @@ again:
2541 device = map->stripes[stripe_index].dev; 2545 device = map->stripes[stripe_index].dev;
2542 if (device->bdev) { 2546 if (device->bdev) {
2543 bdi = blk_get_backing_dev_info(device->bdev); 2547 bdi = blk_get_backing_dev_info(device->bdev);
2544 if (bdi->unplug_io_fn) { 2548 if (bdi->unplug_io_fn)
2545 bdi->unplug_io_fn(bdi, unplug_page); 2549 bdi->unplug_io_fn(bdi, unplug_page);
2546 }
2547 } 2550 }
2548 } else { 2551 } else {
2549 multi->stripes[i].physical = 2552 multi->stripes[i].physical =
@@ -2717,7 +2720,7 @@ struct async_sched {
2717 * This will add one bio to the pending list for a device and make sure 2720 * This will add one bio to the pending list for a device and make sure
2718 * the work struct is scheduled. 2721 * the work struct is scheduled.
2719 */ 2722 */
2720static int noinline schedule_bio(struct btrfs_root *root, 2723static noinline int schedule_bio(struct btrfs_root *root,
2721 struct btrfs_device *device, 2724 struct btrfs_device *device,
2722 int rw, struct bio *bio) 2725 int rw, struct bio *bio)
2723{ 2726{
@@ -2785,8 +2788,10 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
2785 2788
2786 total_devs = multi->num_stripes; 2789 total_devs = multi->num_stripes;
2787 if (map_length < length) { 2790 if (map_length < length) {
2788 printk("mapping failed logical %Lu bio len %Lu " 2791 printk(KERN_CRIT "mapping failed logical %llu bio len %llu "
2789 "len %Lu\n", logical, length, map_length); 2792 "len %llu\n", (unsigned long long)logical,
2793 (unsigned long long)length,
2794 (unsigned long long)map_length);
2790 BUG(); 2795 BUG();
2791 } 2796 }
2792 multi->end_io = first_bio->bi_end_io; 2797 multi->end_io = first_bio->bi_end_io;
@@ -2794,7 +2799,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
2794 multi->orig_bio = first_bio; 2799 multi->orig_bio = first_bio;
2795 atomic_set(&multi->stripes_pending, multi->num_stripes); 2800 atomic_set(&multi->stripes_pending, multi->num_stripes);
2796 2801
2797 while(dev_nr < total_devs) { 2802 while (dev_nr < total_devs) {
2798 if (total_devs > 1) { 2803 if (total_devs > 1) {
2799 if (dev_nr < total_devs - 1) { 2804 if (dev_nr < total_devs - 1) {
2800 bio = bio_clone(first_bio, GFP_NOFS); 2805 bio = bio_clone(first_bio, GFP_NOFS);
@@ -3058,7 +3063,8 @@ static int read_one_dev(struct btrfs_root *root,
3058 return -EIO; 3063 return -EIO;
3059 3064
3060 if (!device) { 3065 if (!device) {
3061 printk("warning devid %Lu missing\n", devid); 3066 printk(KERN_WARNING "warning devid %llu missing\n",
3067 (unsigned long long)devid);
3062 device = add_missing_dev(root, devid, dev_uuid); 3068 device = add_missing_dev(root, devid, dev_uuid);
3063 if (!device) 3069 if (!device)
3064 return -ENOMEM; 3070 return -ENOMEM;
@@ -3078,12 +3084,6 @@ static int read_one_dev(struct btrfs_root *root,
3078 if (device->writeable) 3084 if (device->writeable)
3079 device->fs_devices->total_rw_bytes += device->total_bytes; 3085 device->fs_devices->total_rw_bytes += device->total_bytes;
3080 ret = 0; 3086 ret = 0;
3081#if 0
3082 ret = btrfs_open_device(device);
3083 if (ret) {
3084 kfree(device);
3085 }
3086#endif
3087 return ret; 3087 return ret;
3088} 3088}
3089 3089
@@ -3174,7 +3174,7 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
3174 key.type = 0; 3174 key.type = 0;
3175again: 3175again:
3176 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); 3176 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3177 while(1) { 3177 while (1) {
3178 leaf = path->nodes[0]; 3178 leaf = path->nodes[0];
3179 slot = path->slots[0]; 3179 slot = path->slots[0];
3180 if (slot >= btrfs_header_nritems(leaf)) { 3180 if (slot >= btrfs_header_nritems(leaf)) {