Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Btrfs: convert printk to btrfs_ and fix BTRFS prefix

Convert all applicable cases of printk and pr_* to the btrfs_* macros.

Fix all uses of the BTRFS prefix.

Signed-off-by: Frank Holton <fholton@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>

authored by

Frank Holton and committed by
Chris Mason
efe120a0 5de865ee

+358 -329
+6 -6
fs/btrfs/compression.c
··· 128 128 kunmap_atomic(kaddr); 129 129 130 130 if (csum != *cb_sum) { 131 - printk(KERN_INFO "btrfs csum failed ino %llu " 132 - "extent %llu csum %u " 133 - "wanted %u mirror %d\n", 134 - btrfs_ino(inode), disk_start, csum, *cb_sum, 135 - cb->mirror_num); 131 + btrfs_info(BTRFS_I(inode)->root->fs_info, 132 + "csum failed ino %llu extent %llu csum %u wanted %u mirror %d", 133 + btrfs_ino(inode), disk_start, csum, *cb_sum, 134 + cb->mirror_num); 136 135 ret = -EIO; 137 136 goto fail; 138 137 } ··· 411 412 bio_add_page(bio, page, PAGE_CACHE_SIZE, 0); 412 413 } 413 414 if (bytes_left < PAGE_CACHE_SIZE) { 414 - printk("bytes left %lu compress len %lu nr %lu\n", 415 + btrfs_info(BTRFS_I(inode)->root->fs_info, 416 + "bytes left %lu compress len %lu nr %lu", 415 417 bytes_left, cb->compressed_len, cb->nr_pages); 416 418 } 417 419 bytes_left -= PAGE_CACHE_SIZE;
+8 -8
fs/btrfs/ctree.c
··· 1480 1480 old = read_tree_block(root, logical, blocksize, 0); 1481 1481 if (WARN_ON(!old || !extent_buffer_uptodate(old))) { 1482 1482 free_extent_buffer(old); 1483 - pr_warn("btrfs: failed to read tree block %llu from get_old_root\n", 1484 - logical); 1483 + btrfs_warn(root->fs_info, 1484 + "failed to read tree block %llu from get_old_root", logical); 1485 1485 } else { 1486 1486 eb = btrfs_clone_extent_buffer(old); 1487 1487 free_extent_buffer(old); ··· 3611 3611 int ret; 3612 3612 ret = BTRFS_LEAF_DATA_SIZE(root) - leaf_space_used(leaf, 0, nritems); 3613 3613 if (ret < 0) { 3614 - printk(KERN_CRIT "leaf free space ret %d, leaf data size %lu, " 3615 - "used %d nritems %d\n", 3614 + btrfs_crit(root->fs_info, 3615 + "leaf free space ret %d, leaf data size %lu, used %d nritems %d", 3616 3616 ret, (unsigned long) BTRFS_LEAF_DATA_SIZE(root), 3617 3617 leaf_space_used(leaf, 0, nritems), nritems); 3618 3618 } ··· 4702 4702 BUG_ON(slot < 0); 4703 4703 if (slot >= nritems) { 4704 4704 btrfs_print_leaf(root, leaf); 4705 - printk(KERN_CRIT "slot %d too large, nritems %d\n", 4705 + btrfs_crit(root->fs_info, "slot %d too large, nritems %d", 4706 4706 slot, nritems); 4707 4707 BUG_ON(1); 4708 4708 } ··· 4765 4765 4766 4766 if (btrfs_leaf_free_space(root, leaf) < total_size) { 4767 4767 btrfs_print_leaf(root, leaf); 4768 - printk(KERN_CRIT "not enough freespace need %u have %d\n", 4768 + btrfs_crit(root->fs_info, "not enough freespace need %u have %d", 4769 4769 total_size, btrfs_leaf_free_space(root, leaf)); 4770 4770 BUG(); 4771 4771 } ··· 4775 4775 4776 4776 if (old_data < data_end) { 4777 4777 btrfs_print_leaf(root, leaf); 4778 - printk(KERN_CRIT "slot %d old_data %d data_end %d\n", 4778 + btrfs_crit(root->fs_info, "slot %d old_data %d data_end %d", 4779 4779 slot, old_data, data_end); 4780 4780 BUG_ON(1); 4781 4781 } ··· 5510 5510 5511 5511 if (!left_start_ctransid || !right_start_ctransid) { 5512 5512 WARN(1, KERN_WARNING 5513 - "btrfs: btrfs_compare_tree detected " 5513 + "BTRFS: btrfs_compare_tree detected " 5514 5514 "a change in one of the trees while " 5515 5515 "iterating. This is probably a " 5516 5516 "bug.\n");
+2 -2
fs/btrfs/ctree.h
··· 3838 3838 3839 3839 static inline void assfail(char *expr, char *file, int line) 3840 3840 { 3841 - printk(KERN_ERR "BTRFS assertion failed: %s, file: %s, line: %d", 3841 + pr_err("BTRFS: assertion failed: %s, file: %s, line: %d", 3842 3842 expr, file, line); 3843 3843 BUG(); 3844 3844 } ··· 3876 3876 if (!(features & flag)) { 3877 3877 features |= flag; 3878 3878 btrfs_set_super_incompat_flags(disk_super, features); 3879 - printk(KERN_INFO "btrfs: setting %llu feature flag\n", 3879 + btrfs_info(fs_info, "setting %llu feature flag", 3880 3880 flag); 3881 3881 } 3882 3882 spin_unlock(&fs_info->super_lock);
+4 -4
fs/btrfs/delayed-inode.c
··· 1472 1472 mutex_lock(&delayed_node->mutex); 1473 1473 ret = __btrfs_add_delayed_insertion_item(delayed_node, delayed_item); 1474 1474 if (unlikely(ret)) { 1475 - printk(KERN_ERR "err add delayed dir index item(name: %.*s) " 1475 + btrfs_err(root->fs_info, "err add delayed dir index item(name: %.*s) " 1476 1476 "into the insertion tree of the delayed node" 1477 - "(root id: %llu, inode id: %llu, errno: %d)\n", 1477 + "(root id: %llu, inode id: %llu, errno: %d)", 1478 1478 name_len, name, delayed_node->root->objectid, 1479 1479 delayed_node->inode_id, ret); 1480 1480 BUG(); ··· 1544 1544 mutex_lock(&node->mutex); 1545 1545 ret = __btrfs_add_delayed_deletion_item(node, item); 1546 1546 if (unlikely(ret)) { 1547 - printk(KERN_ERR "err add delayed dir index item(index: %llu) " 1547 + btrfs_err(root->fs_info, "err add delayed dir index item(index: %llu) " 1548 1548 "into the deletion tree of the delayed node" 1549 - "(root id: %llu, inode id: %llu, errno: %d)\n", 1549 + "(root id: %llu, inode id: %llu, errno: %d)", 1550 1550 index, node->root->objectid, node->inode_id, 1551 1551 ret); 1552 1552 BUG();
+32 -24
fs/btrfs/dev-replace.c
··· 102 102 ptr = btrfs_item_ptr(eb, slot, struct btrfs_dev_replace_item); 103 103 104 104 if (item_size != sizeof(struct btrfs_dev_replace_item)) { 105 - pr_warn("btrfs: dev_replace entry found has unexpected size, ignore entry\n"); 105 + btrfs_warn(fs_info, 106 + "dev_replace entry found has unexpected size, ignore entry"); 106 107 goto no_valid_dev_replace_entry_found; 107 108 } 108 109 ··· 146 145 if (!dev_replace->srcdev && 147 146 !btrfs_test_opt(dev_root, DEGRADED)) { 148 147 ret = -EIO; 149 - pr_warn("btrfs: cannot mount because device replace operation is ongoing and\n" "srcdev (devid %llu) is missing, need to run 'btrfs dev scan'?\n", 150 - src_devid); 148 + btrfs_warn(fs_info, 149 + "cannot mount because device replace operation is ongoing and"); 150 + btrfs_warn(fs_info, 151 + "srcdev (devid %llu) is missing, need to run 'btrfs dev scan'?", 152 + src_devid); 151 153 } 152 154 if (!dev_replace->tgtdev && 153 155 !btrfs_test_opt(dev_root, DEGRADED)) { 154 156 ret = -EIO; 155 - pr_warn("btrfs: cannot mount because device replace operation is ongoing and\n" "tgtdev (devid %llu) is missing, need to run btrfs dev scan?\n", 157 + btrfs_warn(fs_info, 158 + "cannot mount because device replace operation is ongoing and"); 159 + btrfs_warn(fs_info, 160 + "tgtdev (devid %llu) is missing, need to run 'btrfs dev scan'?", 156 161 BTRFS_DEV_REPLACE_DEVID); 157 162 } 158 163 if (dev_replace->tgtdev) { ··· 217 210 } 218 211 ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); 219 212 if (ret < 0) { 220 - pr_warn("btrfs: error %d while searching for dev_replace item!\n", 213 + btrfs_warn(fs_info, "error %d while searching for dev_replace item!", 221 214 ret); 222 215 goto out; 223 216 } ··· 237 230 */ 238 231 ret = btrfs_del_item(trans, dev_root, path); 239 232 if (ret != 0) { 240 - pr_warn("btrfs: delete too small dev_replace item failed %d!\n", 233 + btrfs_warn(fs_info, "delete too small dev_replace item failed %d!", 241 234 ret); 242 235 goto out; 243 236 } ··· 250 243 ret = btrfs_insert_empty_item(trans, dev_root, path, 251 244 &key, sizeof(*ptr)); 252 245 if (ret < 0) { 253 - pr_warn("btrfs: insert dev_replace item failed %d!\n", 246 + btrfs_warn(fs_info, "insert dev_replace item failed %d!", 254 247 ret); 255 248 goto out; 256 249 } ··· 312 305 struct btrfs_device *src_device = NULL; 313 306 314 307 if (btrfs_fs_incompat(fs_info, RAID56)) { 315 - pr_warn("btrfs: dev_replace cannot yet handle RAID5/RAID6\n"); 308 + btrfs_warn(fs_info, "dev_replace cannot yet handle RAID5/RAID6"); 316 309 return -EINVAL; 317 310 } 318 311 ··· 332 325 ret = btrfs_init_dev_replace_tgtdev(root, args->start.tgtdev_name, 333 326 &tgt_device); 334 327 if (ret) { 335 - pr_err("btrfs: target device %s is invalid!\n", 328 + btrfs_err(fs_info, "target device %s is invalid!", 336 329 args->start.tgtdev_name); 337 330 mutex_unlock(&fs_info->volume_mutex); 338 331 return -EINVAL; ··· 348 341 } 349 342 350 343 if (tgt_device->total_bytes < src_device->total_bytes) { 351 - pr_err("btrfs: target device is smaller than source device!\n"); 344 + btrfs_err(fs_info, "target device is smaller than source device!"); 352 345 ret = -EINVAL; 353 346 goto leave_no_lock; 354 347 } ··· 373 366 dev_replace->tgtdev = tgt_device; 374 367 375 368 printk_in_rcu(KERN_INFO 376 - "btrfs: dev_replace from %s (devid %llu) to %s started\n", 369 + "BTRFS: dev_replace from %s (devid %llu) to %s started\n", 377 370 src_device->missing ? "<missing disk>" : 378 371 rcu_str_deref(src_device->name), 379 372 src_device->devid, ··· 496 489 497 490 if (scrub_ret) { 498 491 printk_in_rcu(KERN_ERR 499 - "btrfs: btrfs_scrub_dev(%s, %llu, %s) failed %d\n", 492 + "BTRFS: btrfs_scrub_dev(%s, %llu, %s) failed %d\n", 500 493 src_device->missing ? "<missing disk>" : 501 494 rcu_str_deref(src_device->name), 502 495 src_device->devid, ··· 511 504 } 512 505 513 506 printk_in_rcu(KERN_INFO 514 - "btrfs: dev_replace from %s (devid %llu) to %s) finished\n", 507 + "BTRFS: dev_replace from %s (devid %llu) to %s) finished\n", 515 508 src_device->missing ? "<missing disk>" : 516 509 rcu_str_deref(src_device->name), 517 510 src_device->devid, ··· 706 699 BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED; 707 700 dev_replace->time_stopped = get_seconds(); 708 701 dev_replace->item_needs_writeback = 1; 709 - pr_info("btrfs: suspending dev_replace for unmount\n"); 702 + btrfs_info(fs_info, "suspending dev_replace for unmount"); 710 703 break; 711 704 } 712 705 ··· 735 728 break; 736 729 } 737 730 if (!dev_replace->tgtdev || !dev_replace->tgtdev->bdev) { 738 - pr_info("btrfs: cannot continue dev_replace, tgtdev is missing\n" 739 - "btrfs: you may cancel the operation after 'mount -o degraded'\n"); 731 + btrfs_info(fs_info, "cannot continue dev_replace, tgtdev is missing"); 732 + btrfs_info(fs_info, 733 + "you may cancel the operation after 'mount -o degraded'"); 740 734 btrfs_dev_replace_unlock(dev_replace); 741 735 return 0; 742 736 } ··· 763 755 kfree(status_args); 764 756 do_div(progress, 10); 765 757 printk_in_rcu(KERN_INFO 766 - "btrfs: continuing dev_replace from %s (devid %llu) to %s @%u%%\n", 767 - dev_replace->srcdev->missing ? "<missing disk>" : 768 - rcu_str_deref(dev_replace->srcdev->name), 769 - dev_replace->srcdev->devid, 770 - dev_replace->tgtdev ? 771 - rcu_str_deref(dev_replace->tgtdev->name) : 772 - "<missing target disk>", 773 - (unsigned int)progress); 758 + "BTRFS: continuing dev_replace from %s (devid %llu) to %s @%u%%\n", 759 + dev_replace->srcdev->missing ? "<missing disk>" : 760 + rcu_str_deref(dev_replace->srcdev->name), 761 + dev_replace->srcdev->devid, 762 + dev_replace->tgtdev ? 763 + rcu_str_deref(dev_replace->tgtdev->name) : 764 + "<missing target disk>", 765 + (unsigned int)progress); 774 766 } 775 767 btrfs_dev_replace_continue_on_mount(fs_info); 776 768 atomic_set(&fs_info->mutually_exclusive_operation_running, 0);
+3 -3
fs/btrfs/dir-item.c
··· 459 459 u8 type = btrfs_dir_type(leaf, dir_item); 460 460 461 461 if (type >= BTRFS_FT_MAX) { 462 - printk(KERN_CRIT "btrfs: invalid dir item type: %d\n", 462 + btrfs_crit(root->fs_info, "invalid dir item type: %d", 463 463 (int)type); 464 464 return 1; 465 465 } ··· 468 468 namelen = XATTR_NAME_MAX; 469 469 470 470 if (btrfs_dir_name_len(leaf, dir_item) > namelen) { 471 - printk(KERN_CRIT "btrfs: invalid dir item name len: %u\n", 471 + btrfs_crit(root->fs_info, "invalid dir item name len: %u", 472 472 (unsigned)btrfs_dir_data_len(leaf, dir_item)); 473 473 return 1; 474 474 } ··· 476 476 /* BTRFS_MAX_XATTR_SIZE is the same for all dir items */ 477 477 if ((btrfs_dir_data_len(leaf, dir_item) + 478 478 btrfs_dir_name_len(leaf, dir_item)) > BTRFS_MAX_XATTR_SIZE(root)) { 479 - printk(KERN_CRIT "btrfs: invalid dir item name + data len: %u + %u\n", 479 + btrfs_crit(root->fs_info, "invalid dir item name + data len: %u + %u", 480 480 (unsigned)btrfs_dir_name_len(leaf, dir_item), 481 481 (unsigned)btrfs_dir_data_len(leaf, dir_item)); 482 482 return 1;
+54 -52
fs/btrfs/disk-io.c
··· 300 300 memcpy(&found, result, csum_size); 301 301 302 302 read_extent_buffer(buf, &val, 0, csum_size); 303 - printk_ratelimited(KERN_INFO "btrfs: %s checksum verify " 304 - "failed on %llu wanted %X found %X " 305 - "level %d\n", 306 - root->fs_info->sb->s_id, buf->start, 307 - val, found, btrfs_header_level(buf)); 303 + printk_ratelimited(KERN_INFO 304 + "BTRFS: %s checksum verify failed on %llu wanted %X found %X " 305 + "level %d\n", 306 + root->fs_info->sb->s_id, buf->start, 307 + val, found, btrfs_header_level(buf)); 308 308 if (result != (char *)&inline_result) 309 309 kfree(result); 310 310 return 1; ··· 383 383 ret = 1; 384 384 385 385 if (ret && btrfs_super_generation(disk_sb) < 10) { 386 - printk(KERN_WARNING "btrfs: super block crcs don't match, older mkfs detected\n"); 386 + printk(KERN_WARNING 387 + "BTRFS: super block crcs don't match, older mkfs detected\n"); 387 388 ret = 0; 388 389 } 389 390 } 390 391 391 392 if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) { 392 - printk(KERN_ERR "btrfs: unsupported checksum algorithm %u\n", 393 + printk(KERN_ERR "BTRFS: unsupported checksum algorithm %u\n", 393 394 csum_type); 394 395 ret = 1; 395 396 } ··· 499 498 } 500 499 501 500 #define CORRUPT(reason, eb, root, slot) \ 502 - printk(KERN_CRIT "btrfs: corrupt leaf, %s: block=%llu," \ 503 - "root=%llu, slot=%d\n", reason, \ 501 + btrfs_crit(root->fs_info, "corrupt leaf, %s: block=%llu," \ 502 + "root=%llu, slot=%d", reason, \ 504 503 btrfs_header_bytenr(eb), root->objectid, slot) 505 504 506 505 static noinline int check_leaf(struct btrfs_root *root, ··· 597 596 598 597 found_start = btrfs_header_bytenr(eb); 599 598 if (found_start != eb->start) { 600 - printk_ratelimited(KERN_INFO "btrfs bad tree block start " 599 + printk_ratelimited(KERN_INFO "BTRFS: bad tree block start " 601 600 "%llu %llu\n", 602 601 found_start, eb->start); 603 602 ret = -EIO; 604 603 goto err; 605 604 } 606 605 if (check_tree_block_fsid(root, eb)) { 607 - printk_ratelimited(KERN_INFO "btrfs bad fsid on block %llu\n", 606 + printk_ratelimited(KERN_INFO "BTRFS: bad fsid on block %llu\n", 608 607 eb->start); 609 608 ret = -EIO; 610 609 goto err; 611 610 } 612 611 found_level = btrfs_header_level(eb); 613 612 if (found_level >= BTRFS_MAX_LEVEL) { 614 - btrfs_info(root->fs_info, "bad tree block level %d\n", 613 + btrfs_info(root->fs_info, "bad tree block level %d", 615 614 (int)btrfs_header_level(eb)); 616 615 ret = -EIO; 617 616 goto err; ··· 1005 1004 extent_invalidatepage(tree, page, offset); 1006 1005 btree_releasepage(page, GFP_NOFS); 1007 1006 if (PagePrivate(page)) { 1008 - printk(KERN_WARNING "btrfs warning page private not zero " 1009 - "on page %llu\n", (unsigned long long)page_offset(page)); 1007 + btrfs_warn(BTRFS_I(page->mapping->host)->root->fs_info, 1008 + "page private not zero on page %llu", 1009 + (unsigned long long)page_offset(page)); 1010 1010 ClearPagePrivate(page); 1011 1011 set_page_private(page, 0); 1012 1012 page_cache_release(page); ··· 2324 2322 * Pass the whole disk block of size BTRFS_SUPER_INFO_SIZE (4k). 2325 2323 */ 2326 2324 if (btrfs_check_super_csum(bh->b_data)) { 2327 - printk(KERN_ERR "btrfs: superblock checksum mismatch\n"); 2325 + printk(KERN_ERR "BTRFS: superblock checksum mismatch\n"); 2328 2326 err = -EINVAL; 2329 2327 goto fail_alloc; 2330 2328 } ··· 2343 2341 2344 2342 ret = btrfs_check_super_valid(fs_info, sb->s_flags & MS_RDONLY); 2345 2343 if (ret) { 2346 - printk(KERN_ERR "btrfs: superblock contains fatal errors\n"); 2344 + printk(KERN_ERR "BTRFS: superblock contains fatal errors\n"); 2347 2345 err = -EINVAL; 2348 2346 goto fail_alloc; 2349 2347 } ··· 2408 2406 features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO; 2409 2407 2410 2408 if (features & BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) 2411 - printk(KERN_ERR "btrfs: has skinny extents\n"); 2409 + printk(KERN_ERR "BTRFS: has skinny extents\n"); 2412 2410 2413 2411 /* 2414 2412 * flag our filesystem as having big metadata blocks if ··· 2416 2414 */ 2417 2415 if (btrfs_super_leafsize(disk_super) > PAGE_CACHE_SIZE) { 2418 2416 if (!(features & BTRFS_FEATURE_INCOMPAT_BIG_METADATA)) 2419 - printk(KERN_INFO "btrfs flagging fs with big metadata feature\n"); 2417 + printk(KERN_INFO "BTRFS: flagging fs with big metadata feature\n"); 2420 2418 features |= BTRFS_FEATURE_INCOMPAT_BIG_METADATA; 2421 2419 } 2422 2420 ··· 2433 2431 */ 2434 2432 if ((features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) && 2435 2433 (sectorsize != leafsize)) { 2436 - printk(KERN_WARNING "btrfs: unequal leaf/node/sector sizes " 2434 + printk(KERN_WARNING "BTRFS: unequal leaf/node/sector sizes " 2437 2435 "are not allowed for mixed block groups on %s\n", 2438 2436 sb->s_id); 2439 2437 goto fail_alloc; ··· 2570 2568 sb->s_blocksize_bits = blksize_bits(sectorsize); 2571 2569 2572 2570 if (btrfs_super_magic(disk_super) != BTRFS_MAGIC) { 2573 - printk(KERN_INFO "btrfs: valid FS not found on %s\n", sb->s_id); 2571 + printk(KERN_INFO "BTRFS: valid FS not found on %s\n", sb->s_id); 2574 2572 goto fail_sb_buffer; 2575 2573 } 2576 2574 2577 2575 if (sectorsize != PAGE_SIZE) { 2578 - printk(KERN_WARNING "btrfs: Incompatible sector size(%lu) " 2576 + printk(KERN_WARNING "BTRFS: Incompatible sector size(%lu) " 2579 2577 "found on %s\n", (unsigned long)sectorsize, sb->s_id); 2580 2578 goto fail_sb_buffer; 2581 2579 } ··· 2584 2582 ret = btrfs_read_sys_array(tree_root); 2585 2583 mutex_unlock(&fs_info->chunk_mutex); 2586 2584 if (ret) { 2587 - printk(KERN_WARNING "btrfs: failed to read the system " 2585 + printk(KERN_WARNING "BTRFS: failed to read the system " 2588 2586 "array on %s\n", sb->s_id); 2589 2587 goto fail_sb_buffer; 2590 2588 } ··· 2601 2599 blocksize, generation); 2602 2600 if (!chunk_root->node || 2603 2601 !test_bit(EXTENT_BUFFER_UPTODATE, &chunk_root->node->bflags)) { 2604 - printk(KERN_WARNING "btrfs: failed to read chunk root on %s\n", 2602 + printk(KERN_WARNING "BTRFS: failed to read chunk root on %s\n", 2605 2603 sb->s_id); 2606 2604 goto fail_tree_roots; 2607 2605 } ··· 2613 2611 2614 2612 ret = btrfs_read_chunk_tree(chunk_root); 2615 2613 if (ret) { 2616 - printk(KERN_WARNING "btrfs: failed to read chunk tree on %s\n", 2614 + printk(KERN_WARNING "BTRFS: failed to read chunk tree on %s\n", 2617 2615 sb->s_id); 2618 2616 goto fail_tree_roots; 2619 2617 } ··· 2625 2623 btrfs_close_extra_devices(fs_info, fs_devices, 0); 2626 2624 2627 2625 if (!fs_devices->latest_bdev) { 2628 - printk(KERN_CRIT "btrfs: failed to read devices on %s\n", 2626 + printk(KERN_CRIT "BTRFS: failed to read devices on %s\n", 2629 2627 sb->s_id); 2630 2628 goto fail_tree_roots; 2631 2629 } ··· 2640 2638 blocksize, generation); 2641 2639 if (!tree_root->node || 2642 2640 !test_bit(EXTENT_BUFFER_UPTODATE, &tree_root->node->bflags)) { 2643 - printk(KERN_WARNING "btrfs: failed to read tree root on %s\n", 2641 + printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n", 2644 2642 sb->s_id); 2645 2643 2646 2644 goto recovery_tree_root; ··· 2711 2709 2712 2710 ret = btrfs_recover_balance(fs_info); 2713 2711 if (ret) { 2714 - printk(KERN_WARNING "btrfs: failed to recover balance\n"); 2712 + printk(KERN_WARNING "BTRFS: failed to recover balance\n"); 2715 2713 goto fail_block_groups; 2716 2714 } 2717 2715 2718 2716 ret = btrfs_init_dev_stats(fs_info); 2719 2717 if (ret) { 2720 - printk(KERN_ERR "btrfs: failed to init dev_stats: %d\n", 2718 + printk(KERN_ERR "BTRFS: failed to init dev_stats: %d\n", 2721 2719 ret); 2722 2720 goto fail_block_groups; 2723 2721 } 2724 2722 2725 2723 ret = btrfs_init_dev_replace(fs_info); 2726 2724 if (ret) { 2727 - pr_err("btrfs: failed to init dev_replace: %d\n", ret); 2725 + pr_err("BTRFS: failed to init dev_replace: %d\n", ret); 2728 2726 goto fail_block_groups; 2729 2727 } 2730 2728 ··· 2732 2730 2733 2731 ret = btrfs_sysfs_add_one(fs_info); 2734 2732 if (ret) { 2735 - pr_err("btrfs: failed to init sysfs interface: %d\n", ret); 2733 + pr_err("BTRFS: failed to init sysfs interface: %d\n", ret); 2736 2734 goto fail_block_groups; 2737 2735 } 2738 2736 2739 2737 ret = btrfs_init_space_info(fs_info); 2740 2738 if (ret) { 2741 - printk(KERN_ERR "Failed to initial space info: %d\n", ret); 2739 + printk(KERN_ERR "BTRFS: Failed to initial space info: %d\n", ret); 2742 2740 goto fail_block_groups; 2743 2741 } 2744 2742 2745 2743 ret = btrfs_read_block_groups(extent_root); 2746 2744 if (ret) { 2747 - printk(KERN_ERR "Failed to read block groups: %d\n", ret); 2745 + printk(KERN_ERR "BTRFS: Failed to read block groups: %d\n", ret); 2748 2746 goto fail_block_groups; 2749 2747 } 2750 2748 fs_info->num_tolerated_disk_barrier_failures = ··· 2752 2750 if (fs_info->fs_devices->missing_devices > 2753 2751 fs_info->num_tolerated_disk_barrier_failures && 2754 2752 !(sb->s_flags & MS_RDONLY)) { 2755 - printk(KERN_WARNING 2756 - "Btrfs: too many missing devices, writeable mount is not allowed\n"); 2753 + printk(KERN_WARNING "BTRFS: " 2754 + "too many missing devices, writeable mount is not allowed\n"); 2757 2755 goto fail_block_groups; 2758 2756 } 2759 2757 ··· 2771 2769 if (!btrfs_test_opt(tree_root, SSD) && 2772 2770 !btrfs_test_opt(tree_root, NOSSD) && 2773 2771 !fs_info->fs_devices->rotating) { 2774 - printk(KERN_INFO "Btrfs detected SSD devices, enabling SSD " 2772 + printk(KERN_INFO "BTRFS: detected SSD devices, enabling SSD " 2775 2773 "mode\n"); 2776 2774 btrfs_set_opt(fs_info->mount_opt, SSD); 2777 2775 } ··· 2784 2782 1 : 0, 2785 2783 fs_info->check_integrity_print_mask); 2786 2784 if (ret) 2787 - printk(KERN_WARNING "btrfs: failed to initialize" 2785 + printk(KERN_WARNING "BTRFS: failed to initialize" 2788 2786 " integrity check module %s\n", sb->s_id); 2789 2787 } 2790 2788 #endif ··· 2797 2795 u64 bytenr = btrfs_super_log_root(disk_super); 2798 2796 2799 2797 if (fs_devices->rw_devices == 0) { 2800 - printk(KERN_WARNING "Btrfs log replay required " 2798 + printk(KERN_WARNING "BTRFS: log replay required " 2801 2799 "on RO media\n"); 2802 2800 err = -EIO; 2803 2801 goto fail_qgroup; ··· 2820 2818 generation + 1); 2821 2819 if (!log_tree_root->node || 2822 2820 !extent_buffer_uptodate(log_tree_root->node)) { 2823 - printk(KERN_ERR "btrfs: failed to read log tree\n"); 2821 + printk(KERN_ERR "BTRFS: failed to read log tree\n"); 2824 2822 free_extent_buffer(log_tree_root->node); 2825 2823 kfree(log_tree_root); 2826 2824 goto fail_trans_kthread; ··· 2854 2852 ret = btrfs_recover_relocation(tree_root); 2855 2853 if (ret < 0) { 2856 2854 printk(KERN_WARNING 2857 - "btrfs: failed to recover relocation\n"); 2855 + "BTRFS: failed to recover relocation\n"); 2858 2856 err = -EINVAL; 2859 2857 goto fail_qgroup; 2860 2858 } ··· 2884 2882 2885 2883 ret = btrfs_resume_balance_async(fs_info); 2886 2884 if (ret) { 2887 - printk(KERN_WARNING "btrfs: failed to resume balance\n"); 2885 + printk(KERN_WARNING "BTRFS: failed to resume balance\n"); 2888 2886 close_ctree(tree_root); 2889 2887 return ret; 2890 2888 } 2891 2889 2892 2890 ret = btrfs_resume_dev_replace_async(fs_info); 2893 2891 if (ret) { 2894 - pr_warn("btrfs: failed to resume dev_replace\n"); 2892 + pr_warn("BTRFS: failed to resume dev_replace\n"); 2895 2893 close_ctree(tree_root); 2896 2894 return ret; 2897 2895 } ··· 2899 2897 btrfs_qgroup_rescan_resume(fs_info); 2900 2898 2901 2899 if (create_uuid_tree) { 2902 - pr_info("btrfs: creating UUID tree\n"); 2900 + pr_info("BTRFS: creating UUID tree\n"); 2903 2901 ret = btrfs_create_uuid_tree(fs_info); 2904 2902 if (ret) { 2905 - pr_warn("btrfs: failed to create the UUID tree %d\n", 2903 + pr_warn("BTRFS: failed to create the UUID tree %d\n", 2906 2904 ret); 2907 2905 close_ctree(tree_root); 2908 2906 return ret; 2909 2907 } 2910 2908 } else if (check_uuid_tree || 2911 2909 btrfs_test_opt(tree_root, RESCAN_UUID_TREE)) { 2912 - pr_info("btrfs: checking UUID tree\n"); 2910 + pr_info("BTRFS: checking UUID tree\n"); 2913 2911 ret = btrfs_check_uuid_tree(fs_info); 2914 2912 if (ret) { 2915 - pr_warn("btrfs: failed to check the UUID tree %d\n", 2913 + pr_warn("BTRFS: failed to check the UUID tree %d\n", 2916 2914 ret); 2917 2915 close_ctree(tree_root); 2918 2916 return ret; ··· 2993 2991 struct btrfs_device *device = (struct btrfs_device *) 2994 2992 bh->b_private; 2995 2993 2996 - printk_ratelimited_in_rcu(KERN_WARNING "lost page write due to " 2994 + printk_ratelimited_in_rcu(KERN_WARNING "BTRFS: lost page write due to " 2997 2995 "I/O error on %s\n", 2998 2996 rcu_str_deref(device->name)); 2999 2997 /* note, we dont' set_buffer_write_io_error because we have ··· 3112 3110 bh = __getblk(device->bdev, bytenr / 4096, 3113 3111 BTRFS_SUPER_INFO_SIZE); 3114 3112 if (!bh) { 3115 - printk(KERN_ERR "btrfs: couldn't get super " 3113 + printk(KERN_ERR "BTRFS: couldn't get super " 3116 3114 "buffer head for bytenr %Lu\n", bytenr); 3117 3115 errors++; 3118 3116 continue; ··· 3179 3177 wait_for_completion(&device->flush_wait); 3180 3178 3181 3179 if (bio_flagged(bio, BIO_EOPNOTSUPP)) { 3182 - printk_in_rcu("btrfs: disabling barriers on dev %s\n", 3180 + printk_in_rcu("BTRFS: disabling barriers on dev %s\n", 3183 3181 rcu_str_deref(device->name)); 3184 3182 device->nobarriers = 1; 3185 3183 } else if (!bio_flagged(bio, BIO_UPTODATE)) { ··· 3400 3398 total_errors++; 3401 3399 } 3402 3400 if (total_errors > max_errors) { 3403 - printk(KERN_ERR "btrfs: %d errors while writing supers\n", 3401 + btrfs_err(root->fs_info, "%d errors while writing supers", 3404 3402 total_errors); 3405 3403 mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); 3406 3404 ··· 3556 3554 if (!(fs_info->sb->s_flags & MS_RDONLY)) { 3557 3555 ret = btrfs_commit_super(root); 3558 3556 if (ret) 3559 - printk(KERN_ERR "btrfs: commit super ret %d\n", ret); 3557 + btrfs_err(root->fs_info, "commit super ret %d", ret); 3560 3558 } 3561 3559 3562 3560 if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) ··· 3573 3571 btrfs_free_qgroup_config(root->fs_info); 3574 3572 3575 3573 if (percpu_counter_sum(&fs_info->delalloc_bytes)) { 3576 - printk(KERN_INFO "btrfs: at unmount delalloc count %lld\n", 3574 + btrfs_info(root->fs_info, "at unmount delalloc count %lld", 3577 3575 percpu_counter_sum(&fs_info->delalloc_bytes)); 3578 3576 } 3579 3577 ··· 3800 3798 spin_lock(&delayed_refs->lock); 3801 3799 if (delayed_refs->num_entries == 0) { 3802 3800 spin_unlock(&delayed_refs->lock); 3803 - printk(KERN_INFO "delayed_refs has NO entry\n"); 3801 + btrfs_info(root->fs_info, "delayed_refs has NO entry"); 3804 3802 return ret; 3805 3803 } 3806 3804
+8 -6
fs/btrfs/extent-tree.c
··· 6637 6637 int index = 0; 6638 6638 6639 6639 spin_lock(&info->lock); 6640 - printk(KERN_INFO "space_info %llu has %llu free, is %sfull\n", 6640 + printk(KERN_INFO "BTRFS: space_info %llu has %llu free, is %sfull\n", 6641 6641 info->flags, 6642 6642 info->total_bytes - info->bytes_used - info->bytes_pinned - 6643 6643 info->bytes_reserved - info->bytes_readonly, 6644 6644 (info->full) ? "" : "not "); 6645 - printk(KERN_INFO "space_info total=%llu, used=%llu, pinned=%llu, " 6645 + printk(KERN_INFO "BTRFS: space_info total=%llu, used=%llu, pinned=%llu, " 6646 6646 "reserved=%llu, may_use=%llu, readonly=%llu\n", 6647 6647 info->total_bytes, info->bytes_used, info->bytes_pinned, 6648 6648 info->bytes_reserved, info->bytes_may_use, ··· 6656 6656 again: 6657 6657 list_for_each_entry(cache, &info->block_groups[index], list) { 6658 6658 spin_lock(&cache->lock); 6659 - printk(KERN_INFO "block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n", 6659 + printk(KERN_INFO "BTRFS: " 6660 + "block group %llu has %llu bytes, " 6661 + "%llu used %llu pinned %llu reserved %s\n", 6660 6662 cache->key.objectid, cache->key.offset, 6661 6663 btrfs_block_group_used(&cache->item), cache->pinned, 6662 6664 cache->reserved, cache->ro ? "[readonly]" : ""); ··· 7021 7019 /*DEFAULT_RATELIMIT_BURST*/ 1); 7022 7020 if (__ratelimit(&_rs)) 7023 7021 WARN(1, KERN_DEBUG 7024 - "btrfs: block rsv returned %d\n", ret); 7022 + "BTRFS: block rsv returned %d\n", ret); 7025 7023 } 7026 7024 try_reserve: 7027 7025 ret = reserve_metadata_bytes(root, block_rsv, blocksize, ··· 7769 7767 7770 7768 btrfs_end_transaction_throttle(trans, tree_root); 7771 7769 if (!for_reloc && btrfs_need_cleaner_sleep(root)) { 7772 - pr_debug("btrfs: drop snapshot early exit\n"); 7770 + pr_debug("BTRFS: drop snapshot early exit\n"); 7773 7771 err = -EAGAIN; 7774 7772 goto out_free; 7775 7773 } ··· 8429 8427 ret = kobject_add(kobj, &space_info->kobj, "%s", 8430 8428 get_raid_name(index)); 8431 8429 if (ret) { 8432 - pr_warn("btrfs: failed to add kobject for block cache. ignoring.\n"); 8430 + pr_warn("BTRFS: failed to add kobject for block cache. ignoring.\n"); 8433 8431 kobject_put(&space_info->kobj); 8434 8432 } 8435 8433 }
+37 -24
fs/btrfs/extent_io.c
··· 59 59 60 60 while (!list_empty(&states)) { 61 61 state = list_entry(states.next, struct extent_state, leak_list); 62 - printk(KERN_ERR "btrfs state leak: start %llu end %llu " 62 + printk(KERN_ERR "BTRFS: state leak: start %llu end %llu " 63 63 "state %lu in tree %p refs %d\n", 64 64 state->start, state->end, state->state, state->tree, 65 65 atomic_read(&state->refs)); ··· 69 69 70 70 while (!list_empty(&buffers)) { 71 71 eb = list_entry(buffers.next, struct extent_buffer, leak_list); 72 - printk(KERN_ERR "btrfs buffer leak start %llu len %lu " 72 + printk(KERN_ERR "BTRFS: buffer leak start %llu len %lu " 73 73 "refs %d\n", 74 74 eb->start, eb->len, atomic_read(&eb->refs)); 75 75 list_del(&eb->leak_list); ··· 92 92 isize = i_size_read(inode); 93 93 if (end >= PAGE_SIZE && (end % 2) == 0 && end != isize - 1) { 94 94 printk_ratelimited(KERN_DEBUG 95 - "btrfs: %s: ino %llu isize %llu odd range [%llu,%llu]\n", 95 + "BTRFS: %s: ino %llu isize %llu odd range [%llu,%llu]\n", 96 96 caller, btrfs_ino(inode), isize, start, end); 97 97 } 98 98 } ··· 423 423 struct rb_node *node; 424 424 425 425 if (end < start) 426 - WARN(1, KERN_ERR "btrfs end < start %llu %llu\n", 426 + WARN(1, KERN_ERR "BTRFS: end < start %llu %llu\n", 427 427 end, start); 428 428 state->start = start; 429 429 state->end = end; ··· 434 434 if (node) { 435 435 struct extent_state *found; 436 436 found = rb_entry(node, struct extent_state, rb_node); 437 - printk(KERN_ERR "btrfs found node %llu %llu on insert of " 437 + printk(KERN_ERR "BTRFS: found node %llu %llu on insert of " 438 438 "%llu %llu\n", 439 439 found->start, found->end, start, end); 440 440 return -EEXIST; ··· 2054 2054 return -EIO; 2055 2055 } 2056 2056 2057 - printk_ratelimited_in_rcu(KERN_INFO "btrfs read error corrected: ino %lu off %llu " 2058 - "(dev %s sector %llu)\n", page->mapping->host->i_ino, 2059 - start, rcu_str_deref(dev->name), sector); 2057 + printk_ratelimited_in_rcu(KERN_INFO 2058 + "BTRFS: read error corrected: ino %lu off %llu " 2059 + "(dev %s sector %llu)\n", page->mapping->host->i_ino, 2060 + start, rcu_str_deref(dev->name), sector); 2060 2061 2061 2062 bio_put(bio); 2062 2063 return 0; ··· 2387 2386 * advance bv_offset and adjust bv_len to compensate. 2388 2387 * Print a warning for nonzero offsets, and an error 2389 2388 * if they don't add up to a full page. */ 2390 - if (bvec->bv_offset || bvec->bv_len != PAGE_CACHE_SIZE) 2391 - printk("%s page write in btrfs with offset %u and length %u\n", 2392 - bvec->bv_offset + bvec->bv_len != PAGE_CACHE_SIZE 2393 - ? KERN_ERR "partial" : KERN_INFO "incomplete", 2394 - bvec->bv_offset, bvec->bv_len); 2389 + if (bvec->bv_offset || bvec->bv_len != PAGE_CACHE_SIZE) { 2390 + if (bvec->bv_offset + bvec->bv_len != PAGE_CACHE_SIZE) 2391 + btrfs_err(BTRFS_I(page->mapping->host)->root->fs_info, 2392 + "partial page write in btrfs with offset %u and length %u", 2393 + bvec->bv_offset, bvec->bv_len); 2394 + else 2395 + btrfs_info(BTRFS_I(page->mapping->host)->root->fs_info, 2396 + "incomplete page write in btrfs with offset %u and " 2397 + "length %u", 2398 + bvec->bv_offset, bvec->bv_len); 2399 + } 2395 2400 2396 2401 start = page_offset(page); 2397 2402 end = start + bvec->bv_offset + bvec->bv_len - 1; ··· 2470 2463 * advance bv_offset and adjust bv_len to compensate. 2471 2464 * Print a warning for nonzero offsets, and an error 2472 2465 * if they don't add up to a full page. */ 2473 - if (bvec->bv_offset || bvec->bv_len != PAGE_CACHE_SIZE) 2474 - printk("%s page read in btrfs with offset %u and length %u\n", 2475 - bvec->bv_offset + bvec->bv_len != PAGE_CACHE_SIZE 2476 - ? KERN_ERR "partial" : KERN_INFO "incomplete", 2477 - bvec->bv_offset, bvec->bv_len); 2466 + if (bvec->bv_offset || bvec->bv_len != PAGE_CACHE_SIZE) { 2467 + if (bvec->bv_offset + bvec->bv_len != PAGE_CACHE_SIZE) 2468 + btrfs_err(BTRFS_I(page->mapping->host)->root->fs_info, 2469 + "partial page read in btrfs with offset %u and length %u", 2470 + bvec->bv_offset, bvec->bv_len); 2471 + else 2472 + btrfs_info(BTRFS_I(page->mapping->host)->root->fs_info, 2473 + "incomplete page read in btrfs with offset %u and " 2474 + "length %u", 2475 + bvec->bv_offset, bvec->bv_len); 2476 + } 2478 2477 2479 2478 start = page_offset(page); 2480 2479 end = start + bvec->bv_offset + bvec->bv_len - 1; ··· 3340 3327 3341 3328 set_range_writeback(tree, cur, cur + iosize - 1); 3342 3329 if (!PageWriteback(page)) { 3343 - printk(KERN_ERR "btrfs warning page %lu not " 3344 - "writeback, cur %llu end %llu\n", 3330 + btrfs_err(BTRFS_I(inode)->root->fs_info, 3331 + "page %lu not writeback, cur %llu end %llu", 3345 3332 page->index, cur, end); 3346 3333 } 3347 3334 ··· 5162 5149 unsigned long src_i; 5163 5150 5164 5151 if (src_offset + len > dst->len) { 5165 - printk(KERN_ERR "btrfs memmove bogus src_offset %lu move " 5152 + printk(KERN_ERR "BTRFS: memmove bogus src_offset %lu move " 5166 5153 "len %lu dst len %lu\n", src_offset, len, dst->len); 5167 5154 BUG_ON(1); 5168 5155 } 5169 5156 if (dst_offset + len > dst->len) { 5170 - printk(KERN_ERR "btrfs memmove bogus dst_offset %lu move " 5157 + printk(KERN_ERR "BTRFS: memmove bogus dst_offset %lu move " 5171 5158 "len %lu dst len %lu\n", dst_offset, len, dst->len); 5172 5159 BUG_ON(1); 5173 5160 } ··· 5209 5196 unsigned long src_i; 5210 5197 5211 5198 if (src_offset + len > dst->len) { 5212 - printk(KERN_ERR "btrfs memmove bogus src_offset %lu move " 5199 + printk(KERN_ERR "BTRFS: memmove bogus src_offset %lu move " 5213 5200 "len %lu len %lu\n", src_offset, len, dst->len); 5214 5201 BUG_ON(1); 5215 5202 } 5216 5203 if (dst_offset + len > dst->len) { 5217 - printk(KERN_ERR "btrfs memmove bogus dst_offset %lu move " 5204 + printk(KERN_ERR "BTRFS: memmove bogus dst_offset %lu move " 5218 5205 "len %lu len %lu\n", dst_offset, len, dst->len); 5219 5206 BUG_ON(1); 5220 5207 }
+2 -2
fs/btrfs/file-item.c
··· 246 246 offset + bvec->bv_len - 1, 247 247 EXTENT_NODATASUM, GFP_NOFS); 248 248 } else { 249 - printk(KERN_INFO "btrfs no csum found " 250 - "for inode %llu start %llu\n", 249 + btrfs_info(BTRFS_I(inode)->root->fs_info, 250 + "no csum found for inode %llu start %llu", 251 251 btrfs_ino(inode), offset); 252 252 } 253 253 item = NULL;
+11 -10
fs/btrfs/free-space-cache.c
··· 347 347 btrfs_readpage(NULL, page); 348 348 lock_page(page); 349 349 if (!PageUptodate(page)) { 350 - printk(KERN_ERR "btrfs: error reading free " 351 - "space cache\n"); 350 + btrfs_err(BTRFS_I(inode)->root->fs_info, 351 + "error reading free space cache"); 352 352 io_ctl_drop_pages(io_ctl); 353 353 return -EIO; 354 354 } ··· 405 405 406 406 gen = io_ctl->cur; 407 407 if (le64_to_cpu(*gen) != generation) { 408 - printk_ratelimited(KERN_ERR "btrfs: space cache generation " 408 + printk_ratelimited(KERN_ERR "BTRFS: space cache generation " 409 409 "(%Lu) does not match inode (%Lu)\n", *gen, 410 410 generation); 411 411 io_ctl_unmap_page(io_ctl); ··· 463 463 PAGE_CACHE_SIZE - offset); 464 464 btrfs_csum_final(crc, (char *)&crc); 465 465 if (val != crc) { 466 - printk_ratelimited(KERN_ERR "btrfs: csum mismatch on free " 466 + printk_ratelimited(KERN_ERR "BTRFS: csum mismatch on free " 467 467 "space cache\n"); 468 468 io_ctl_unmap_page(io_ctl); 469 469 return -EIO; ··· 1902 1902 spin_unlock(&ctl->tree_lock); 1903 1903 1904 1904 if (ret) { 1905 - printk(KERN_CRIT "btrfs: unable to add free space :%d\n", ret); 1905 + printk(KERN_CRIT "BTRFS: unable to add free space :%d\n", ret); 1906 1906 ASSERT(ret != -EEXIST); 1907 1907 } 1908 1908 ··· 2011 2011 info = rb_entry(n, struct btrfs_free_space, offset_index); 2012 2012 if (info->bytes >= bytes && !block_group->ro) 2013 2013 count++; 2014 - printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n", 2015 - info->offset, info->bytes, 2014 + btrfs_crit(block_group->fs_info, 2015 + "entry offset %llu, bytes %llu, bitmap %s", 2016 + info->offset, info->bytes, 2016 2017 (info->bitmap) ? "yes" : "no"); 2017 2018 } 2018 - printk(KERN_INFO "block group has cluster?: %s\n", 2019 + btrfs_info(block_group->fs_info, "block group has cluster?: %s", 2019 2020 list_empty(&block_group->cluster_list) ? "no" : "yes"); 2020 - printk(KERN_INFO "%d blocks of free space at or bigger than bytes is" 2021 - "\n", count); 2021 + btrfs_info(block_group->fs_info, 2022 + "%d blocks of free space at or bigger than bytes is", count); 2022 2023 } 2023 2024 2024 2025 void btrfs_init_free_space_ctl(struct btrfs_block_group_cache *block_group)
+2 -2
fs/btrfs/inode.c
··· 6966 6966 struct btrfs_dio_private *dip = bio->bi_private; 6967 6967 6968 6968 if (err) { 6969 - printk(KERN_ERR "btrfs direct IO failed ino %llu rw %lu " 6970 - "sector %#Lx len %u err no %d\n", 6969 + btrfs_err(BTRFS_I(dip->inode)->root->fs_info, 6970 + "direct IO failed ino %llu rw %lu sector %#Lx len %u err no %d", 6971 6971 btrfs_ino(dip->inode), bio->bi_rw, 6972 6972 (unsigned long long)bio->bi_sector, bio->bi_size, err); 6973 6973 dip->errors = 1;
+15 -15
fs/btrfs/ioctl.c
··· 1262 1262 break; 1263 1263 1264 1264 if (btrfs_defrag_cancelled(root->fs_info)) { 1265 - printk(KERN_DEBUG "btrfs: defrag_file cancelled\n"); 1265 + printk(KERN_DEBUG "BTRFS: defrag_file cancelled\n"); 1266 1266 ret = -EAGAIN; 1267 1267 break; 1268 1268 } ··· 1424 1424 ret = -EINVAL; 1425 1425 goto out_free; 1426 1426 } 1427 - printk(KERN_INFO "btrfs: resizing devid %llu\n", devid); 1427 + btrfs_info(root->fs_info, "resizing devid %llu", devid); 1428 1428 } 1429 1429 1430 1430 device = btrfs_find_device(root->fs_info, devid, NULL, NULL); 1431 1431 if (!device) { 1432 - printk(KERN_INFO "btrfs: resizer unable to find device %llu\n", 1432 + btrfs_info(root->fs_info, "resizer unable to find device %llu", 1433 1433 devid); 1434 1434 ret = -ENODEV; 1435 1435 goto out_free; 1436 1436 } 1437 1437 1438 1438 if (!device->writeable) { 1439 - printk(KERN_INFO "btrfs: resizer unable to apply on " 1440 - "readonly device %llu\n", 1439 + btrfs_info(root->fs_info, 1440 + "resizer unable to apply on readonly device %llu", 1441 1441 devid); 1442 1442 ret = -EPERM; 1443 1443 goto out_free; ··· 1489 1489 do_div(new_size, root->sectorsize); 1490 1490 new_size *= root->sectorsize; 1491 1491 1492 - printk_in_rcu(KERN_INFO "btrfs: new size for %s is %llu\n", 1492 + printk_in_rcu(KERN_INFO "BTRFS: new size for %s is %llu\n", 1493 1493 rcu_str_deref(device->name), new_size); 1494 1494 1495 1495 if (new_size > old_size) { ··· 1550 1550 1551 1551 src_inode = file_inode(src.file); 1552 1552 if (src_inode->i_sb != file_inode(file)->i_sb) { 1553 - printk(KERN_INFO "btrfs: Snapshot src from " 1554 - "another FS\n"); 1553 + btrfs_info(BTRFS_I(src_inode)->root->fs_info, 1554 + "Snapshot src from another FS"); 1555 1555 ret = -EINVAL; 1556 1556 } else { 1557 1557 ret = btrfs_mksubvol(&file->f_path, name, namelen, ··· 1934 1934 key.offset = (u64)-1; 1935 1935 root = btrfs_read_fs_root_no_name(info, &key); 1936 1936 if (IS_ERR(root)) { 1937 - printk(KERN_ERR "could not find root %llu\n", 1937 + printk(KERN_ERR "BTRFS: could not find root %llu\n", 1938 1938 sk->tree_id); 1939 1939 btrfs_free_path(path); 1940 1940 return -ENOENT; ··· 2024 2024 key.offset = (u64)-1; 2025 2025 root = btrfs_read_fs_root_no_name(info, &key); 2026 2026 if (IS_ERR(root)) { 2027 - printk(KERN_ERR "could not find root %llu\n", tree_id); 2027 + printk(KERN_ERR "BTRFS: could not find root %llu\n", tree_id); 2028 2028 ret = -ENOENT; 2029 2029 goto out; 2030 2030 } ··· 3367 3367 if (IS_ERR_OR_NULL(di)) { 3368 3368 btrfs_free_path(path); 3369 3369 btrfs_end_transaction(trans, root); 3370 - printk(KERN_ERR "Umm, you don't have the default dir item, " 3371 - "this isn't going to work\n"); 3370 + btrfs_err(new_root->fs_info, "Umm, you don't have the default dir" 3371 + "item, this isn't going to work"); 3372 3372 ret = -ENOENT; 3373 3373 goto out; 3374 3374 } ··· 4469 4469 len = strnlen(label, BTRFS_LABEL_SIZE); 4470 4470 4471 4471 if (len == BTRFS_LABEL_SIZE) { 4472 - pr_warn("btrfs: label is too long, return the first %zu bytes\n", 4473 - --len); 4472 + btrfs_warn(root->fs_info, 4473 + "label is too long, return the first %zu bytes", --len); 4474 4474 } 4475 4475 4476 4476 ret = copy_to_user(arg, label, len); ··· 4493 4493 return -EFAULT; 4494 4494 4495 4495 if (strnlen(label, BTRFS_LABEL_SIZE) == BTRFS_LABEL_SIZE) { 4496 - pr_err("btrfs: unable to set label with more than %d bytes\n", 4496 + btrfs_err(root->fs_info, "unable to set label with more than %d bytes", 4497 4497 BTRFS_LABEL_SIZE - 1); 4498 4498 return -EINVAL; 4499 4499 }
+3 -3
fs/btrfs/lzo.c
··· 141 141 ret = lzo1x_1_compress(data_in, in_len, workspace->cbuf, 142 142 &out_len, workspace->mem); 143 143 if (ret != LZO_E_OK) { 144 - printk(KERN_DEBUG "btrfs deflate in loop returned %d\n", 144 + printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n", 145 145 ret); 146 146 ret = -1; 147 147 goto out; ··· 357 357 if (need_unmap) 358 358 kunmap(pages_in[page_in_index - 1]); 359 359 if (ret != LZO_E_OK) { 360 - printk(KERN_WARNING "btrfs decompress failed\n"); 360 + printk(KERN_WARNING "BTRFS: decompress failed\n"); 361 361 ret = -1; 362 362 break; 363 363 } ··· 401 401 out_len = PAGE_CACHE_SIZE; 402 402 ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len); 403 403 if (ret != LZO_E_OK) { 404 - printk(KERN_WARNING "btrfs decompress failed!\n"); 404 + printk(KERN_WARNING "BTRFS: decompress failed!\n"); 405 405 ret = -1; 406 406 goto out; 407 407 }
+7 -5
fs/btrfs/ordered-data.c
··· 336 336 entry->len); 337 337 *file_offset = dec_end; 338 338 if (dec_start > dec_end) { 339 - printk(KERN_CRIT "bad ordering dec_start %llu end %llu\n", 340 - dec_start, dec_end); 339 + btrfs_crit(BTRFS_I(inode)->root->fs_info, 340 + "bad ordering dec_start %llu end %llu", dec_start, dec_end); 341 341 } 342 342 to_dec = dec_end - dec_start; 343 343 if (to_dec > entry->bytes_left) { 344 - printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n", 345 - entry->bytes_left, to_dec); 344 + btrfs_crit(BTRFS_I(inode)->root->fs_info, 345 + "bad ordered accounting left %llu size %llu", 346 + entry->bytes_left, to_dec); 346 347 } 347 348 entry->bytes_left -= to_dec; 348 349 if (!uptodate) ··· 402 401 } 403 402 404 403 if (io_size > entry->bytes_left) { 405 - printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n", 404 + btrfs_crit(BTRFS_I(inode)->root->fs_info, 405 + "bad ordered accounting left %llu size %llu", 406 406 entry->bytes_left, io_size); 407 407 } 408 408 entry->bytes_left -= io_size;
+1 -1
fs/btrfs/print-tree.c
··· 154 154 u32 item_size) 155 155 { 156 156 if (!IS_ALIGNED(item_size, sizeof(u64))) { 157 - pr_warn("btrfs: uuid item with illegal size %lu!\n", 157 + pr_warn("BTRFS: uuid item with illegal size %lu!\n", 158 158 (unsigned long)item_size); 159 159 return; 160 160 }
+15 -13
fs/btrfs/qgroup.c
··· 301 301 302 302 if (btrfs_qgroup_status_version(l, ptr) != 303 303 BTRFS_QGROUP_STATUS_VERSION) { 304 - printk(KERN_ERR 305 - "btrfs: old qgroup version, quota disabled\n"); 304 + btrfs_err(fs_info, 305 + "old qgroup version, quota disabled"); 306 306 goto out; 307 307 } 308 308 if (btrfs_qgroup_status_generation(l, ptr) != 309 309 fs_info->generation) { 310 310 flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; 311 - printk(KERN_ERR 312 - "btrfs: qgroup generation mismatch, " 313 - "marked as inconsistent\n"); 311 + btrfs_err(fs_info, 312 + "qgroup generation mismatch, " 313 + "marked as inconsistent"); 314 314 } 315 315 fs_info->qgroup_flags = btrfs_qgroup_status_flags(l, 316 316 ptr); ··· 325 325 qgroup = find_qgroup_rb(fs_info, found_key.offset); 326 326 if ((qgroup && found_key.type == BTRFS_QGROUP_INFO_KEY) || 327 327 (!qgroup && found_key.type == BTRFS_QGROUP_LIMIT_KEY)) { 328 - printk(KERN_ERR "btrfs: inconsitent qgroup config\n"); 328 + btrfs_err(fs_info, "inconsitent qgroup config"); 329 329 flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; 330 330 } 331 331 if (!qgroup) { ··· 396 396 ret = add_relation_rb(fs_info, found_key.objectid, 397 397 found_key.offset); 398 398 if (ret == -ENOENT) { 399 - printk(KERN_WARNING 400 - "btrfs: orphan qgroup relation 0x%llx->0x%llx\n", 399 + btrfs_warn(fs_info, 400 + "orphan qgroup relation 0x%llx->0x%llx", 401 401 found_key.objectid, found_key.offset); 402 402 ret = 0; /* ignore the error */ 403 403 } ··· 1159 1159 limit->rsv_excl); 1160 1160 if (ret) { 1161 1161 fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; 1162 - printk(KERN_INFO "unable to update quota limit for %llu\n", 1162 + btrfs_info(fs_info, "unable to update quota limit for %llu", 1163 1163 qgroupid); 1164 1164 } 1165 1165 ··· 1833 1833 { 1834 1834 if (list_empty(&trans->qgroup_ref_list) && !trans->delayed_ref_elem.seq) 1835 1835 return; 1836 - pr_err("btrfs: qgroups not uptodate in trans handle %p: list is%s empty, seq is %#x.%x\n", 1836 + btrfs_err(trans->root->fs_info, 1837 + "qgroups not uptodate in trans handle %p: list is%s empty, " 1838 + "seq is %#x.%x", 1837 1839 trans, list_empty(&trans->qgroup_ref_list) ? "" : " not", 1838 1840 (u32)(trans->delayed_ref_elem.seq >> 32), 1839 1841 (u32)trans->delayed_ref_elem.seq); ··· 2032 2030 mutex_unlock(&fs_info->qgroup_rescan_lock); 2033 2031 2034 2032 if (err >= 0) { 2035 - pr_info("btrfs: qgroup scan completed%s\n", 2033 + btrfs_info(fs_info, "qgroup scan completed%s", 2036 2034 err == 2 ? " (inconsistency flag cleared)" : ""); 2037 2035 } else { 2038 - pr_err("btrfs: qgroup scan failed with %d\n", err); 2036 + btrfs_err(fs_info, "qgroup scan failed with %d", err); 2039 2037 } 2040 2038 2041 2039 complete_all(&fs_info->qgroup_rescan_completion); ··· 2091 2089 2092 2090 if (ret) { 2093 2091 err: 2094 - pr_info("btrfs: qgroup_rescan_init failed with %d\n", ret); 2092 + btrfs_info(fs_info, "qgroup_rescan_init failed with %d", ret); 2095 2093 return ret; 2096 2094 } 2097 2095
+5 -4
fs/btrfs/reada.c
··· 189 189 */ 190 190 #ifdef DEBUG 191 191 if (rec->generation != generation) { 192 - printk(KERN_DEBUG "generation mismatch for " 193 - "(%llu,%d,%llu) %llu != %llu\n", 192 + btrfs_debug(root->fs_info, 193 + "generation mismatch for (%llu,%d,%llu) %llu != %llu", 194 194 key.objectid, key.type, key.offset, 195 195 rec->generation, generation); 196 196 } ··· 365 365 goto error; 366 366 367 367 if (bbio->num_stripes > BTRFS_MAX_MIRRORS) { 368 - printk(KERN_ERR "btrfs readahead: more than %d copies not " 369 - "supported", BTRFS_MAX_MIRRORS); 368 + btrfs_err(root->fs_info, 369 + "readahead: more than %d copies not supported", 370 + BTRFS_MAX_MIRRORS); 370 371 goto error; 371 372 } 372 373
+2 -2
fs/btrfs/relocation.c
··· 4245 4245 goto out; 4246 4246 } 4247 4247 4248 - printk(KERN_INFO "btrfs: relocating block group %llu flags %llu\n", 4248 + btrfs_info(extent_root->fs_info, "relocating block group %llu flags %llu", 4249 4249 rc->block_group->key.objectid, rc->block_group->flags); 4250 4250 4251 4251 ret = btrfs_start_delalloc_roots(fs_info, 0); ··· 4267 4267 if (rc->extents_found == 0) 4268 4268 break; 4269 4269 4270 - printk(KERN_INFO "btrfs: found %llu extents\n", 4270 + btrfs_info(extent_root->fs_info, "found %llu extents", 4271 4271 rc->extents_found); 4272 4272 4273 4273 if (rc->stage == MOVE_DATA_EXTENTS && rc->found_file_extent) {
+2 -2
fs/btrfs/root-tree.c
··· 44 44 if (!need_reset && btrfs_root_generation(item) 45 45 != btrfs_root_generation_v2(item)) { 46 46 if (btrfs_root_generation_v2(item) != 0) { 47 - printk(KERN_WARNING "btrfs: mismatching " 47 + printk(KERN_WARNING "BTRFS: mismatching " 48 48 "generation and generation_v2 " 49 49 "found in root item. This root " 50 50 "was probably mounted with an " ··· 154 154 155 155 if (ret != 0) { 156 156 btrfs_print_leaf(root, path->nodes[0]); 157 - printk(KERN_CRIT "unable to update root key %llu %u %llu\n", 157 + btrfs_crit(root->fs_info, "unable to update root key %llu %u %llu", 158 158 key->objectid, key->type, key->offset); 159 159 BUG_ON(1); 160 160 }
+27 -23
fs/btrfs/scrub.c
··· 505 505 * hold all of the paths here 506 506 */ 507 507 for (i = 0; i < ipath->fspath->elem_cnt; ++i) 508 - printk_in_rcu(KERN_WARNING "btrfs: %s at logical %llu on dev " 508 + printk_in_rcu(KERN_WARNING "BTRFS: %s at logical %llu on dev " 509 509 "%s, sector %llu, root %llu, inode %llu, offset %llu, " 510 510 "length %llu, links %u (path: %s)\n", swarn->errstr, 511 511 swarn->logical, rcu_str_deref(swarn->dev->name), ··· 517 517 return 0; 518 518 519 519 err: 520 - printk_in_rcu(KERN_WARNING "btrfs: %s at logical %llu on dev " 520 + printk_in_rcu(KERN_WARNING "BTRFS: %s at logical %llu on dev " 521 521 "%s, sector %llu, root %llu, inode %llu, offset %llu: path " 522 522 "resolving failed with ret=%d\n", swarn->errstr, 523 523 swarn->logical, rcu_str_deref(swarn->dev->name), ··· 580 580 ret = tree_backref_for_extent(&ptr, eb, ei, item_size, 581 581 &ref_root, &ref_level); 582 582 printk_in_rcu(KERN_WARNING 583 - "btrfs: %s at logical %llu on dev %s, " 583 + "BTRFS: %s at logical %llu on dev %s, " 584 584 "sector %llu: metadata %s (level %d) in tree " 585 585 "%llu\n", errstr, swarn.logical, 586 586 rcu_str_deref(dev->name), ··· 782 782 btrfs_dev_replace_stats_inc( 783 783 &sctx->dev_root->fs_info->dev_replace. 784 784 num_uncorrectable_read_errors); 785 - printk_ratelimited_in_rcu(KERN_ERR 786 - "btrfs: unable to fixup (nodatasum) error at logical %llu on dev %s\n", 785 + printk_ratelimited_in_rcu(KERN_ERR "BTRFS: " 786 + "unable to fixup (nodatasum) error at logical %llu on dev %s\n", 787 787 fixup->logical, rcu_str_deref(fixup->dev->name)); 788 788 } 789 789 ··· 1184 1184 sctx->stat.corrected_errors++; 1185 1185 spin_unlock(&sctx->stat_lock); 1186 1186 printk_ratelimited_in_rcu(KERN_ERR 1187 - "btrfs: fixed up error at logical %llu on dev %s\n", 1187 + "BTRFS: fixed up error at logical %llu on dev %s\n", 1188 1188 logical, rcu_str_deref(dev->name)); 1189 1189 } 1190 1190 } else { ··· 1193 1193 sctx->stat.uncorrectable_errors++; 1194 1194 spin_unlock(&sctx->stat_lock); 1195 1195 printk_ratelimited_in_rcu(KERN_ERR 1196 - "btrfs: unable to fixup (regular) error at logical %llu on dev %s\n", 1196 + "BTRFS: unable to fixup (regular) error at logical %llu on dev %s\n", 1197 1197 logical, rcu_str_deref(dev->name)); 1198 1198 } 1199 1199 ··· 1441 1441 int ret; 1442 1442 1443 1443 if (!page_bad->dev->bdev) { 1444 - printk_ratelimited(KERN_WARNING 1445 - "btrfs: scrub_repair_page_from_good_copy(bdev == NULL) is unexpected!\n"); 1444 + printk_ratelimited(KERN_WARNING "BTRFS: " 1445 + "scrub_repair_page_from_good_copy(bdev == NULL) " 1446 + "is unexpected!\n"); 1446 1447 return -EIO; 1447 1448 } 1448 1449 ··· 1901 1900 * This case is handled correctly (but _very_ slowly). 1902 1901 */ 1903 1902 printk_ratelimited(KERN_WARNING 1904 - "btrfs: scrub_submit(bio bdev == NULL) is unexpected!\n"); 1903 + "BTRFS: scrub_submit(bio bdev == NULL) is unexpected!\n"); 1905 1904 bio_endio(sbio->bio, -EIO); 1906 1905 } else { 1907 1906 btrfsic_submit_bio(READ, sbio->bio); ··· 2441 2440 2442 2441 if (key.objectid < logical && 2443 2442 (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK)) { 2444 - printk(KERN_ERR 2445 - "btrfs scrub: tree block %llu spanning " 2446 - "stripes, ignored. logical=%llu\n", 2443 + btrfs_err(fs_info, 2444 + "scrub: tree block %llu spanning " 2445 + "stripes, ignored. logical=%llu", 2447 2446 key.objectid, logical); 2448 2447 goto next; 2449 2448 } ··· 2813 2812 * check some assumptions 2814 2813 */ 2815 2814 if (fs_info->chunk_root->nodesize != fs_info->chunk_root->leafsize) { 2816 - printk(KERN_ERR 2817 - "btrfs_scrub: size assumption nodesize == leafsize (%d == %d) fails\n", 2815 + btrfs_err(fs_info, 2816 + "scrub: size assumption nodesize == leafsize (%d == %d) fails", 2818 2817 fs_info->chunk_root->nodesize, 2819 2818 fs_info->chunk_root->leafsize); 2820 2819 return -EINVAL; ··· 2826 2825 * the way scrub is implemented. Do not handle this 2827 2826 * situation at all because it won't ever happen. 2828 2827 */ 2829 - printk(KERN_ERR 2830 - "btrfs_scrub: size assumption nodesize <= BTRFS_STRIPE_LEN (%d <= %d) fails\n", 2828 + btrfs_err(fs_info, 2829 + "scrub: size assumption nodesize <= BTRFS_STRIPE_LEN (%d <= %d) fails", 2831 2830 fs_info->chunk_root->nodesize, BTRFS_STRIPE_LEN); 2832 2831 return -EINVAL; 2833 2832 } 2834 2833 2835 2834 if (fs_info->chunk_root->sectorsize != PAGE_SIZE) { 2836 2835 /* not supported for data w/o checksums */ 2837 - printk(KERN_ERR 2838 - "btrfs_scrub: size assumption sectorsize != PAGE_SIZE (%d != %lu) fails\n", 2836 + btrfs_err(fs_info, 2837 + "scrub: size assumption sectorsize != PAGE_SIZE " 2838 + "(%d != %lu) fails", 2839 2839 fs_info->chunk_root->sectorsize, PAGE_SIZE); 2840 2840 return -EINVAL; 2841 2841 } ··· 2849 2847 * would exhaust the array bounds of pagev member in 2850 2848 * struct scrub_block 2851 2849 */ 2852 - pr_err("btrfs_scrub: size assumption nodesize and sectorsize <= SCRUB_MAX_PAGES_PER_BLOCK (%d <= %d && %d <= %d) fails\n", 2850 + btrfs_err(fs_info, "scrub: size assumption nodesize and sectorsize " 2851 + "<= SCRUB_MAX_PAGES_PER_BLOCK (%d <= %d && %d <= %d) fails", 2853 2852 fs_info->chunk_root->nodesize, 2854 2853 SCRUB_MAX_PAGES_PER_BLOCK, 2855 2854 fs_info->chunk_root->sectorsize, ··· 3166 3163 ret = iterate_inodes_from_logical(logical, fs_info, path, 3167 3164 record_inode_for_nocow, nocow_ctx); 3168 3165 if (ret != 0 && ret != -ENOENT) { 3169 - pr_warn("iterate_inodes_from_logical() failed: log %llu, phys %llu, len %llu, mir %u, ret %d\n", 3166 + btrfs_warn(fs_info, "iterate_inodes_from_logical() failed: log %llu, " 3167 + "phys %llu, len %llu, mir %u, ret %d", 3170 3168 logical, physical_for_dev_replace, len, mirror_num, 3171 3169 ret); 3172 3170 not_written = 1; ··· 3289 3285 again: 3290 3286 page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); 3291 3287 if (!page) { 3292 - pr_err("find_or_create_page() failed\n"); 3288 + btrfs_err(fs_info, "find_or_create_page() failed"); 3293 3289 ret = -ENOMEM; 3294 3290 goto out; 3295 3291 } ··· 3361 3357 return -EIO; 3362 3358 if (!dev->bdev) { 3363 3359 printk_ratelimited(KERN_WARNING 3364 - "btrfs: scrub write_page_nocow(bdev == NULL) is unexpected!\n"); 3360 + "BTRFS: scrub write_page_nocow(bdev == NULL) is unexpected!\n"); 3365 3361 return -EIO; 3366 3362 } 3367 3363 bio = btrfs_io_bio_alloc(GFP_NOFS, 1);
+2 -2
fs/btrfs/send.c
··· 1234 1234 if (!backref_ctx->found_itself) { 1235 1235 /* found a bug in backref code? */ 1236 1236 ret = -EIO; 1237 - printk(KERN_ERR "btrfs: ERROR did not find backref in " 1237 + btrfs_err(sctx->send_root->fs_info, "did not find backref in " 1238 1238 "send_root. inode=%llu, offset=%llu, " 1239 1239 "disk_byte=%llu found extent=%llu\n", 1240 1240 ino, data_offset, disk_byte, found_key.objectid); ··· 4648 4648 spin_unlock(&send_root->root_item_lock); 4649 4649 4650 4650 if (ctransid != start_ctransid) { 4651 - WARN(1, KERN_WARNING "btrfs: the root that you're trying to " 4651 + WARN(1, KERN_WARNING "BTRFS: the root that you're trying to " 4652 4652 "send was modified in between. This is " 4653 4653 "probably a bug.\n"); 4654 4654 ret = -EIO;
+49 -55
fs/btrfs/super.c
··· 152 152 vaf.fmt = fmt; 153 153 vaf.va = &args; 154 154 155 - printk(KERN_CRIT "BTRFS error (device %s) in %s:%d: errno=%d %s (%pV)\n", 155 + printk(KERN_CRIT 156 + "BTRFS: error (device %s) in %s:%d: errno=%d %s (%pV)\n", 156 157 sb->s_id, function, line, errno, errstr, &vaf); 157 158 va_end(args); 158 159 } else { 159 - printk(KERN_CRIT "BTRFS error (device %s) in %s:%d: errno=%d %s\n", 160 + printk(KERN_CRIT "BTRFS: error (device %s) in %s:%d: errno=%d %s\n", 160 161 sb->s_id, function, line, errno, errstr); 161 162 } 162 163 ··· 251 250 */ 252 251 if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, 253 252 &root->fs_info->fs_state)) { 254 - WARN(1, KERN_DEBUG "btrfs: Transaction aborted (error %d)\n", 253 + WARN(1, KERN_DEBUG "BTRFS: Transaction aborted (error %d)\n", 255 254 errno); 256 255 } 257 256 trans->aborted = errno; ··· 295 294 panic(KERN_CRIT "BTRFS panic (device %s) in %s:%d: %pV (errno=%d %s)\n", 296 295 s_id, function, line, &vaf, errno, errstr); 297 296 298 - printk(KERN_CRIT "BTRFS panic (device %s) in %s:%d: %pV (errno=%d %s)\n", 299 - s_id, function, line, &vaf, errno, errstr); 297 + btrfs_crit(fs_info, "panic in %s:%d: %pV (errno=%d %s)", 298 + function, line, &vaf, errno, errstr); 300 299 va_end(args); 301 300 /* Caller calls BUG() */ 302 301 } ··· 410 409 token = match_token(p, tokens, args); 411 410 switch (token) { 412 411 case Opt_degraded: 413 - printk(KERN_INFO "btrfs: allowing degraded mounts\n"); 412 + btrfs_info(root->fs_info, "allowing degraded mounts"); 414 413 btrfs_set_opt(info->mount_opt, DEGRADED); 415 414 break; 416 415 case Opt_subvol: ··· 423 422 */ 424 423 break; 425 424 case Opt_nodatasum: 426 - printk(KERN_INFO "btrfs: setting nodatasum\n"); 425 + btrfs_info(root->fs_info, "setting nodatasum"); 427 426 btrfs_set_opt(info->mount_opt, NODATASUM); 428 427 break; 429 428 case Opt_nodatacow: 430 429 if (!btrfs_test_opt(root, COMPRESS) || 431 430 !btrfs_test_opt(root, FORCE_COMPRESS)) { 432 - printk(KERN_INFO "btrfs: setting nodatacow, compression disabled\n"); 431 + btrfs_info(root->fs_info, 432 + "setting nodatacow, compression disabled"); 433 433 } else { 434 - printk(KERN_INFO "btrfs: setting nodatacow\n"); 434 + btrfs_info(root->fs_info, "setting nodatacow"); 435 435 } 436 436 btrfs_clear_opt(info->mount_opt, COMPRESS); 437 437 btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS); ··· 472 470 473 471 if (compress_force) { 474 472 btrfs_set_opt(info->mount_opt, FORCE_COMPRESS); 475 - pr_info("btrfs: force %s compression\n", 473 + btrfs_info(root->fs_info, "force %s compression", 476 474 compress_type); 477 475 } else if (btrfs_test_opt(root, COMPRESS)) { 478 476 pr_info("btrfs: use %s compression\n", ··· 480 478 } 481 479 break; 482 480 case Opt_ssd: 483 - printk(KERN_INFO "btrfs: use ssd allocation scheme\n"); 481 + btrfs_info(root->fs_info, "use ssd allocation scheme"); 484 482 btrfs_set_opt(info->mount_opt, SSD); 485 483 break; 486 484 case Opt_ssd_spread: 487 - printk(KERN_INFO "btrfs: use spread ssd " 488 - "allocation scheme\n"); 485 + btrfs_info(root->fs_info, "use spread ssd allocation scheme"); 489 486 btrfs_set_opt(info->mount_opt, SSD); 490 487 btrfs_set_opt(info->mount_opt, SSD_SPREAD); 491 488 break; 492 489 case Opt_nossd: 493 - printk(KERN_INFO "btrfs: not using ssd allocation " 494 - "scheme\n"); 490 + btrfs_info(root->fs_info, "not using ssd allocation scheme"); 495 491 btrfs_set_opt(info->mount_opt, NOSSD); 496 492 btrfs_clear_opt(info->mount_opt, SSD); 497 493 btrfs_clear_opt(info->mount_opt, SSD_SPREAD); 498 494 break; 499 495 case Opt_nobarrier: 500 - printk(KERN_INFO "btrfs: turning off barriers\n"); 496 + btrfs_info(root->fs_info, "turning off barriers"); 501 497 btrfs_set_opt(info->mount_opt, NOBARRIER); 502 498 break; 503 499 case Opt_thread_pool: ··· 520 520 info->max_inline, 521 521 root->sectorsize); 522 522 } 523 - printk(KERN_INFO "btrfs: max_inline at %llu\n", 523 + btrfs_info(root->fs_info, "max_inline at %llu", 524 524 info->max_inline); 525 525 } else { 526 526 ret = -ENOMEM; ··· 534 534 info->alloc_start = memparse(num, NULL); 535 535 mutex_unlock(&info->chunk_mutex); 536 536 kfree(num); 537 - printk(KERN_INFO 538 - "btrfs: allocations start at %llu\n", 537 + btrfs_info(root->fs_info, "allocations start at %llu", 539 538 info->alloc_start); 540 539 } else { 541 540 ret = -ENOMEM; ··· 545 546 root->fs_info->sb->s_flags &= ~MS_POSIXACL; 546 547 break; 547 548 case Opt_notreelog: 548 - printk(KERN_INFO "btrfs: disabling tree log\n"); 549 + btrfs_info(root->fs_info, "disabling tree log"); 549 550 btrfs_set_opt(info->mount_opt, NOTREELOG); 550 551 break; 551 552 case Opt_flushoncommit: 552 - printk(KERN_INFO "btrfs: turning on flush-on-commit\n"); 553 + btrfs_info(root->fs_info, "turning on flush-on-commit"); 553 554 btrfs_set_opt(info->mount_opt, FLUSHONCOMMIT); 554 555 break; 555 556 case Opt_ratio: ··· 558 559 goto out; 559 560 } else if (intarg >= 0) { 560 561 info->metadata_ratio = intarg; 561 - printk(KERN_INFO "btrfs: metadata ratio %d\n", 562 + btrfs_info(root->fs_info, "metadata ratio %d", 562 563 info->metadata_ratio); 563 564 } else { 564 565 ret = -EINVAL; ··· 575 576 btrfs_set_opt(info->mount_opt, RESCAN_UUID_TREE); 576 577 break; 577 578 case Opt_no_space_cache: 578 - printk(KERN_INFO "btrfs: disabling disk space caching\n"); 579 + btrfs_info(root->fs_info, "disabling disk space caching"); 579 580 btrfs_clear_opt(info->mount_opt, SPACE_CACHE); 580 581 break; 581 582 case Opt_inode_cache: 582 - printk(KERN_INFO "btrfs: enabling inode map caching\n"); 583 + btrfs_info(root->fs_info, "enabling inode map caching"); 583 584 btrfs_set_opt(info->mount_opt, INODE_MAP_CACHE); 584 585 break; 585 586 case Opt_clear_cache: 586 - printk(KERN_INFO "btrfs: force clearing of disk cache\n"); 587 + btrfs_info(root->fs_info, "force clearing of disk cache"); 587 588 btrfs_set_opt(info->mount_opt, CLEAR_CACHE); 588 589 break; 589 590 case Opt_user_subvol_rm_allowed: ··· 593 594 btrfs_set_opt(info->mount_opt, ENOSPC_DEBUG); 594 595 break; 595 596 case Opt_defrag: 596 - printk(KERN_INFO "btrfs: enabling auto defrag\n"); 597 + btrfs_info(root->fs_info, "enabling auto defrag"); 597 598 btrfs_set_opt(info->mount_opt, AUTO_DEFRAG); 598 599 break; 599 600 case Opt_recovery: 600 - printk(KERN_INFO "btrfs: enabling auto recovery\n"); 601 + btrfs_info(root->fs_info, "enabling auto recovery"); 601 602 btrfs_set_opt(info->mount_opt, RECOVERY); 602 603 break; 603 604 case Opt_skip_balance: ··· 605 606 break; 606 607 #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY 607 608 case Opt_check_integrity_including_extent_data: 608 - printk(KERN_INFO "btrfs: enabling check integrity" 609 - " including extent data\n"); 609 + btrfs_info(root->fs_info, 610 + "enabling check integrity including extent data"); 610 611 btrfs_set_opt(info->mount_opt, 611 612 CHECK_INTEGRITY_INCLUDING_EXTENT_DATA); 612 613 btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY); 613 614 break; 614 615 case Opt_check_integrity: 615 - printk(KERN_INFO "btrfs: enabling check integrity\n"); 616 + btrfs_info(root->fs_info, "enabling check integrity"); 616 617 btrfs_set_opt(info->mount_opt, CHECK_INTEGRITY); 617 618 break; 618 619 case Opt_check_integrity_print_mask: ··· 621 622 goto out; 622 623 } else if (intarg >= 0) { 623 624 info->check_integrity_print_mask = intarg; 624 - printk(KERN_INFO "btrfs:" 625 - " check_integrity_print_mask 0x%x\n", 625 + btrfs_info(root->fs_info, "check_integrity_print_mask 0x%x", 626 626 info->check_integrity_print_mask); 627 627 } else { 628 628 ret = -EINVAL; ··· 632 634 case Opt_check_integrity_including_extent_data: 633 635 case Opt_check_integrity: 634 636 case Opt_check_integrity_print_mask: 635 - printk(KERN_ERR "btrfs: support for check_integrity*" 636 - " not compiled in!\n"); 637 + btrfs_err(root->fs_info, 638 + "support for check_integrity* not compiled in!"); 637 639 ret = -EINVAL; 638 640 goto out; 639 641 #endif ··· 653 655 intarg = 0; 654 656 ret = match_int(&args[0], &intarg); 655 657 if (ret < 0) { 656 - printk(KERN_ERR 657 - "btrfs: invalid commit interval\n"); 658 + btrfs_err(root->fs_info, "invalid commit interval"); 658 659 ret = -EINVAL; 659 660 goto out; 660 661 } 661 662 if (intarg > 0) { 662 663 if (intarg > 300) { 663 - printk(KERN_WARNING 664 - "btrfs: excessive commit interval %d\n", 664 + btrfs_warn(root->fs_info, "excessive commit interval %d", 665 665 intarg); 666 666 } 667 667 info->commit_interval = intarg; 668 668 } else { 669 - printk(KERN_INFO 670 - "btrfs: using default commit interval %ds\n", 669 + btrfs_info(root->fs_info, "using default commit interval %ds", 671 670 BTRFS_DEFAULT_COMMIT_INTERVAL); 672 671 info->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL; 673 672 } 674 673 break; 675 674 case Opt_err: 676 - printk(KERN_INFO "btrfs: unrecognized mount option " 677 - "'%s'\n", p); 675 + btrfs_info(root->fs_info, "unrecognized mount option '%s'", p); 678 676 ret = -EINVAL; 679 677 goto out; 680 678 default: ··· 679 685 } 680 686 out: 681 687 if (!ret && btrfs_test_opt(root, SPACE_CACHE)) 682 - printk(KERN_INFO "btrfs: disk space caching is enabled\n"); 688 + btrfs_info(root->fs_info, "disk space caching is enabled"); 683 689 kfree(orig); 684 690 return ret; 685 691 } ··· 742 748 break; 743 749 case Opt_subvolrootid: 744 750 printk(KERN_WARNING 745 - "btrfs: 'subvolrootid' mount option is deprecated and has no effect\n"); 751 + "BTRFS: 'subvolrootid' mount option is deprecated and has " 752 + "no effect\n"); 746 753 break; 747 754 case Opt_device: 748 755 device_name = match_strdup(&args[0]); ··· 872 877 sb->s_flags |= MS_I_VERSION; 873 878 err = open_ctree(sb, fs_devices, (char *)data); 874 879 if (err) { 875 - printk("btrfs: open_ctree failed\n"); 880 + printk(KERN_ERR "BTRFS: open_ctree failed\n"); 876 881 return err; 877 882 } 878 883 ··· 1110 1115 dput(root); 1111 1116 root = ERR_PTR(-EINVAL); 1112 1117 deactivate_locked_super(s); 1113 - printk(KERN_ERR "btrfs: '%s' is not a valid subvolume\n", 1118 + printk(KERN_ERR "BTRFS: '%s' is not a valid subvolume\n", 1114 1119 subvol_name); 1115 1120 } 1116 1121 ··· 1235 1240 1236 1241 fs_info->thread_pool_size = new_pool_size; 1237 1242 1238 - printk(KERN_INFO "btrfs: resize thread pool %d -> %d\n", 1243 + btrfs_info(fs_info, "resize thread pool %d -> %d", 1239 1244 old_pool_size, new_pool_size); 1240 1245 1241 1246 btrfs_set_max_workers(&fs_info->generic_worker, new_pool_size); ··· 1341 1346 } else { 1342 1347 if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) { 1343 1348 btrfs_err(fs_info, 1344 - "Remounting read-write after error is not allowed\n"); 1349 + "Remounting read-write after error is not allowed"); 1345 1350 ret = -EINVAL; 1346 1351 goto restore; 1347 1352 } ··· 1353 1358 if (fs_info->fs_devices->missing_devices > 1354 1359 fs_info->num_tolerated_disk_barrier_failures && 1355 1360 !(*flags & MS_RDONLY)) { 1356 - printk(KERN_WARNING 1357 - "Btrfs: too many missing devices, writeable remount is not allowed\n"); 1361 + btrfs_warn(fs_info, 1362 + "too many missing devices, writeable remount is not allowed"); 1358 1363 ret = -EACCES; 1359 1364 goto restore; 1360 1365 } ··· 1379 1384 1380 1385 ret = btrfs_resume_dev_replace_async(fs_info); 1381 1386 if (ret) { 1382 - pr_warn("btrfs: failed to resume dev_replace\n"); 1387 + btrfs_warn(fs_info, "failed to resume dev_replace"); 1383 1388 goto restore; 1384 1389 } 1385 1390 1386 1391 if (!fs_info->uuid_root) { 1387 - pr_info("btrfs: creating UUID tree\n"); 1392 + btrfs_info(fs_info, "creating UUID tree"); 1388 1393 ret = btrfs_create_uuid_tree(fs_info); 1389 1394 if (ret) { 1390 - pr_warn("btrfs: failed to create the uuid tree" 1391 - "%d\n", ret); 1395 + btrfs_warn(fs_info, "failed to create the UUID tree %d", ret); 1392 1396 goto restore; 1393 1397 } 1394 1398 } ··· 1767 1773 static void btrfs_interface_exit(void) 1768 1774 { 1769 1775 if (misc_deregister(&btrfs_misc) < 0) 1770 - printk(KERN_INFO "btrfs: misc_deregister failed for control device\n"); 1776 + printk(KERN_INFO "BTRFS: misc_deregister failed for control device\n"); 1771 1777 } 1772 1778 1773 1779 static void btrfs_print_info(void)
+1 -1
fs/btrfs/sysfs.c
··· 374 374 int ret; 375 375 376 376 if (len >= BTRFS_LABEL_SIZE) { 377 - pr_err("btrfs: unable to set label with more than %d bytes\n", 377 + pr_err("BTRFS: unable to set label with more than %d bytes\n", 378 378 BTRFS_LABEL_SIZE - 1); 379 379 return -EINVAL; 380 380 }
+1 -1
fs/btrfs/tests/btrfs-tests.h
··· 21 21 22 22 #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS 23 23 24 - #define test_msg(fmt, ...) pr_info("btrfs: selftest: " fmt, ##__VA_ARGS__) 24 + #define test_msg(fmt, ...) pr_info("BTRFS: selftest: " fmt, ##__VA_ARGS__) 25 25 26 26 int btrfs_test_free_space_cache(void); 27 27 int btrfs_test_extent_buffer_operations(void);
+4 -4
fs/btrfs/transaction.c
··· 198 198 */ 199 199 smp_mb(); 200 200 if (!list_empty(&fs_info->tree_mod_seq_list)) 201 - WARN(1, KERN_ERR "btrfs: tree_mod_seq_list not empty when " 201 + WARN(1, KERN_ERR "BTRFS: tree_mod_seq_list not empty when " 202 202 "creating a fresh transaction\n"); 203 203 if (!RB_EMPTY_ROOT(&fs_info->tree_mod_log)) 204 - WARN(1, KERN_ERR "btrfs: tree_mod_log rb tree not empty when " 204 + WARN(1, KERN_ERR "BTRFS: tree_mod_log rb tree not empty when " 205 205 "creating a fresh transaction\n"); 206 206 atomic64_set(&fs_info->tree_mod_seq, 0); 207 207 ··· 1107 1107 break; 1108 1108 1109 1109 if (btrfs_defrag_cancelled(root->fs_info)) { 1110 - printk(KERN_DEBUG "btrfs: defrag_root cancelled\n"); 1110 + pr_debug("BTRFS: defrag_root cancelled\n"); 1111 1111 ret = -EAGAIN; 1112 1112 break; 1113 1113 } ··· 1981 1981 list_del_init(&root->root_list); 1982 1982 spin_unlock(&fs_info->trans_lock); 1983 1983 1984 - pr_debug("btrfs: cleaner removing %llu\n", root->objectid); 1984 + pr_debug("BTRFS: cleaner removing %llu\n", root->objectid); 1985 1985 1986 1986 btrfs_kill_all_delayed_nodes(root); 1987 1987
+7 -6
fs/btrfs/uuid-tree.c
··· 69 69 ret = -ENOENT; 70 70 71 71 if (!IS_ALIGNED(item_size, sizeof(u64))) { 72 - pr_warn("btrfs: uuid item with illegal size %lu!\n", 72 + btrfs_warn(uuid_root->fs_info, "uuid item with illegal size %lu!", 73 73 (unsigned long)item_size); 74 74 goto out; 75 75 } ··· 137 137 offset = btrfs_item_ptr_offset(eb, slot); 138 138 offset += btrfs_item_size_nr(eb, slot) - sizeof(subid_le); 139 139 } else if (ret < 0) { 140 - pr_warn("btrfs: insert uuid item failed %d (0x%016llx, 0x%016llx) type %u!\n", 140 + btrfs_warn(uuid_root->fs_info, "insert uuid item failed %d " 141 + "(0x%016llx, 0x%016llx) type %u!", 141 142 ret, (unsigned long long)key.objectid, 142 143 (unsigned long long)key.offset, type); 143 144 goto out; ··· 184 183 185 184 ret = btrfs_search_slot(trans, uuid_root, &key, path, -1, 1); 186 185 if (ret < 0) { 187 - pr_warn("btrfs: error %d while searching for uuid item!\n", 186 + btrfs_warn(uuid_root->fs_info, "error %d while searching for uuid item!", 188 187 ret); 189 188 goto out; 190 189 } ··· 198 197 offset = btrfs_item_ptr_offset(eb, slot); 199 198 item_size = btrfs_item_size_nr(eb, slot); 200 199 if (!IS_ALIGNED(item_size, sizeof(u64))) { 201 - pr_warn("btrfs: uuid item with illegal size %lu!\n", 200 + btrfs_warn(uuid_root->fs_info, "uuid item with illegal size %lu!", 202 201 (unsigned long)item_size); 203 202 ret = -ENOENT; 204 203 goto out; ··· 300 299 offset = btrfs_item_ptr_offset(leaf, slot); 301 300 item_size = btrfs_item_size_nr(leaf, slot); 302 301 if (!IS_ALIGNED(item_size, sizeof(u64))) { 303 - pr_warn("btrfs: uuid item with illegal size %lu!\n", 302 + btrfs_warn(fs_info, "uuid item with illegal size %lu!", 304 303 (unsigned long)item_size); 305 304 goto skip; 306 305 } ··· 350 349 out: 351 350 btrfs_free_path(path); 352 351 if (ret) 353 - pr_warn("btrfs: btrfs_uuid_tree_iterate failed %d\n", ret); 352 + btrfs_warn(fs_info, "btrfs_uuid_tree_iterate failed %d", ret); 354 353 return 0; 355 354 }
+44 -45
fs/btrfs/volumes.c
··· 125 125 126 126 ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action); 127 127 if (ret) 128 - pr_warn("Sending event '%d' to kobject: '%s' (%p): failed\n", 128 + pr_warn("BTRFS: Sending event '%d' to kobject: '%s' (%p): failed\n", 129 129 action, 130 130 kobject_name(&disk_to_dev(bdev->bd_disk)->kobj), 131 131 &disk_to_dev(bdev->bd_disk)->kobj); ··· 200 200 201 201 if (IS_ERR(*bdev)) { 202 202 ret = PTR_ERR(*bdev); 203 - printk(KERN_INFO "btrfs: open %s failed\n", device_path); 203 + printk(KERN_INFO "BTRFS: open %s failed\n", device_path); 204 204 goto error; 205 205 } 206 206 ··· 912 912 if (disk_super->label[0]) { 913 913 if (disk_super->label[BTRFS_LABEL_SIZE - 1]) 914 914 disk_super->label[BTRFS_LABEL_SIZE - 1] = '\0'; 915 - printk(KERN_INFO "btrfs: device label %s ", disk_super->label); 915 + printk(KERN_INFO "BTRFS: device label %s ", disk_super->label); 916 916 } else { 917 - printk(KERN_INFO "btrfs: device fsid %pU ", disk_super->fsid); 917 + printk(KERN_INFO "BTRFS: device fsid %pU ", disk_super->fsid); 918 918 } 919 919 920 920 printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path); ··· 1813 1813 } 1814 1814 1815 1815 if (!*device) { 1816 - pr_err("btrfs: no missing device found\n"); 1816 + btrfs_err(root->fs_info, "no missing device found"); 1817 1817 return -ENOENT; 1818 1818 } 1819 1819 ··· 3052 3052 error: 3053 3053 btrfs_free_path(path); 3054 3054 if (enospc_errors) { 3055 - printk(KERN_INFO "btrfs: %d enospc errors during balance\n", 3055 + btrfs_info(fs_info, "%d enospc errors during balance", 3056 3056 enospc_errors); 3057 3057 if (!ret) 3058 3058 ret = -ENOSPC; ··· 3138 3138 if (!(bctl->flags & BTRFS_BALANCE_DATA) || 3139 3139 !(bctl->flags & BTRFS_BALANCE_METADATA) || 3140 3140 memcmp(&bctl->data, &bctl->meta, sizeof(bctl->data))) { 3141 - printk(KERN_ERR "btrfs: with mixed groups data and " 3142 - "metadata balance options must be the same\n"); 3141 + btrfs_err(fs_info, "with mixed groups data and " 3142 + "metadata balance options must be the same"); 3143 3143 ret = -EINVAL; 3144 3144 goto out; 3145 3145 } ··· 3165 3165 if ((bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) && 3166 3166 (!alloc_profile_is_valid(bctl->data.target, 1) || 3167 3167 (bctl->data.target & ~allowed))) { 3168 - printk(KERN_ERR "btrfs: unable to start balance with target " 3169 - "data profile %llu\n", 3168 + btrfs_err(fs_info, "unable to start balance with target " 3169 + "data profile %llu", 3170 3170 bctl->data.target); 3171 3171 ret = -EINVAL; 3172 3172 goto out; ··· 3174 3174 if ((bctl->meta.flags & BTRFS_BALANCE_ARGS_CONVERT) && 3175 3175 (!alloc_profile_is_valid(bctl->meta.target, 1) || 3176 3176 (bctl->meta.target & ~allowed))) { 3177 - printk(KERN_ERR "btrfs: unable to start balance with target " 3178 - "metadata profile %llu\n", 3177 + btrfs_err(fs_info, 3178 + "unable to start balance with target metadata profile %llu", 3179 3179 bctl->meta.target); 3180 3180 ret = -EINVAL; 3181 3181 goto out; ··· 3183 3183 if ((bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT) && 3184 3184 (!alloc_profile_is_valid(bctl->sys.target, 1) || 3185 3185 (bctl->sys.target & ~allowed))) { 3186 - printk(KERN_ERR "btrfs: unable to start balance with target " 3187 - "system profile %llu\n", 3186 + btrfs_err(fs_info, 3187 + "unable to start balance with target system profile %llu", 3188 3188 bctl->sys.target); 3189 3189 ret = -EINVAL; 3190 3190 goto out; ··· 3193 3193 /* allow dup'ed data chunks only in mixed mode */ 3194 3194 if (!mixed && (bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) && 3195 3195 (bctl->data.target & BTRFS_BLOCK_GROUP_DUP)) { 3196 - printk(KERN_ERR "btrfs: dup for data is not allowed\n"); 3196 + btrfs_err(fs_info, "dup for data is not allowed"); 3197 3197 ret = -EINVAL; 3198 3198 goto out; 3199 3199 } ··· 3213 3213 (fs_info->avail_metadata_alloc_bits & allowed) && 3214 3214 !(bctl->meta.target & allowed))) { 3215 3215 if (bctl->flags & BTRFS_BALANCE_FORCE) { 3216 - printk(KERN_INFO "btrfs: force reducing metadata " 3217 - "integrity\n"); 3216 + btrfs_info(fs_info, "force reducing metadata integrity"); 3218 3217 } else { 3219 - printk(KERN_ERR "btrfs: balance will reduce metadata " 3220 - "integrity, use force if you want this\n"); 3218 + btrfs_err(fs_info, "balance will reduce metadata " 3219 + "integrity, use force if you want this"); 3221 3220 ret = -EINVAL; 3222 3221 goto out; 3223 3222 } ··· 3302 3303 mutex_lock(&fs_info->balance_mutex); 3303 3304 3304 3305 if (fs_info->balance_ctl) { 3305 - printk(KERN_INFO "btrfs: continuing balance\n"); 3306 + btrfs_info(fs_info, "continuing balance"); 3306 3307 ret = btrfs_balance(fs_info->balance_ctl, NULL); 3307 3308 } 3308 3309 ··· 3324 3325 spin_unlock(&fs_info->balance_lock); 3325 3326 3326 3327 if (btrfs_test_opt(fs_info->tree_root, SKIP_BALANCE)) { 3327 - printk(KERN_INFO "btrfs: force skipping balance\n"); 3328 + btrfs_info(fs_info, "force skipping balance"); 3328 3329 return 0; 3329 3330 } 3330 3331 ··· 3542 3543 BTRFS_UUID_KEY_SUBVOL, 3543 3544 key.objectid); 3544 3545 if (ret < 0) { 3545 - pr_warn("btrfs: uuid_tree_add failed %d\n", 3546 + btrfs_warn(fs_info, "uuid_tree_add failed %d", 3546 3547 ret); 3547 3548 break; 3548 3549 } ··· 3554 3555 BTRFS_UUID_KEY_RECEIVED_SUBVOL, 3555 3556 key.objectid); 3556 3557 if (ret < 0) { 3557 - pr_warn("btrfs: uuid_tree_add failed %d\n", 3558 + btrfs_warn(fs_info, "uuid_tree_add failed %d", 3558 3559 ret); 3559 3560 break; 3560 3561 } ··· 3589 3590 if (trans && !IS_ERR(trans)) 3590 3591 btrfs_end_transaction(trans, fs_info->uuid_root); 3591 3592 if (ret) 3592 - pr_warn("btrfs: btrfs_uuid_scan_kthread failed %d\n", ret); 3593 + btrfs_warn(fs_info, "btrfs_uuid_scan_kthread failed %d", ret); 3593 3594 else 3594 3595 fs_info->update_uuid_tree_gen = 1; 3595 3596 up(&fs_info->uuid_tree_rescan_sem); ··· 3653 3654 */ 3654 3655 ret = btrfs_uuid_tree_iterate(fs_info, btrfs_check_uuid_tree_entry); 3655 3656 if (ret < 0) { 3656 - pr_warn("btrfs: iterating uuid_tree failed %d\n", ret); 3657 + btrfs_warn(fs_info, "iterating uuid_tree failed %d", ret); 3657 3658 up(&fs_info->uuid_tree_rescan_sem); 3658 3659 return ret; 3659 3660 } ··· 3694 3695 task = kthread_run(btrfs_uuid_scan_kthread, fs_info, "btrfs-uuid"); 3695 3696 if (IS_ERR(task)) { 3696 3697 /* fs_info->update_uuid_tree_gen remains 0 in all error case */ 3697 - pr_warn("btrfs: failed to start uuid_scan task\n"); 3698 + btrfs_warn(fs_info, "failed to start uuid_scan task"); 3698 3699 up(&fs_info->uuid_tree_rescan_sem); 3699 3700 return PTR_ERR(task); 3700 3701 } ··· 3710 3711 task = kthread_run(btrfs_uuid_rescan_kthread, fs_info, "btrfs-uuid"); 3711 3712 if (IS_ERR(task)) { 3712 3713 /* fs_info->update_uuid_tree_gen remains 0 in all error case */ 3713 - pr_warn("btrfs: failed to start uuid_rescan task\n"); 3714 + btrfs_warn(fs_info, "failed to start uuid_rescan task"); 3714 3715 up(&fs_info->uuid_tree_rescan_sem); 3715 3716 return PTR_ERR(task); 3716 3717 } ··· 4032 4033 max_stripe_size = 32 * 1024 * 1024; 4033 4034 max_chunk_size = 2 * max_stripe_size; 4034 4035 } else { 4035 - printk(KERN_ERR "btrfs: invalid chunk type 0x%llx requested\n", 4036 + btrfs_err(info, "invalid chunk type 0x%llx requested\n", 4036 4037 type); 4037 4038 BUG_ON(1); 4038 4039 } ··· 4064 4065 4065 4066 if (!device->writeable) { 4066 4067 WARN(1, KERN_ERR 4067 - "btrfs: read-only device in alloc_list\n"); 4068 + "BTRFS: read-only device in alloc_list\n"); 4068 4069 continue; 4069 4070 } 4070 4071 ··· 5192 5193 read_unlock(&em_tree->lock); 5193 5194 5194 5195 if (!em) { 5195 - printk(KERN_ERR "btrfs: couldn't find em for chunk %Lu\n", 5196 + printk(KERN_ERR "BTRFS: couldn't find em for chunk %Lu\n", 5196 5197 chunk_start); 5197 5198 return -EIO; 5198 5199 } 5199 5200 5200 5201 if (em->start != chunk_start) { 5201 - printk(KERN_ERR "btrfs: bad chunk start, em=%Lu, wanted=%Lu\n", 5202 + printk(KERN_ERR "BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n", 5202 5203 em->start, chunk_start); 5203 5204 free_extent_map(em); 5204 5205 return -EIO; ··· 6122 6123 BUG_ON(!path); 6123 6124 ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); 6124 6125 if (ret < 0) { 6125 - printk_in_rcu(KERN_WARNING "btrfs: error %d while searching for dev_stats item for device %s!\n", 6126 + printk_in_rcu(KERN_WARNING "BTRFS: " 6127 + "error %d while searching for dev_stats item for device %s!\n", 6126 6128 ret, rcu_str_deref(device->name)); 6127 6129 goto out; 6128 6130 } ··· 6133 6133 /* need to delete old one and insert a new one */ 6134 6134 ret = btrfs_del_item(trans, dev_root, path); 6135 6135 if (ret != 0) { 6136 - printk_in_rcu(KERN_WARNING "btrfs: delete too small dev_stats item for device %s failed %d!\n", 6136 + printk_in_rcu(KERN_WARNING "BTRFS: " 6137 + "delete too small dev_stats item for device %s failed %d!\n", 6137 6138 rcu_str_deref(device->name), ret); 6138 6139 goto out; 6139 6140 } ··· 6147 6146 ret = btrfs_insert_empty_item(trans, dev_root, path, 6148 6147 &key, sizeof(*ptr)); 6149 6148 if (ret < 0) { 6150 - printk_in_rcu(KERN_WARNING "btrfs: insert dev_stats item for device %s failed %d!\n", 6149 + printk_in_rcu(KERN_WARNING "BTRFS: " 6150 + "insert dev_stats item for device %s failed %d!\n", 6151 6151 rcu_str_deref(device->name), ret); 6152 6152 goto out; 6153 6153 } ··· 6201 6199 { 6202 6200 if (!dev->dev_stats_valid) 6203 6201 return; 6204 - printk_ratelimited_in_rcu(KERN_ERR 6205 - "btrfs: bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", 6202 + printk_ratelimited_in_rcu(KERN_ERR "BTRFS: " 6203 + "bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", 6206 6204 rcu_str_deref(dev->name), 6207 6205 btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS), 6208 6206 btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_READ_ERRS), 6209 6207 btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_FLUSH_ERRS), 6210 - btrfs_dev_stat_read(dev, 6211 - BTRFS_DEV_STAT_CORRUPTION_ERRS), 6212 - btrfs_dev_stat_read(dev, 6213 - BTRFS_DEV_STAT_GENERATION_ERRS)); 6208 + btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_CORRUPTION_ERRS), 6209 + btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_GENERATION_ERRS)); 6214 6210 } 6215 6211 6216 6212 static void btrfs_dev_stat_print_on_load(struct btrfs_device *dev) ··· 6221 6221 if (i == BTRFS_DEV_STAT_VALUES_MAX) 6222 6222 return; /* all values == 0, suppress message */ 6223 6223 6224 - printk_in_rcu(KERN_INFO "btrfs: bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", 6224 + printk_in_rcu(KERN_INFO "BTRFS: " 6225 + "bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u\n", 6225 6226 rcu_str_deref(dev->name), 6226 6227 btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS), 6227 6228 btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_READ_ERRS), ··· 6243 6242 mutex_unlock(&fs_devices->device_list_mutex); 6244 6243 6245 6244 if (!dev) { 6246 - printk(KERN_WARNING 6247 - "btrfs: get dev_stats failed, device not found\n"); 6245 + btrfs_warn(root->fs_info, "get dev_stats failed, device not found"); 6248 6246 return -ENODEV; 6249 6247 } else if (!dev->dev_stats_valid) { 6250 - printk(KERN_WARNING 6251 - "btrfs: get dev_stats failed, not yet valid\n"); 6248 + btrfs_warn(root->fs_info, "get dev_stats failed, not yet valid"); 6252 6249 return -ENODEV; 6253 6250 } else if (stats->flags & BTRFS_DEV_STATS_RESET) { 6254 6251 for (i = 0; i < BTRFS_DEV_STAT_VALUES_MAX; i++) {
+4 -4
fs/btrfs/zlib.c
··· 97 97 *total_in = 0; 98 98 99 99 if (Z_OK != zlib_deflateInit(&workspace->def_strm, 3)) { 100 - printk(KERN_WARNING "btrfs: deflateInit failed\n"); 100 + printk(KERN_WARNING "BTRFS: deflateInit failed\n"); 101 101 ret = -1; 102 102 goto out; 103 103 } ··· 125 125 while (workspace->def_strm.total_in < len) { 126 126 ret = zlib_deflate(&workspace->def_strm, Z_SYNC_FLUSH); 127 127 if (ret != Z_OK) { 128 - printk(KERN_DEBUG "btrfs: deflate in loop returned %d\n", 128 + printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n", 129 129 ret); 130 130 zlib_deflateEnd(&workspace->def_strm); 131 131 ret = -1; ··· 252 252 } 253 253 254 254 if (Z_OK != zlib_inflateInit2(&workspace->inf_strm, wbits)) { 255 - printk(KERN_WARNING "btrfs: inflateInit failed\n"); 255 + printk(KERN_WARNING "BTRFS: inflateInit failed\n"); 256 256 return -1; 257 257 } 258 258 while (workspace->inf_strm.total_in < srclen) { ··· 336 336 } 337 337 338 338 if (Z_OK != zlib_inflateInit2(&workspace->inf_strm, wbits)) { 339 - printk(KERN_WARNING "btrfs: inflateInit failed\n"); 339 + printk(KERN_WARNING "BTRFS: inflateInit failed\n"); 340 340 return -1; 341 341 } 342 342