aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2016-09-20 10:05:01 -0400
committerDavid Sterba <dsterba@suse.com>2016-09-26 12:08:44 -0400
commit62e855771dacf7c4d6daf9741642a965e7066d31 (patch)
tree2d7f6cb2601bb4b5b3ca1cd1f301fadabbdfec76
parent5d163e0e68ce743e1e919ddd3264c96ac02e9026 (diff)
btrfs: convert printk(KERN_* to use pr_* calls
This patch converts printk(KERN_* style messages to use the pr_* versions. One side effect is that anything that was KERN_DEBUG is now automatically a dynamic debug message. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/check-integrity.c272
-rw-r--r--fs/btrfs/compression.c6
-rw-r--r--fs/btrfs/ctree.c2
-rw-r--r--fs/btrfs/ctree.h6
-rw-r--r--fs/btrfs/disk-io.c44
-rw-r--r--fs/btrfs/extent-tree.c6
-rw-r--r--fs/btrfs/extent_io.c4
-rw-r--r--fs/btrfs/free-space-cache.c2
-rw-r--r--fs/btrfs/lzo.c6
-rw-r--r--fs/btrfs/print-tree.c62
-rw-r--r--fs/btrfs/reada.c28
-rw-r--r--fs/btrfs/super.c12
-rw-r--r--fs/btrfs/sysfs.c2
-rw-r--r--fs/btrfs/transaction.c2
-rw-r--r--fs/btrfs/volumes.c18
-rw-r--r--fs/btrfs/zlib.c8
16 files changed, 205 insertions, 275 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index d6a5a6eebd11..8e99251650b3 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -656,7 +656,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
656 BUG_ON(NULL == state); 656 BUG_ON(NULL == state);
657 selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS); 657 selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS);
658 if (NULL == selected_super) { 658 if (NULL == selected_super) {
659 printk(KERN_INFO "btrfsic: error, kmalloc failed!\n"); 659 pr_info("btrfsic: error, kmalloc failed!\n");
660 return -ENOMEM; 660 return -ENOMEM;
661 } 661 }
662 662
@@ -681,7 +681,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
681 } 681 }
682 682
683 if (NULL == state->latest_superblock) { 683 if (NULL == state->latest_superblock) {
684 printk(KERN_INFO "btrfsic: no superblock found!\n"); 684 pr_info("btrfsic: no superblock found!\n");
685 kfree(selected_super); 685 kfree(selected_super);
686 return -1; 686 return -1;
687 } 687 }
@@ -698,13 +698,13 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
698 next_bytenr = btrfs_super_root(selected_super); 698 next_bytenr = btrfs_super_root(selected_super);
699 if (state->print_mask & 699 if (state->print_mask &
700 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION) 700 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
701 printk(KERN_INFO "root@%llu\n", next_bytenr); 701 pr_info("root@%llu\n", next_bytenr);
702 break; 702 break;
703 case 1: 703 case 1:
704 next_bytenr = btrfs_super_chunk_root(selected_super); 704 next_bytenr = btrfs_super_chunk_root(selected_super);
705 if (state->print_mask & 705 if (state->print_mask &
706 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION) 706 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
707 printk(KERN_INFO "chunk@%llu\n", next_bytenr); 707 pr_info("chunk@%llu\n", next_bytenr);
708 break; 708 break;
709 case 2: 709 case 2:
710 next_bytenr = btrfs_super_log_root(selected_super); 710 next_bytenr = btrfs_super_log_root(selected_super);
@@ -712,7 +712,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
712 continue; 712 continue;
713 if (state->print_mask & 713 if (state->print_mask &
714 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION) 714 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
715 printk(KERN_INFO "log@%llu\n", next_bytenr); 715 pr_info("log@%llu\n", next_bytenr);
716 break; 716 break;
717 } 717 }
718 718
@@ -720,7 +720,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
720 btrfs_num_copies(state->root->fs_info, 720 btrfs_num_copies(state->root->fs_info,
721 next_bytenr, state->metablock_size); 721 next_bytenr, state->metablock_size);
722 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) 722 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
723 printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", 723 pr_info("num_copies(log_bytenr=%llu) = %d\n",
724 next_bytenr, num_copies); 724 next_bytenr, num_copies);
725 725
726 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { 726 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
@@ -733,7 +733,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
733 &tmp_next_block_ctx, 733 &tmp_next_block_ctx,
734 mirror_num); 734 mirror_num);
735 if (ret) { 735 if (ret) {
736 printk(KERN_INFO "btrfsic: btrfsic_map_block(root @%llu, mirror %d) failed!\n", 736 pr_info("btrfsic: btrfsic_map_block(root @%llu, mirror %d) failed!\n",
737 next_bytenr, mirror_num); 737 next_bytenr, mirror_num);
738 kfree(selected_super); 738 kfree(selected_super);
739 return -1; 739 return -1;
@@ -756,8 +756,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
756 756
757 ret = btrfsic_read_block(state, &tmp_next_block_ctx); 757 ret = btrfsic_read_block(state, &tmp_next_block_ctx);
758 if (ret < (int)PAGE_SIZE) { 758 if (ret < (int)PAGE_SIZE) {
759 printk(KERN_INFO 759 pr_info("btrfsic: read @logical %llu failed!\n",
760 "btrfsic: read @logical %llu failed!\n",
761 tmp_next_block_ctx.start); 760 tmp_next_block_ctx.start);
762 btrfsic_release_block_ctx(&tmp_next_block_ctx); 761 btrfsic_release_block_ctx(&tmp_next_block_ctx);
763 kfree(selected_super); 762 kfree(selected_super);
@@ -818,7 +817,7 @@ static int btrfsic_process_superblock_dev_mirror(
818 if (NULL == superblock_tmp) { 817 if (NULL == superblock_tmp) {
819 superblock_tmp = btrfsic_block_alloc(); 818 superblock_tmp = btrfsic_block_alloc();
820 if (NULL == superblock_tmp) { 819 if (NULL == superblock_tmp) {
821 printk(KERN_INFO "btrfsic: error, kmalloc failed!\n"); 820 pr_info("btrfsic: error, kmalloc failed!\n");
822 brelse(bh); 821 brelse(bh);
823 return -1; 822 return -1;
824 } 823 }
@@ -892,7 +891,7 @@ static int btrfsic_process_superblock_dev_mirror(
892 btrfs_num_copies(state->root->fs_info, 891 btrfs_num_copies(state->root->fs_info,
893 next_bytenr, state->metablock_size); 892 next_bytenr, state->metablock_size);
894 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) 893 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
895 printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", 894 pr_info("num_copies(log_bytenr=%llu) = %d\n",
896 next_bytenr, num_copies); 895 next_bytenr, num_copies);
897 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { 896 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
898 struct btrfsic_block *next_block; 897 struct btrfsic_block *next_block;
@@ -903,7 +902,7 @@ static int btrfsic_process_superblock_dev_mirror(
903 state->metablock_size, 902 state->metablock_size,
904 &tmp_next_block_ctx, 903 &tmp_next_block_ctx,
905 mirror_num)) { 904 mirror_num)) {
906 printk(KERN_INFO "btrfsic: btrfsic_map_block(bytenr @%llu, mirror %d) failed!\n", 905 pr_info("btrfsic: btrfsic_map_block(bytenr @%llu, mirror %d) failed!\n",
907 next_bytenr, mirror_num); 906 next_bytenr, mirror_num);
908 brelse(bh); 907 brelse(bh);
909 return -1; 908 return -1;
@@ -945,7 +944,7 @@ static struct btrfsic_stack_frame *btrfsic_stack_frame_alloc(void)
945 944
946 sf = kzalloc(sizeof(*sf), GFP_NOFS); 945 sf = kzalloc(sizeof(*sf), GFP_NOFS);
947 if (NULL == sf) 946 if (NULL == sf)
948 printk(KERN_INFO "btrfsic: alloc memory failed!\n"); 947 pr_info("btrfsic: alloc memory failed!\n");
949 else 948 else
950 sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER; 949 sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER;
951 return sf; 950 return sf;
@@ -991,8 +990,7 @@ continue_with_new_stack_frame:
991 sf->nr = btrfs_stack_header_nritems(&leafhdr->header); 990 sf->nr = btrfs_stack_header_nritems(&leafhdr->header);
992 991
993 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 992 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
994 printk(KERN_INFO 993 pr_info("leaf %llu items %d generation %llu owner %llu\n",
995 "leaf %llu items %d generation %llu owner %llu\n",
996 sf->block_ctx->start, sf->nr, 994 sf->block_ctx->start, sf->nr,
997 btrfs_stack_header_generation( 995 btrfs_stack_header_generation(
998 &leafhdr->header), 996 &leafhdr->header),
@@ -1019,8 +1017,7 @@ continue_with_current_leaf_stack_frame:
1019 if (disk_item_offset + sizeof(struct btrfs_item) > 1017 if (disk_item_offset + sizeof(struct btrfs_item) >
1020 sf->block_ctx->len) { 1018 sf->block_ctx->len) {
1021leaf_item_out_of_bounce_error: 1019leaf_item_out_of_bounce_error:
1022 printk(KERN_INFO 1020 pr_info("btrfsic: leaf item out of bounce at logical %llu, dev %s\n",
1023 "btrfsic: leaf item out of bounce at logical %llu, dev %s\n",
1024 sf->block_ctx->start, 1021 sf->block_ctx->start,
1025 sf->block_ctx->dev->name); 1022 sf->block_ctx->dev->name);
1026 goto one_stack_frame_backwards; 1023 goto one_stack_frame_backwards;
@@ -1116,7 +1113,7 @@ leaf_item_out_of_bounce_error:
1116 sf->nr = btrfs_stack_header_nritems(&nodehdr->header); 1113 sf->nr = btrfs_stack_header_nritems(&nodehdr->header);
1117 1114
1118 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 1115 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
1119 printk(KERN_INFO "node %llu level %d items %d generation %llu owner %llu\n", 1116 pr_info("node %llu level %d items %d generation %llu owner %llu\n",
1120 sf->block_ctx->start, 1117 sf->block_ctx->start,
1121 nodehdr->header.level, sf->nr, 1118 nodehdr->header.level, sf->nr,
1122 btrfs_stack_header_generation( 1119 btrfs_stack_header_generation(
@@ -1140,8 +1137,7 @@ continue_with_current_node_stack_frame:
1140 (uintptr_t)nodehdr; 1137 (uintptr_t)nodehdr;
1141 if (key_ptr_offset + sizeof(struct btrfs_key_ptr) > 1138 if (key_ptr_offset + sizeof(struct btrfs_key_ptr) >
1142 sf->block_ctx->len) { 1139 sf->block_ctx->len) {
1143 printk(KERN_INFO 1140 pr_info("btrfsic: node item out of bounce at logical %llu, dev %s\n",
1144 "btrfsic: node item out of bounce at logical %llu, dev %s\n",
1145 sf->block_ctx->start, 1141 sf->block_ctx->start,
1146 sf->block_ctx->dev->name); 1142 sf->block_ctx->dev->name);
1147 goto one_stack_frame_backwards; 1143 goto one_stack_frame_backwards;
@@ -1270,7 +1266,7 @@ static int btrfsic_create_link_to_next_block(
1270 btrfs_num_copies(state->root->fs_info, 1266 btrfs_num_copies(state->root->fs_info,
1271 next_bytenr, state->metablock_size); 1267 next_bytenr, state->metablock_size);
1272 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) 1268 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
1273 printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", 1269 pr_info("num_copies(log_bytenr=%llu) = %d\n",
1274 next_bytenr, *num_copiesp); 1270 next_bytenr, *num_copiesp);
1275 *mirror_nump = 1; 1271 *mirror_nump = 1;
1276 } 1272 }
@@ -1279,15 +1275,13 @@ static int btrfsic_create_link_to_next_block(
1279 return 0; 1275 return 0;
1280 1276
1281 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 1277 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
1282 printk(KERN_INFO 1278 pr_info("btrfsic_create_link_to_next_block(mirror_num=%d)\n",
1283 "btrfsic_create_link_to_next_block(mirror_num=%d)\n",
1284 *mirror_nump); 1279 *mirror_nump);
1285 ret = btrfsic_map_block(state, next_bytenr, 1280 ret = btrfsic_map_block(state, next_bytenr,
1286 state->metablock_size, 1281 state->metablock_size,
1287 next_block_ctx, *mirror_nump); 1282 next_block_ctx, *mirror_nump);
1288 if (ret) { 1283 if (ret) {
1289 printk(KERN_INFO 1284 pr_info("btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
1290 "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
1291 next_bytenr, *mirror_nump); 1285 next_bytenr, *mirror_nump);
1292 btrfsic_release_block_ctx(next_block_ctx); 1286 btrfsic_release_block_ctx(next_block_ctx);
1293 *next_blockp = NULL; 1287 *next_blockp = NULL;
@@ -1313,16 +1307,14 @@ static int btrfsic_create_link_to_next_block(
1313 if (next_block->logical_bytenr != next_bytenr && 1307 if (next_block->logical_bytenr != next_bytenr &&
1314 !(!next_block->is_metadata && 1308 !(!next_block->is_metadata &&
1315 0 == next_block->logical_bytenr)) 1309 0 == next_block->logical_bytenr))
1316 printk(KERN_INFO 1310 pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
1317 "Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
1318 next_bytenr, next_block_ctx->dev->name, 1311 next_bytenr, next_block_ctx->dev->name,
1319 next_block_ctx->dev_bytenr, *mirror_nump, 1312 next_block_ctx->dev_bytenr, *mirror_nump,
1320 btrfsic_get_block_type(state, 1313 btrfsic_get_block_type(state,
1321 next_block), 1314 next_block),
1322 next_block->logical_bytenr); 1315 next_block->logical_bytenr);
1323 else 1316 else
1324 printk(KERN_INFO 1317 pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, %c.\n",
1325 "Referenced block @%llu (%s/%llu/%d) found in hash table, %c.\n",
1326 next_bytenr, next_block_ctx->dev->name, 1318 next_bytenr, next_block_ctx->dev->name,
1327 next_block_ctx->dev_bytenr, *mirror_nump, 1319 next_block_ctx->dev_bytenr, *mirror_nump,
1328 btrfsic_get_block_type(state, 1320 btrfsic_get_block_type(state,
@@ -1343,7 +1335,7 @@ static int btrfsic_create_link_to_next_block(
1343 if (NULL == l) { 1335 if (NULL == l) {
1344 l = btrfsic_block_link_alloc(); 1336 l = btrfsic_block_link_alloc();
1345 if (NULL == l) { 1337 if (NULL == l) {
1346 printk(KERN_INFO "btrfsic: error, kmalloc failed!\n"); 1338 pr_info("btrfsic: error, kmalloc failed!\n");
1347 btrfsic_release_block_ctx(next_block_ctx); 1339 btrfsic_release_block_ctx(next_block_ctx);
1348 *next_blockp = NULL; 1340 *next_blockp = NULL;
1349 return -1; 1341 return -1;
@@ -1376,8 +1368,7 @@ static int btrfsic_create_link_to_next_block(
1376 if (limit_nesting > 0 && did_alloc_block_link) { 1368 if (limit_nesting > 0 && did_alloc_block_link) {
1377 ret = btrfsic_read_block(state, next_block_ctx); 1369 ret = btrfsic_read_block(state, next_block_ctx);
1378 if (ret < (int)next_block_ctx->len) { 1370 if (ret < (int)next_block_ctx->len) {
1379 printk(KERN_INFO 1371 pr_info("btrfsic: read block @logical %llu failed!\n",
1380 "btrfsic: read block @logical %llu failed!\n",
1381 next_bytenr); 1372 next_bytenr);
1382 btrfsic_release_block_ctx(next_block_ctx); 1373 btrfsic_release_block_ctx(next_block_ctx);
1383 *next_blockp = NULL; 1374 *next_blockp = NULL;
@@ -1412,8 +1403,7 @@ static int btrfsic_handle_extent_data(
1412 if (file_extent_item_offset + 1403 if (file_extent_item_offset +
1413 offsetof(struct btrfs_file_extent_item, disk_num_bytes) > 1404 offsetof(struct btrfs_file_extent_item, disk_num_bytes) >
1414 block_ctx->len) { 1405 block_ctx->len) {
1415 printk(KERN_INFO 1406 pr_info("btrfsic: file item out of bounce at logical %llu, dev %s\n",
1416 "btrfsic: file item out of bounce at logical %llu, dev %s\n",
1417 block_ctx->start, block_ctx->dev->name); 1407 block_ctx->start, block_ctx->dev->name);
1418 return -1; 1408 return -1;
1419 } 1409 }
@@ -1424,7 +1414,7 @@ static int btrfsic_handle_extent_data(
1424 if (BTRFS_FILE_EXTENT_REG != file_extent_item.type || 1414 if (BTRFS_FILE_EXTENT_REG != file_extent_item.type ||
1425 btrfs_stack_file_extent_disk_bytenr(&file_extent_item) == 0) { 1415 btrfs_stack_file_extent_disk_bytenr(&file_extent_item) == 0) {
1426 if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) 1416 if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
1427 printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu\n", 1417 pr_info("extent_data: type %u, disk_bytenr = %llu\n",
1428 file_extent_item.type, 1418 file_extent_item.type,
1429 btrfs_stack_file_extent_disk_bytenr( 1419 btrfs_stack_file_extent_disk_bytenr(
1430 &file_extent_item)); 1420 &file_extent_item));
@@ -1433,8 +1423,7 @@ static int btrfsic_handle_extent_data(
1433 1423
1434 if (file_extent_item_offset + sizeof(struct btrfs_file_extent_item) > 1424 if (file_extent_item_offset + sizeof(struct btrfs_file_extent_item) >
1435 block_ctx->len) { 1425 block_ctx->len) {
1436 printk(KERN_INFO 1426 pr_info("btrfsic: file item out of bounce at logical %llu, dev %s\n",
1437 "btrfsic: file item out of bounce at logical %llu, dev %s\n",
1438 block_ctx->start, block_ctx->dev->name); 1427 block_ctx->start, block_ctx->dev->name);
1439 return -1; 1428 return -1;
1440 } 1429 }
@@ -1452,7 +1441,7 @@ static int btrfsic_handle_extent_data(
1452 generation = btrfs_stack_file_extent_generation(&file_extent_item); 1441 generation = btrfs_stack_file_extent_generation(&file_extent_item);
1453 1442
1454 if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) 1443 if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
1455 printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu, offset = %llu, num_bytes = %llu\n", 1444 pr_info("extent_data: type %u, disk_bytenr = %llu, offset = %llu, num_bytes = %llu\n",
1456 file_extent_item.type, 1445 file_extent_item.type,
1457 btrfs_stack_file_extent_disk_bytenr(&file_extent_item), 1446 btrfs_stack_file_extent_disk_bytenr(&file_extent_item),
1458 btrfs_stack_file_extent_offset(&file_extent_item), 1447 btrfs_stack_file_extent_offset(&file_extent_item),
@@ -1471,7 +1460,7 @@ static int btrfsic_handle_extent_data(
1471 btrfs_num_copies(state->root->fs_info, 1460 btrfs_num_copies(state->root->fs_info,
1472 next_bytenr, state->datablock_size); 1461 next_bytenr, state->datablock_size);
1473 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) 1462 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
1474 printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", 1463 pr_info("num_copies(log_bytenr=%llu) = %d\n",
1475 next_bytenr, num_copies); 1464 next_bytenr, num_copies);
1476 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { 1465 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
1477 struct btrfsic_block_data_ctx next_block_ctx; 1466 struct btrfsic_block_data_ctx next_block_ctx;
@@ -1479,17 +1468,16 @@ static int btrfsic_handle_extent_data(
1479 int block_was_created; 1468 int block_was_created;
1480 1469
1481 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 1470 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
1482 printk(KERN_INFO "btrfsic_handle_extent_data(mirror_num=%d)\n", mirror_num); 1471 pr_info("btrfsic_handle_extent_data(mirror_num=%d)\n",
1472 mirror_num);
1483 if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) 1473 if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
1484 printk(KERN_INFO 1474 pr_info("\tdisk_bytenr = %llu, num_bytes %u\n",
1485 "\tdisk_bytenr = %llu, num_bytes %u\n",
1486 next_bytenr, chunk_len); 1475 next_bytenr, chunk_len);
1487 ret = btrfsic_map_block(state, next_bytenr, 1476 ret = btrfsic_map_block(state, next_bytenr,
1488 chunk_len, &next_block_ctx, 1477 chunk_len, &next_block_ctx,
1489 mirror_num); 1478 mirror_num);
1490 if (ret) { 1479 if (ret) {
1491 printk(KERN_INFO 1480 pr_info("btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
1492 "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
1493 next_bytenr, mirror_num); 1481 next_bytenr, mirror_num);
1494 return -1; 1482 return -1;
1495 } 1483 }
@@ -1504,8 +1492,7 @@ static int btrfsic_handle_extent_data(
1504 mirror_num, 1492 mirror_num,
1505 &block_was_created); 1493 &block_was_created);
1506 if (NULL == next_block) { 1494 if (NULL == next_block) {
1507 printk(KERN_INFO 1495 pr_info("btrfsic: error, kmalloc failed!\n");
1508 "btrfsic: error, kmalloc failed!\n");
1509 btrfsic_release_block_ctx(&next_block_ctx); 1496 btrfsic_release_block_ctx(&next_block_ctx);
1510 return -1; 1497 return -1;
1511 } 1498 }
@@ -1515,8 +1502,7 @@ static int btrfsic_handle_extent_data(
1515 next_block->logical_bytenr != next_bytenr && 1502 next_block->logical_bytenr != next_bytenr &&
1516 !(!next_block->is_metadata && 1503 !(!next_block->is_metadata &&
1517 0 == next_block->logical_bytenr)) { 1504 0 == next_block->logical_bytenr)) {
1518 printk(KERN_INFO 1505 pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, D, bytenr mismatch (!= stored %llu).\n",
1519 "Referenced block @%llu (%s/%llu/%d) found in hash table, D, bytenr mismatch (!= stored %llu).\n",
1520 next_bytenr, 1506 next_bytenr,
1521 next_block_ctx.dev->name, 1507 next_block_ctx.dev->name,
1522 next_block_ctx.dev_bytenr, 1508 next_block_ctx.dev_bytenr,
@@ -1580,7 +1566,7 @@ static int btrfsic_map_block(struct btrfsic_state *state, u64 bytenr, u32 len,
1580 kfree(multi); 1566 kfree(multi);
1581 if (NULL == block_ctx_out->dev) { 1567 if (NULL == block_ctx_out->dev) {
1582 ret = -ENXIO; 1568 ret = -ENXIO;
1583 printk(KERN_INFO "btrfsic: error, cannot lookup dev (#1)!\n"); 1569 pr_info("btrfsic: error, cannot lookup dev (#1)!\n");
1584 } 1570 }
1585 1571
1586 return ret; 1572 return ret;
@@ -1626,8 +1612,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
1626 BUG_ON(block_ctx->pagev); 1612 BUG_ON(block_ctx->pagev);
1627 BUG_ON(block_ctx->mem_to_free); 1613 BUG_ON(block_ctx->mem_to_free);
1628 if (block_ctx->dev_bytenr & ((u64)PAGE_SIZE - 1)) { 1614 if (block_ctx->dev_bytenr & ((u64)PAGE_SIZE - 1)) {
1629 printk(KERN_INFO 1615 pr_info("btrfsic: read_block() with unaligned bytenr %llu\n",
1630 "btrfsic: read_block() with unaligned bytenr %llu\n",
1631 block_ctx->dev_bytenr); 1616 block_ctx->dev_bytenr);
1632 return -1; 1617 return -1;
1633 } 1618 }
@@ -1654,8 +1639,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
1654 1639
1655 bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i); 1640 bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i);
1656 if (!bio) { 1641 if (!bio) {
1657 printk(KERN_INFO 1642 pr_info("btrfsic: bio_alloc() for %u pages failed!\n",
1658 "btrfsic: bio_alloc() for %u pages failed!\n",
1659 num_pages - i); 1643 num_pages - i);
1660 return -1; 1644 return -1;
1661 } 1645 }
@@ -1670,13 +1654,11 @@ static int btrfsic_read_block(struct btrfsic_state *state,
1670 break; 1654 break;
1671 } 1655 }
1672 if (j == i) { 1656 if (j == i) {
1673 printk(KERN_INFO 1657 pr_info("btrfsic: error, failed to add a single page!\n");
1674 "btrfsic: error, failed to add a single page!\n");
1675 return -1; 1658 return -1;
1676 } 1659 }
1677 if (submit_bio_wait(bio)) { 1660 if (submit_bio_wait(bio)) {
1678 printk(KERN_INFO 1661 pr_info("btrfsic: read error at logical %llu dev %s!\n",
1679 "btrfsic: read error at logical %llu dev %s!\n",
1680 block_ctx->start, block_ctx->dev->name); 1662 block_ctx->start, block_ctx->dev->name);
1681 bio_put(bio); 1663 bio_put(bio);
1682 return -1; 1664 return -1;
@@ -1688,7 +1670,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
1688 for (i = 0; i < num_pages; i++) { 1670 for (i = 0; i < num_pages; i++) {
1689 block_ctx->datav[i] = kmap(block_ctx->pagev[i]); 1671 block_ctx->datav[i] = kmap(block_ctx->pagev[i]);
1690 if (!block_ctx->datav[i]) { 1672 if (!block_ctx->datav[i]) {
1691 printk(KERN_INFO "btrfsic: kmap() failed (dev %s)!\n", 1673 pr_info("btrfsic: kmap() failed (dev %s)!\n",
1692 block_ctx->dev->name); 1674 block_ctx->dev->name);
1693 return -1; 1675 return -1;
1694 } 1676 }
@@ -1703,17 +1685,17 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
1703 1685
1704 BUG_ON(NULL == state); 1686 BUG_ON(NULL == state);
1705 1687
1706 printk(KERN_INFO "all_blocks_list:\n"); 1688 pr_info("all_blocks_list:\n");
1707 list_for_each_entry(b_all, &state->all_blocks_list, all_blocks_node) { 1689 list_for_each_entry(b_all, &state->all_blocks_list, all_blocks_node) {
1708 const struct btrfsic_block_link *l; 1690 const struct btrfsic_block_link *l;
1709 1691
1710 printk(KERN_INFO "%c-block @%llu (%s/%llu/%d)\n", 1692 pr_info("%c-block @%llu (%s/%llu/%d)\n",
1711 btrfsic_get_block_type(state, b_all), 1693 btrfsic_get_block_type(state, b_all),
1712 b_all->logical_bytenr, b_all->dev_state->name, 1694 b_all->logical_bytenr, b_all->dev_state->name,
1713 b_all->dev_bytenr, b_all->mirror_num); 1695 b_all->dev_bytenr, b_all->mirror_num);
1714 1696
1715 list_for_each_entry(l, &b_all->ref_to_list, node_ref_to) { 1697 list_for_each_entry(l, &b_all->ref_to_list, node_ref_to) {
1716 printk(KERN_INFO " %c @%llu (%s/%llu/%d) refers %u* to %c @%llu (%s/%llu/%d)\n", 1698 pr_info(" %c @%llu (%s/%llu/%d) refers %u* to %c @%llu (%s/%llu/%d)\n",
1717 btrfsic_get_block_type(state, b_all), 1699 btrfsic_get_block_type(state, b_all),
1718 b_all->logical_bytenr, b_all->dev_state->name, 1700 b_all->logical_bytenr, b_all->dev_state->name,
1719 b_all->dev_bytenr, b_all->mirror_num, 1701 b_all->dev_bytenr, b_all->mirror_num,
@@ -1726,7 +1708,7 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
1726 } 1708 }
1727 1709
1728 list_for_each_entry(l, &b_all->ref_from_list, node_ref_from) { 1710 list_for_each_entry(l, &b_all->ref_from_list, node_ref_from) {
1729 printk(KERN_INFO " %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n", 1711 pr_info(" %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
1730 btrfsic_get_block_type(state, b_all), 1712 btrfsic_get_block_type(state, b_all),
1731 b_all->logical_bytenr, b_all->dev_state->name, 1713 b_all->logical_bytenr, b_all->dev_state->name,
1732 b_all->dev_bytenr, b_all->mirror_num, 1714 b_all->dev_bytenr, b_all->mirror_num,
@@ -1738,7 +1720,7 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
1738 l->block_ref_from->mirror_num); 1720 l->block_ref_from->mirror_num);
1739 } 1721 }
1740 1722
1741 printk(KERN_INFO "\n"); 1723 pr_info("\n");
1742 } 1724 }
1743} 1725}
1744 1726
@@ -1813,8 +1795,7 @@ again:
1813 mapped_datav[0]); 1795 mapped_datav[0]);
1814 if (num_pages * PAGE_SIZE < 1796 if (num_pages * PAGE_SIZE <
1815 BTRFS_SUPER_INFO_SIZE) { 1797 BTRFS_SUPER_INFO_SIZE) {
1816 printk(KERN_INFO 1798 pr_info("btrfsic: cannot work with too short bios!\n");
1817 "btrfsic: cannot work with too short bios!\n");
1818 return; 1799 return;
1819 } 1800 }
1820 is_metadata = 1; 1801 is_metadata = 1;
@@ -1822,8 +1803,7 @@ again:
1822 processed_len = BTRFS_SUPER_INFO_SIZE; 1803 processed_len = BTRFS_SUPER_INFO_SIZE;
1823 if (state->print_mask & 1804 if (state->print_mask &
1824 BTRFSIC_PRINT_MASK_TREE_BEFORE_SB_WRITE) { 1805 BTRFSIC_PRINT_MASK_TREE_BEFORE_SB_WRITE) {
1825 printk(KERN_INFO 1806 pr_info("[before new superblock is written]:\n");
1826 "[before new superblock is written]:\n");
1827 btrfsic_dump_tree_sub(state, block, 0); 1807 btrfsic_dump_tree_sub(state, block, 0);
1828 } 1808 }
1829 } 1809 }
@@ -1831,8 +1811,7 @@ again:
1831 if (!block->is_superblock) { 1811 if (!block->is_superblock) {
1832 if (num_pages * PAGE_SIZE < 1812 if (num_pages * PAGE_SIZE <
1833 state->metablock_size) { 1813 state->metablock_size) {
1834 printk(KERN_INFO 1814 pr_info("btrfsic: cannot work with too short bios!\n");
1835 "btrfsic: cannot work with too short bios!\n");
1836 return; 1815 return;
1837 } 1816 }
1838 processed_len = state->metablock_size; 1817 processed_len = state->metablock_size;
@@ -1847,8 +1826,7 @@ again:
1847 if (block->logical_bytenr != bytenr && 1826 if (block->logical_bytenr != bytenr &&
1848 !(!block->is_metadata && 1827 !(!block->is_metadata &&
1849 block->logical_bytenr == 0)) 1828 block->logical_bytenr == 0))
1850 printk(KERN_INFO 1829 pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
1851 "Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
1852 bytenr, dev_state->name, 1830 bytenr, dev_state->name,
1853 dev_bytenr, 1831 dev_bytenr,
1854 block->mirror_num, 1832 block->mirror_num,
@@ -1856,8 +1834,7 @@ again:
1856 block), 1834 block),
1857 block->logical_bytenr); 1835 block->logical_bytenr);
1858 else 1836 else
1859 printk(KERN_INFO 1837 pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
1860 "Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
1861 bytenr, dev_state->name, 1838 bytenr, dev_state->name,
1862 dev_bytenr, block->mirror_num, 1839 dev_bytenr, block->mirror_num,
1863 btrfsic_get_block_type(state, 1840 btrfsic_get_block_type(state,
@@ -1867,27 +1844,24 @@ again:
1867 } else { 1844 } else {
1868 if (num_pages * PAGE_SIZE < 1845 if (num_pages * PAGE_SIZE <
1869 state->datablock_size) { 1846 state->datablock_size) {
1870 printk(KERN_INFO 1847 pr_info("btrfsic: cannot work with too short bios!\n");
1871 "btrfsic: cannot work with too short bios!\n");
1872 return; 1848 return;
1873 } 1849 }
1874 processed_len = state->datablock_size; 1850 processed_len = state->datablock_size;
1875 bytenr = block->logical_bytenr; 1851 bytenr = block->logical_bytenr;
1876 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 1852 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
1877 printk(KERN_INFO 1853 pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
1878 "Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
1879 bytenr, dev_state->name, dev_bytenr, 1854 bytenr, dev_state->name, dev_bytenr,
1880 block->mirror_num, 1855 block->mirror_num,
1881 btrfsic_get_block_type(state, block)); 1856 btrfsic_get_block_type(state, block));
1882 } 1857 }
1883 1858
1884 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 1859 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
1885 printk(KERN_INFO 1860 pr_info("ref_to_list: %cE, ref_from_list: %cE\n",
1886 "ref_to_list: %cE, ref_from_list: %cE\n",
1887 list_empty(&block->ref_to_list) ? ' ' : '!', 1861 list_empty(&block->ref_to_list) ? ' ' : '!',
1888 list_empty(&block->ref_from_list) ? ' ' : '!'); 1862 list_empty(&block->ref_from_list) ? ' ' : '!');
1889 if (btrfsic_is_block_ref_by_superblock(state, block, 0)) { 1863 if (btrfsic_is_block_ref_by_superblock(state, block, 0)) {
1890 printk(KERN_INFO "btrfs: attempt to overwrite %c-block @%llu (%s/%llu/%d), old(gen=%llu, objectid=%llu, type=%d, offset=%llu), new(gen=%llu), which is referenced by most recent superblock (superblockgen=%llu)!\n", 1864 pr_info("btrfs: attempt to overwrite %c-block @%llu (%s/%llu/%d), old(gen=%llu, objectid=%llu, type=%d, offset=%llu), new(gen=%llu), which is referenced by most recent superblock (superblockgen=%llu)!\n",
1891 btrfsic_get_block_type(state, block), bytenr, 1865 btrfsic_get_block_type(state, block), bytenr,
1892 dev_state->name, dev_bytenr, block->mirror_num, 1866 dev_state->name, dev_bytenr, block->mirror_num,
1893 block->generation, 1867 block->generation,
@@ -1901,7 +1875,7 @@ again:
1901 } 1875 }
1902 1876
1903 if (!block->is_iodone && !block->never_written) { 1877 if (!block->is_iodone && !block->never_written) {
1904 printk(KERN_INFO "btrfs: attempt to overwrite %c-block @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu, which is not yet iodone!\n", 1878 pr_info("btrfs: attempt to overwrite %c-block @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu, which is not yet iodone!\n",
1905 btrfsic_get_block_type(state, block), bytenr, 1879 btrfsic_get_block_type(state, block), bytenr,
1906 dev_state->name, dev_bytenr, block->mirror_num, 1880 dev_state->name, dev_bytenr, block->mirror_num,
1907 block->generation, 1881 block->generation,
@@ -1999,8 +1973,7 @@ again:
1999 mapped_datav[0]); 1973 mapped_datav[0]);
2000 if (state->print_mask & 1974 if (state->print_mask &
2001 BTRFSIC_PRINT_MASK_TREE_AFTER_SB_WRITE) { 1975 BTRFSIC_PRINT_MASK_TREE_AFTER_SB_WRITE) {
2002 printk(KERN_INFO 1976 pr_info("[after new superblock is written]:\n");
2003 "[after new superblock is written]:\n");
2004 btrfsic_dump_tree_sub(state, block, 0); 1977 btrfsic_dump_tree_sub(state, block, 0);
2005 } 1978 }
2006 } else { 1979 } else {
@@ -2012,8 +1985,7 @@ again:
2012 0, 0); 1985 0, 0);
2013 } 1986 }
2014 if (ret) 1987 if (ret)
2015 printk(KERN_INFO 1988 pr_info("btrfsic: btrfsic_process_metablock(root @%llu) failed!\n",
2016 "btrfsic: btrfsic_process_metablock(root @%llu) failed!\n",
2017 dev_bytenr); 1989 dev_bytenr);
2018 } else { 1990 } else {
2019 block->is_metadata = 0; 1991 block->is_metadata = 0;
@@ -2040,7 +2012,7 @@ again:
2040 if (!is_metadata) { 2012 if (!is_metadata) {
2041 processed_len = state->datablock_size; 2013 processed_len = state->datablock_size;
2042 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2014 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2043 printk(KERN_INFO "Written block (%s/%llu/?) !found in hash table, D.\n", 2015 pr_info("Written block (%s/%llu/?) !found in hash table, D.\n",
2044 dev_state->name, dev_bytenr); 2016 dev_state->name, dev_bytenr);
2045 if (!state->include_extent_data) { 2017 if (!state->include_extent_data) {
2046 /* ignore that written D block */ 2018 /* ignore that written D block */
@@ -2058,8 +2030,7 @@ again:
2058 btrfsic_cmp_log_and_dev_bytenr(state, bytenr, dev_state, 2030 btrfsic_cmp_log_and_dev_bytenr(state, bytenr, dev_state,
2059 dev_bytenr); 2031 dev_bytenr);
2060 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2032 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2061 printk(KERN_INFO 2033 pr_info("Written block @%llu (%s/%llu/?) !found in hash table, M.\n",
2062 "Written block @%llu (%s/%llu/?) !found in hash table, M.\n",
2063 bytenr, dev_state->name, dev_bytenr); 2034 bytenr, dev_state->name, dev_bytenr);
2064 } 2035 }
2065 2036
@@ -2073,7 +2044,7 @@ again:
2073 2044
2074 block = btrfsic_block_alloc(); 2045 block = btrfsic_block_alloc();
2075 if (NULL == block) { 2046 if (NULL == block) {
2076 printk(KERN_INFO "btrfsic: error, kmalloc failed!\n"); 2047 pr_info("btrfsic: error, kmalloc failed!\n");
2077 btrfsic_release_block_ctx(&block_ctx); 2048 btrfsic_release_block_ctx(&block_ctx);
2078 goto continue_loop; 2049 goto continue_loop;
2079 } 2050 }
@@ -2123,8 +2094,7 @@ again:
2123 block->next_in_same_bio = NULL; 2094 block->next_in_same_bio = NULL;
2124 } 2095 }
2125 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2096 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2126 printk(KERN_INFO 2097 pr_info("New written %c-block @%llu (%s/%llu/%d)\n",
2127 "New written %c-block @%llu (%s/%llu/%d)\n",
2128 is_metadata ? 'M' : 'D', 2098 is_metadata ? 'M' : 'D',
2129 block->logical_bytenr, block->dev_state->name, 2099 block->logical_bytenr, block->dev_state->name,
2130 block->dev_bytenr, block->mirror_num); 2100 block->dev_bytenr, block->mirror_num);
@@ -2135,8 +2105,7 @@ again:
2135 ret = btrfsic_process_metablock(state, block, 2105 ret = btrfsic_process_metablock(state, block,
2136 &block_ctx, 0, 0); 2106 &block_ctx, 0, 0);
2137 if (ret) 2107 if (ret)
2138 printk(KERN_INFO 2108 pr_info("btrfsic: process_metablock(root @%llu) failed!\n",
2139 "btrfsic: process_metablock(root @%llu) failed!\n",
2140 dev_bytenr); 2109 dev_bytenr);
2141 } 2110 }
2142 btrfsic_release_block_ctx(&block_ctx); 2111 btrfsic_release_block_ctx(&block_ctx);
@@ -2171,8 +2140,7 @@ static void btrfsic_bio_end_io(struct bio *bp)
2171 2140
2172 if ((dev_state->state->print_mask & 2141 if ((dev_state->state->print_mask &
2173 BTRFSIC_PRINT_MASK_END_IO_BIO_BH)) 2142 BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
2174 printk(KERN_INFO 2143 pr_info("bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n",
2175 "bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n",
2176 bp->bi_error, 2144 bp->bi_error,
2177 btrfsic_get_block_type(dev_state->state, block), 2145 btrfsic_get_block_type(dev_state->state, block),
2178 block->logical_bytenr, dev_state->name, 2146 block->logical_bytenr, dev_state->name,
@@ -2183,8 +2151,7 @@ static void btrfsic_bio_end_io(struct bio *bp)
2183 dev_state->last_flush_gen++; 2151 dev_state->last_flush_gen++;
2184 if ((dev_state->state->print_mask & 2152 if ((dev_state->state->print_mask &
2185 BTRFSIC_PRINT_MASK_END_IO_BIO_BH)) 2153 BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
2186 printk(KERN_INFO 2154 pr_info("bio_end_io() new %s flush_gen=%llu\n",
2187 "bio_end_io() new %s flush_gen=%llu\n",
2188 dev_state->name, 2155 dev_state->name,
2189 dev_state->last_flush_gen); 2156 dev_state->last_flush_gen);
2190 } 2157 }
@@ -2207,8 +2174,7 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
2207 BUG_ON(NULL == block); 2174 BUG_ON(NULL == block);
2208 dev_state = block->dev_state; 2175 dev_state = block->dev_state;
2209 if ((dev_state->state->print_mask & BTRFSIC_PRINT_MASK_END_IO_BIO_BH)) 2176 if ((dev_state->state->print_mask & BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
2210 printk(KERN_INFO 2177 pr_info("bh_end_io(error=%d) for %c @%llu (%s/%llu/%d)\n",
2211 "bh_end_io(error=%d) for %c @%llu (%s/%llu/%d)\n",
2212 iodone_w_error, 2178 iodone_w_error,
2213 btrfsic_get_block_type(dev_state->state, block), 2179 btrfsic_get_block_type(dev_state->state, block),
2214 block->logical_bytenr, block->dev_state->name, 2180 block->logical_bytenr, block->dev_state->name,
@@ -2219,8 +2185,7 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
2219 dev_state->last_flush_gen++; 2185 dev_state->last_flush_gen++;
2220 if ((dev_state->state->print_mask & 2186 if ((dev_state->state->print_mask &
2221 BTRFSIC_PRINT_MASK_END_IO_BIO_BH)) 2187 BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
2222 printk(KERN_INFO 2188 pr_info("bh_end_io() new %s flush_gen=%llu\n",
2223 "bh_end_io() new %s flush_gen=%llu\n",
2224 dev_state->name, dev_state->last_flush_gen); 2189 dev_state->name, dev_state->last_flush_gen);
2225 } 2190 }
2226 if (block->submit_bio_bh_rw & REQ_FUA) 2191 if (block->submit_bio_bh_rw & REQ_FUA)
@@ -2243,8 +2208,7 @@ static int btrfsic_process_written_superblock(
2243 if (!(superblock->generation > state->max_superblock_generation || 2208 if (!(superblock->generation > state->max_superblock_generation ||
2244 0 == state->max_superblock_generation)) { 2209 0 == state->max_superblock_generation)) {
2245 if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE) 2210 if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
2246 printk(KERN_INFO 2211 pr_info("btrfsic: superblock @%llu (%s/%llu/%d) with old gen %llu <= %llu\n",
2247 "btrfsic: superblock @%llu (%s/%llu/%d) with old gen %llu <= %llu\n",
2248 superblock->logical_bytenr, 2212 superblock->logical_bytenr,
2249 superblock->dev_state->name, 2213 superblock->dev_state->name,
2250 superblock->dev_bytenr, superblock->mirror_num, 2214 superblock->dev_bytenr, superblock->mirror_num,
@@ -2252,8 +2216,7 @@ static int btrfsic_process_written_superblock(
2252 state->max_superblock_generation); 2216 state->max_superblock_generation);
2253 } else { 2217 } else {
2254 if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE) 2218 if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
2255 printk(KERN_INFO 2219 pr_info("btrfsic: got new superblock @%llu (%s/%llu/%d) with new gen %llu > %llu\n",
2256 "btrfsic: got new superblock @%llu (%s/%llu/%d) with new gen %llu > %llu\n",
2257 superblock->logical_bytenr, 2220 superblock->logical_bytenr,
2258 superblock->dev_state->name, 2221 superblock->dev_state->name,
2259 superblock->dev_bytenr, superblock->mirror_num, 2222 superblock->dev_bytenr, superblock->mirror_num,
@@ -2288,7 +2251,7 @@ static int btrfsic_process_written_superblock(
2288 next_bytenr = btrfs_super_root(super_hdr); 2251 next_bytenr = btrfs_super_root(super_hdr);
2289 if (state->print_mask & 2252 if (state->print_mask &
2290 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION) 2253 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
2291 printk(KERN_INFO "root@%llu\n", next_bytenr); 2254 pr_info("root@%llu\n", next_bytenr);
2292 break; 2255 break;
2293 case 1: 2256 case 1:
2294 btrfs_set_disk_key_objectid(&tmp_disk_key, 2257 btrfs_set_disk_key_objectid(&tmp_disk_key,
@@ -2297,7 +2260,7 @@ static int btrfsic_process_written_superblock(
2297 next_bytenr = btrfs_super_chunk_root(super_hdr); 2260 next_bytenr = btrfs_super_chunk_root(super_hdr);
2298 if (state->print_mask & 2261 if (state->print_mask &
2299 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION) 2262 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
2300 printk(KERN_INFO "chunk@%llu\n", next_bytenr); 2263 pr_info("chunk@%llu\n", next_bytenr);
2301 break; 2264 break;
2302 case 2: 2265 case 2:
2303 btrfs_set_disk_key_objectid(&tmp_disk_key, 2266 btrfs_set_disk_key_objectid(&tmp_disk_key,
@@ -2308,7 +2271,7 @@ static int btrfsic_process_written_superblock(
2308 continue; 2271 continue;
2309 if (state->print_mask & 2272 if (state->print_mask &
2310 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION) 2273 BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
2311 printk(KERN_INFO "log@%llu\n", next_bytenr); 2274 pr_info("log@%llu\n", next_bytenr);
2312 break; 2275 break;
2313 } 2276 }
2314 2277
@@ -2316,21 +2279,19 @@ static int btrfsic_process_written_superblock(
2316 btrfs_num_copies(state->root->fs_info, 2279 btrfs_num_copies(state->root->fs_info,
2317 next_bytenr, BTRFS_SUPER_INFO_SIZE); 2280 next_bytenr, BTRFS_SUPER_INFO_SIZE);
2318 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES) 2281 if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
2319 printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n", 2282 pr_info("num_copies(log_bytenr=%llu) = %d\n",
2320 next_bytenr, num_copies); 2283 next_bytenr, num_copies);
2321 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { 2284 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
2322 int was_created; 2285 int was_created;
2323 2286
2324 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2287 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2325 printk(KERN_INFO 2288 pr_info("btrfsic_process_written_superblock(mirror_num=%d)\n", mirror_num);
2326 "btrfsic_process_written_superblock(mirror_num=%d)\n", mirror_num);
2327 ret = btrfsic_map_block(state, next_bytenr, 2289 ret = btrfsic_map_block(state, next_bytenr,
2328 BTRFS_SUPER_INFO_SIZE, 2290 BTRFS_SUPER_INFO_SIZE,
2329 &tmp_next_block_ctx, 2291 &tmp_next_block_ctx,
2330 mirror_num); 2292 mirror_num);
2331 if (ret) { 2293 if (ret) {
2332 printk(KERN_INFO 2294 pr_info("btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
2333 "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
2334 next_bytenr, mirror_num); 2295 next_bytenr, mirror_num);
2335 return -1; 2296 return -1;
2336 } 2297 }
@@ -2343,8 +2304,7 @@ static int btrfsic_process_written_superblock(
2343 mirror_num, 2304 mirror_num,
2344 &was_created); 2305 &was_created);
2345 if (NULL == next_block) { 2306 if (NULL == next_block) {
2346 printk(KERN_INFO 2307 pr_info("btrfsic: error, kmalloc failed!\n");
2347 "btrfsic: error, kmalloc failed!\n");
2348 btrfsic_release_block_ctx(&tmp_next_block_ctx); 2308 btrfsic_release_block_ctx(&tmp_next_block_ctx);
2349 return -1; 2309 return -1;
2350 } 2310 }
@@ -2393,8 +2353,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
2393 * by the most recent super block. 2353 * by the most recent super block.
2394 */ 2354 */
2395 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2355 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2396 printk(KERN_INFO 2356 pr_info("btrfsic: abort cyclic linkage (case 1).\n");
2397 "btrfsic: abort cyclic linkage (case 1).\n");
2398 2357
2399 return ret; 2358 return ret;
2400 } 2359 }
@@ -2405,8 +2364,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
2405 */ 2364 */
2406 list_for_each_entry(l, &block->ref_to_list, node_ref_to) { 2365 list_for_each_entry(l, &block->ref_to_list, node_ref_to) {
2407 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2366 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2408 printk(KERN_INFO 2367 pr_info("rl=%d, %c @%llu (%s/%llu/%d) %u* refers to %c @%llu (%s/%llu/%d)\n",
2409 "rl=%d, %c @%llu (%s/%llu/%d) %u* refers to %c @%llu (%s/%llu/%d)\n",
2410 recursion_level, 2368 recursion_level,
2411 btrfsic_get_block_type(state, block), 2369 btrfsic_get_block_type(state, block),
2412 block->logical_bytenr, block->dev_state->name, 2370 block->logical_bytenr, block->dev_state->name,
@@ -2418,7 +2376,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
2418 l->block_ref_to->dev_bytenr, 2376 l->block_ref_to->dev_bytenr,
2419 l->block_ref_to->mirror_num); 2377 l->block_ref_to->mirror_num);
2420 if (l->block_ref_to->never_written) { 2378 if (l->block_ref_to->never_written) {
2421 printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is never written!\n", 2379 pr_info("btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is never written!\n",
2422 btrfsic_get_block_type(state, l->block_ref_to), 2380 btrfsic_get_block_type(state, l->block_ref_to),
2423 l->block_ref_to->logical_bytenr, 2381 l->block_ref_to->logical_bytenr,
2424 l->block_ref_to->dev_state->name, 2382 l->block_ref_to->dev_state->name,
@@ -2426,7 +2384,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
2426 l->block_ref_to->mirror_num); 2384 l->block_ref_to->mirror_num);
2427 ret = -1; 2385 ret = -1;
2428 } else if (!l->block_ref_to->is_iodone) { 2386 } else if (!l->block_ref_to->is_iodone) {
2429 printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not yet iodone!\n", 2387 pr_info("btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not yet iodone!\n",
2430 btrfsic_get_block_type(state, l->block_ref_to), 2388 btrfsic_get_block_type(state, l->block_ref_to),
2431 l->block_ref_to->logical_bytenr, 2389 l->block_ref_to->logical_bytenr,
2432 l->block_ref_to->dev_state->name, 2390 l->block_ref_to->dev_state->name,
@@ -2434,7 +2392,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
2434 l->block_ref_to->mirror_num); 2392 l->block_ref_to->mirror_num);
2435 ret = -1; 2393 ret = -1;
2436 } else if (l->block_ref_to->iodone_w_error) { 2394 } else if (l->block_ref_to->iodone_w_error) {
2437 printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which has write error!\n", 2395 pr_info("btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which has write error!\n",
2438 btrfsic_get_block_type(state, l->block_ref_to), 2396 btrfsic_get_block_type(state, l->block_ref_to),
2439 l->block_ref_to->logical_bytenr, 2397 l->block_ref_to->logical_bytenr,
2440 l->block_ref_to->dev_state->name, 2398 l->block_ref_to->dev_state->name,
@@ -2447,7 +2405,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
2447 l->parent_generation && 2405 l->parent_generation &&
2448 BTRFSIC_GENERATION_UNKNOWN != 2406 BTRFSIC_GENERATION_UNKNOWN !=
2449 l->block_ref_to->generation) { 2407 l->block_ref_to->generation) {
2450 printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) with generation %llu != parent generation %llu!\n", 2408 pr_info("btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) with generation %llu != parent generation %llu!\n",
2451 btrfsic_get_block_type(state, l->block_ref_to), 2409 btrfsic_get_block_type(state, l->block_ref_to),
2452 l->block_ref_to->logical_bytenr, 2410 l->block_ref_to->logical_bytenr,
2453 l->block_ref_to->dev_state->name, 2411 l->block_ref_to->dev_state->name,
@@ -2458,7 +2416,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
2458 ret = -1; 2416 ret = -1;
2459 } else if (l->block_ref_to->flush_gen > 2417 } else if (l->block_ref_to->flush_gen >
2460 l->block_ref_to->dev_state->last_flush_gen) { 2418 l->block_ref_to->dev_state->last_flush_gen) {
2461 printk(KERN_INFO "btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not flushed out of disk's write cache (block flush_gen=%llu, dev->flush_gen=%llu)!\n", 2419 pr_info("btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not flushed out of disk's write cache (block flush_gen=%llu, dev->flush_gen=%llu)!\n",
2462 btrfsic_get_block_type(state, l->block_ref_to), 2420 btrfsic_get_block_type(state, l->block_ref_to),
2463 l->block_ref_to->logical_bytenr, 2421 l->block_ref_to->logical_bytenr,
2464 l->block_ref_to->dev_state->name, 2422 l->block_ref_to->dev_state->name,
@@ -2487,8 +2445,7 @@ static int btrfsic_is_block_ref_by_superblock(
2487 if (recursion_level >= 3 + BTRFS_MAX_LEVEL) { 2445 if (recursion_level >= 3 + BTRFS_MAX_LEVEL) {
2488 /* refer to comment at "abort cyclic linkage (case 1)" */ 2446 /* refer to comment at "abort cyclic linkage (case 1)" */
2489 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2447 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2490 printk(KERN_INFO 2448 pr_info("btrfsic: abort cyclic linkage (case 2).\n");
2491 "btrfsic: abort cyclic linkage (case 2).\n");
2492 2449
2493 return 0; 2450 return 0;
2494 } 2451 }
@@ -2499,8 +2456,7 @@ static int btrfsic_is_block_ref_by_superblock(
2499 */ 2456 */
2500 list_for_each_entry(l, &block->ref_from_list, node_ref_from) { 2457 list_for_each_entry(l, &block->ref_from_list, node_ref_from) {
2501 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2458 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2502 printk(KERN_INFO 2459 pr_info("rl=%d, %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
2503 "rl=%d, %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
2504 recursion_level, 2460 recursion_level,
2505 btrfsic_get_block_type(state, block), 2461 btrfsic_get_block_type(state, block),
2506 block->logical_bytenr, block->dev_state->name, 2462 block->logical_bytenr, block->dev_state->name,
@@ -2530,8 +2486,7 @@ static int btrfsic_is_block_ref_by_superblock(
2530static void btrfsic_print_add_link(const struct btrfsic_state *state, 2486static void btrfsic_print_add_link(const struct btrfsic_state *state,
2531 const struct btrfsic_block_link *l) 2487 const struct btrfsic_block_link *l)
2532{ 2488{
2533 printk(KERN_INFO 2489 pr_info("Add %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
2534 "Add %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
2535 l->ref_cnt, 2490 l->ref_cnt,
2536 btrfsic_get_block_type(state, l->block_ref_from), 2491 btrfsic_get_block_type(state, l->block_ref_from),
2537 l->block_ref_from->logical_bytenr, 2492 l->block_ref_from->logical_bytenr,
@@ -2546,8 +2501,7 @@ static void btrfsic_print_add_link(const struct btrfsic_state *state,
2546static void btrfsic_print_rem_link(const struct btrfsic_state *state, 2501static void btrfsic_print_rem_link(const struct btrfsic_state *state,
2547 const struct btrfsic_block_link *l) 2502 const struct btrfsic_block_link *l)
2548{ 2503{
2549 printk(KERN_INFO 2504 pr_info("Rem %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
2550 "Rem %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
2551 l->ref_cnt, 2505 l->ref_cnt,
2552 btrfsic_get_block_type(state, l->block_ref_from), 2506 btrfsic_get_block_type(state, l->block_ref_from),
2553 l->block_ref_from->logical_bytenr, 2507 l->block_ref_from->logical_bytenr,
@@ -2659,8 +2613,7 @@ static struct btrfsic_block_link *btrfsic_block_link_lookup_or_add(
2659 if (NULL == l) { 2613 if (NULL == l) {
2660 l = btrfsic_block_link_alloc(); 2614 l = btrfsic_block_link_alloc();
2661 if (NULL == l) { 2615 if (NULL == l) {
2662 printk(KERN_INFO 2616 pr_info("btrfsic: error, kmalloc failed!\n");
2663 "btrfsic: error, kmalloc failed!\n");
2664 return NULL; 2617 return NULL;
2665 } 2618 }
2666 2619
@@ -2707,13 +2660,12 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
2707 2660
2708 block = btrfsic_block_alloc(); 2661 block = btrfsic_block_alloc();
2709 if (NULL == block) { 2662 if (NULL == block) {
2710 printk(KERN_INFO "btrfsic: error, kmalloc failed!\n"); 2663 pr_info("btrfsic: error, kmalloc failed!\n");
2711 return NULL; 2664 return NULL;
2712 } 2665 }
2713 dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev); 2666 dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev);
2714 if (NULL == dev_state) { 2667 if (NULL == dev_state) {
2715 printk(KERN_INFO 2668 pr_info("btrfsic: error, lookup dev_state failed!\n");
2716 "btrfsic: error, lookup dev_state failed!\n");
2717 btrfsic_block_free(block); 2669 btrfsic_block_free(block);
2718 return NULL; 2670 return NULL;
2719 } 2671 }
@@ -2725,8 +2677,7 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
2725 block->never_written = never_written; 2677 block->never_written = never_written;
2726 block->mirror_num = mirror_num; 2678 block->mirror_num = mirror_num;
2727 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) 2679 if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
2728 printk(KERN_INFO 2680 pr_info("New %s%c-block @%llu (%s/%llu/%d)\n",
2729 "New %s%c-block @%llu (%s/%llu/%d)\n",
2730 additional_string, 2681 additional_string,
2731 btrfsic_get_block_type(state, block), 2682 btrfsic_get_block_type(state, block),
2732 block->logical_bytenr, dev_state->name, 2683 block->logical_bytenr, dev_state->name,
@@ -2761,7 +2712,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
2761 ret = btrfsic_map_block(state, bytenr, state->metablock_size, 2712 ret = btrfsic_map_block(state, bytenr, state->metablock_size,
2762 &block_ctx, mirror_num); 2713 &block_ctx, mirror_num);
2763 if (ret) { 2714 if (ret) {
2764 printk(KERN_INFO "btrfsic: btrfsic_map_block(logical @%llu, mirror %d) failed!\n", 2715 pr_info("btrfsic: btrfsic_map_block(logical @%llu, mirror %d) failed!\n",
2765 bytenr, mirror_num); 2716 bytenr, mirror_num);
2766 continue; 2717 continue;
2767 } 2718 }
@@ -2776,7 +2727,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
2776 } 2727 }
2777 2728
2778 if (WARN_ON(!match)) { 2729 if (WARN_ON(!match)) {
2779 printk(KERN_INFO "btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio, buffer->log_bytenr=%llu, submit_bio(bdev=%s, phys_bytenr=%llu)!\n", 2730 pr_info("btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio, buffer->log_bytenr=%llu, submit_bio(bdev=%s, phys_bytenr=%llu)!\n",
2780 bytenr, dev_state->name, dev_bytenr); 2731 bytenr, dev_state->name, dev_bytenr);
2781 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) { 2732 for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
2782 ret = btrfsic_map_block(state, bytenr, 2733 ret = btrfsic_map_block(state, bytenr,
@@ -2785,7 +2736,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
2785 if (ret) 2736 if (ret)
2786 continue; 2737 continue;
2787 2738
2788 printk(KERN_INFO "Read logical bytenr @%llu maps to (%s/%llu/%d)\n", 2739 pr_info("Read logical bytenr @%llu maps to (%s/%llu/%d)\n",
2789 bytenr, block_ctx.dev->name, 2740 bytenr, block_ctx.dev->name,
2790 block_ctx.dev_bytenr, mirror_num); 2741 block_ctx.dev_bytenr, mirror_num);
2791 } 2742 }
@@ -2819,8 +2770,7 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh)
2819 dev_bytenr = 4096 * bh->b_blocknr; 2770 dev_bytenr = 4096 * bh->b_blocknr;
2820 if (dev_state->state->print_mask & 2771 if (dev_state->state->print_mask &
2821 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) 2772 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
2822 printk(KERN_INFO 2773 pr_info("submit_bh(op=0x%x,0x%x, blocknr=%llu (bytenr %llu), size=%zu, data=%p, bdev=%p)\n",
2823 "submit_bh(op=0x%x,0x%x, blocknr=%llu (bytenr %llu), size=%zu, data=%p, bdev=%p)\n",
2824 op, op_flags, (unsigned long long)bh->b_blocknr, 2774 op, op_flags, (unsigned long long)bh->b_blocknr,
2825 dev_bytenr, bh->b_size, bh->b_data, bh->b_bdev); 2775 dev_bytenr, bh->b_size, bh->b_data, bh->b_bdev);
2826 btrfsic_process_written_block(dev_state, dev_bytenr, 2776 btrfsic_process_written_block(dev_state, dev_bytenr,
@@ -2829,15 +2779,13 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh)
2829 } else if (NULL != dev_state && (op_flags & REQ_PREFLUSH)) { 2779 } else if (NULL != dev_state && (op_flags & REQ_PREFLUSH)) {
2830 if (dev_state->state->print_mask & 2780 if (dev_state->state->print_mask &
2831 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) 2781 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
2832 printk(KERN_INFO 2782 pr_info("submit_bh(op=0x%x,0x%x FLUSH, bdev=%p)\n",
2833 "submit_bh(op=0x%x,0x%x FLUSH, bdev=%p)\n",
2834 op, op_flags, bh->b_bdev); 2783 op, op_flags, bh->b_bdev);
2835 if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) { 2784 if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
2836 if ((dev_state->state->print_mask & 2785 if ((dev_state->state->print_mask &
2837 (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | 2786 (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
2838 BTRFSIC_PRINT_MASK_VERBOSE))) 2787 BTRFSIC_PRINT_MASK_VERBOSE)))
2839 printk(KERN_INFO 2788 pr_info("btrfsic_submit_bh(%s) with FLUSH but dummy block already in use (ignored)!\n",
2840 "btrfsic_submit_bh(%s) with FLUSH but dummy block already in use (ignored)!\n",
2841 dev_state->name); 2789 dev_state->name);
2842 } else { 2790 } else {
2843 struct btrfsic_block *const block = 2791 struct btrfsic_block *const block =
@@ -2882,8 +2830,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
2882 bio_is_patched = 0; 2830 bio_is_patched = 0;
2883 if (dev_state->state->print_mask & 2831 if (dev_state->state->print_mask &
2884 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) 2832 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
2885 printk(KERN_INFO 2833 pr_info("submit_bio(rw=%d,0x%x, bi_vcnt=%u, bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
2886 "submit_bio(rw=%d,0x%x, bi_vcnt=%u, bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
2887 bio_op(bio), bio->bi_opf, bio->bi_vcnt, 2834 bio_op(bio), bio->bi_opf, bio->bi_vcnt,
2888 (unsigned long long)bio->bi_iter.bi_sector, 2835 (unsigned long long)bio->bi_iter.bi_sector,
2889 dev_bytenr, bio->bi_bdev); 2836 dev_bytenr, bio->bi_bdev);
@@ -2906,8 +2853,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
2906 } 2853 }
2907 if (dev_state->state->print_mask & 2854 if (dev_state->state->print_mask &
2908 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH_VERBOSE) 2855 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH_VERBOSE)
2909 printk(KERN_INFO 2856 pr_info("#%u: bytenr=%llu, len=%u, offset=%u\n",
2910 "#%u: bytenr=%llu, len=%u, offset=%u\n",
2911 i, cur_bytenr, bio->bi_io_vec[i].bv_len, 2857 i, cur_bytenr, bio->bi_io_vec[i].bv_len,
2912 bio->bi_io_vec[i].bv_offset); 2858 bio->bi_io_vec[i].bv_offset);
2913 cur_bytenr += bio->bi_io_vec[i].bv_len; 2859 cur_bytenr += bio->bi_io_vec[i].bv_len;
@@ -2924,15 +2870,13 @@ static void __btrfsic_submit_bio(struct bio *bio)
2924 } else if (NULL != dev_state && (bio->bi_opf & REQ_PREFLUSH)) { 2870 } else if (NULL != dev_state && (bio->bi_opf & REQ_PREFLUSH)) {
2925 if (dev_state->state->print_mask & 2871 if (dev_state->state->print_mask &
2926 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH) 2872 BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
2927 printk(KERN_INFO 2873 pr_info("submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n",
2928 "submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n",
2929 bio_op(bio), bio->bi_opf, bio->bi_bdev); 2874 bio_op(bio), bio->bi_opf, bio->bi_bdev);
2930 if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) { 2875 if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
2931 if ((dev_state->state->print_mask & 2876 if ((dev_state->state->print_mask &
2932 (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | 2877 (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
2933 BTRFSIC_PRINT_MASK_VERBOSE))) 2878 BTRFSIC_PRINT_MASK_VERBOSE)))
2934 printk(KERN_INFO 2879 pr_info("btrfsic_submit_bio(%s) with FLUSH but dummy block already in use (ignored)!\n",
2935 "btrfsic_submit_bio(%s) with FLUSH but dummy block already in use (ignored)!\n",
2936 dev_state->name); 2880 dev_state->name);
2937 } else { 2881 } else {
2938 struct btrfsic_block *const block = 2882 struct btrfsic_block *const block =
@@ -2976,14 +2920,12 @@ int btrfsic_mount(struct btrfs_root *root,
2976 struct btrfs_device *device; 2920 struct btrfs_device *device;
2977 2921
2978 if (root->nodesize & ((u64)PAGE_SIZE - 1)) { 2922 if (root->nodesize & ((u64)PAGE_SIZE - 1)) {
2979 printk(KERN_INFO 2923 pr_info("btrfsic: cannot handle nodesize %d not being a multiple of PAGE_SIZE %ld!\n",
2980 "btrfsic: cannot handle nodesize %d not being a multiple of PAGE_SIZE %ld!\n",
2981 root->nodesize, PAGE_SIZE); 2924 root->nodesize, PAGE_SIZE);
2982 return -1; 2925 return -1;
2983 } 2926 }
2984 if (root->sectorsize & ((u64)PAGE_SIZE - 1)) { 2927 if (root->sectorsize & ((u64)PAGE_SIZE - 1)) {
2985 printk(KERN_INFO 2928 pr_info("btrfsic: cannot handle sectorsize %d not being a multiple of PAGE_SIZE %ld!\n",
2986 "btrfsic: cannot handle sectorsize %d not being a multiple of PAGE_SIZE %ld!\n",
2987 root->sectorsize, PAGE_SIZE); 2929 root->sectorsize, PAGE_SIZE);
2988 return -1; 2930 return -1;
2989 } 2931 }
@@ -2991,7 +2933,7 @@ int btrfsic_mount(struct btrfs_root *root,
2991 if (!state) { 2933 if (!state) {
2992 state = vzalloc(sizeof(*state)); 2934 state = vzalloc(sizeof(*state));
2993 if (!state) { 2935 if (!state) {
2994 printk(KERN_INFO "btrfs check-integrity: vzalloc() failed!\n"); 2936 pr_info("btrfs check-integrity: vzalloc() failed!\n");
2995 return -1; 2937 return -1;
2996 } 2938 }
2997 } 2939 }
@@ -3023,8 +2965,7 @@ int btrfsic_mount(struct btrfs_root *root,
3023 2965
3024 ds = btrfsic_dev_state_alloc(); 2966 ds = btrfsic_dev_state_alloc();
3025 if (NULL == ds) { 2967 if (NULL == ds) {
3026 printk(KERN_INFO 2968 pr_info("btrfs check-integrity: kmalloc() failed!\n");
3027 "btrfs check-integrity: kmalloc() failed!\n");
3028 mutex_unlock(&btrfsic_mutex); 2969 mutex_unlock(&btrfsic_mutex);
3029 return -1; 2970 return -1;
3030 } 2971 }
@@ -3085,8 +3026,7 @@ void btrfsic_unmount(struct btrfs_root *root,
3085 } 3026 }
3086 3027
3087 if (NULL == state) { 3028 if (NULL == state) {
3088 printk(KERN_INFO 3029 pr_info("btrfsic: error, cannot find state information on umount!\n");
3089 "btrfsic: error, cannot find state information on umount!\n");
3090 mutex_unlock(&btrfsic_mutex); 3030 mutex_unlock(&btrfsic_mutex);
3091 return; 3031 return;
3092 } 3032 }
@@ -3113,7 +3053,7 @@ void btrfsic_unmount(struct btrfs_root *root,
3113 if (b_all->is_iodone || b_all->never_written) 3053 if (b_all->is_iodone || b_all->never_written)
3114 btrfsic_block_free(b_all); 3054 btrfsic_block_free(b_all);
3115 else 3055 else
3116 printk(KERN_INFO "btrfs: attempt to free %c-block @%llu (%s/%llu/%d) on umount which is not yet iodone!\n", 3056 pr_info("btrfs: attempt to free %c-block @%llu (%s/%llu/%d) on umount which is not yet iodone!\n",
3117 btrfsic_get_block_type(state, b_all), 3057 btrfsic_get_block_type(state, b_all),
3118 b_all->logical_bytenr, b_all->dev_state->name, 3058 b_all->logical_bytenr, b_all->dev_state->name,
3119 b_all->dev_bytenr, b_all->mirror_num); 3059 b_all->dev_bytenr, b_all->mirror_num);
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 029db6e1105c..d635d0f00f8f 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -783,8 +783,7 @@ void __init btrfs_init_compress(void)
783 */ 783 */
784 workspace = btrfs_compress_op[i]->alloc_workspace(); 784 workspace = btrfs_compress_op[i]->alloc_workspace();
785 if (IS_ERR(workspace)) { 785 if (IS_ERR(workspace)) {
786 printk(KERN_WARNING 786 pr_warn("BTRFS: cannot preallocate compression workspace, will try later\n");
787 "BTRFS: cannot preallocate compression workspace, will try later");
788 } else { 787 } else {
789 atomic_set(&btrfs_comp_ws[i].total_ws, 1); 788 atomic_set(&btrfs_comp_ws[i].total_ws, 1);
790 btrfs_comp_ws[i].free_ws = 1; 789 btrfs_comp_ws[i].free_ws = 1;
@@ -854,8 +853,7 @@ again:
854 /* no burst */ 1); 853 /* no burst */ 1);
855 854
856 if (__ratelimit(&_rs)) { 855 if (__ratelimit(&_rs)) {
857 printk(KERN_WARNING 856 pr_warn("no compression workspaces, low memory, retrying\n");
858 "no compression workspaces, low memory, retrying");
859 } 857 }
860 } 858 }
861 goto again; 859 goto again;
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 0da812cd1a95..0c910b1cb2f8 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -4791,7 +4791,7 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
4791 for (i = slot; i < nritems; i++) { 4791 for (i = slot; i < nritems; i++) {
4792 u32 ioff; 4792 u32 ioff;
4793 4793
4794 item = btrfs_item_nr( i); 4794 item = btrfs_item_nr(i);
4795 ioff = btrfs_token_item_offset(leaf, item, &token); 4795 ioff = btrfs_token_item_offset(leaf, item, &token);
4796 btrfs_set_token_item_offset(leaf, item, 4796 btrfs_set_token_item_offset(leaf, item,
4797 ioff - total_data, &token); 4797 ioff - total_data, &token);
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2b7041ed4cb8..8937f3f8780a 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1435,13 +1435,13 @@ static inline void btrfs_init_map_token (struct btrfs_map_token *token)
1435#define cpu_to_le8(v) (v) 1435#define cpu_to_le8(v) (v)
1436#define __le8 u8 1436#define __le8 u8
1437 1437
1438#define read_eb_member(eb, ptr, type, member, result) ( \ 1438#define read_eb_member(eb, ptr, type, member, result) (\
1439 read_extent_buffer(eb, (char *)(result), \ 1439 read_extent_buffer(eb, (char *)(result), \
1440 ((unsigned long)(ptr)) + \ 1440 ((unsigned long)(ptr)) + \
1441 offsetof(type, member), \ 1441 offsetof(type, member), \
1442 sizeof(((type *)0)->member))) 1442 sizeof(((type *)0)->member)))
1443 1443
1444#define write_eb_member(eb, ptr, type, member, result) ( \ 1444#define write_eb_member(eb, ptr, type, member, result) (\
1445 write_extent_buffer(eb, (char *)(result), \ 1445 write_extent_buffer(eb, (char *)(result), \
1446 ((unsigned long)(ptr)) + \ 1446 ((unsigned long)(ptr)) + \
1447 offsetof(type, member), \ 1447 offsetof(type, member), \
@@ -3358,7 +3358,7 @@ do { \
3358 btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, ##args) 3358 btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, ##args)
3359#else 3359#else
3360#define btrfs_debug(fs_info, fmt, args...) \ 3360#define btrfs_debug(fs_info, fmt, args...) \
3361 no_printk(KERN_DEBUG fmt, ##args) 3361 no_printk(KERN_DEBUG fmt, ##args)
3362#define btrfs_debug_in_rcu(fs_info, fmt, args...) \ 3362#define btrfs_debug_in_rcu(fs_info, fmt, args...) \
3363 no_printk(KERN_DEBUG fmt, ##args) 3363 no_printk(KERN_DEBUG fmt, ##args)
3364#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \ 3364#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 9e91b8b238f7..df8c8f291831 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -427,7 +427,7 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
427 } 427 }
428 428
429 if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) { 429 if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
430 printk(KERN_ERR "BTRFS: unsupported checksum algorithm %u\n", 430 pr_err("BTRFS: unsupported checksum algorithm %u\n",
431 csum_type); 431 csum_type);
432 ret = 1; 432 ret = 1;
433 } 433 }
@@ -4114,24 +4114,24 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
4114 int ret = 0; 4114 int ret = 0;
4115 4115
4116 if (btrfs_super_magic(sb) != BTRFS_MAGIC) { 4116 if (btrfs_super_magic(sb) != BTRFS_MAGIC) {
4117 printk(KERN_ERR "BTRFS: no valid FS found\n"); 4117 pr_err("BTRFS: no valid FS found\n");
4118 ret = -EINVAL; 4118 ret = -EINVAL;
4119 } 4119 }
4120 if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP) 4120 if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP)
4121 printk(KERN_WARNING "BTRFS: unrecognized super flag: %llu\n", 4121 pr_warn("BTRFS: unrecognized super flag: %llu\n",
4122 btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP); 4122 btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP);
4123 if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) { 4123 if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) {
4124 printk(KERN_ERR "BTRFS: tree_root level too big: %d >= %d\n", 4124 pr_err("BTRFS: tree_root level too big: %d >= %d\n",
4125 btrfs_super_root_level(sb), BTRFS_MAX_LEVEL); 4125 btrfs_super_root_level(sb), BTRFS_MAX_LEVEL);
4126 ret = -EINVAL; 4126 ret = -EINVAL;
4127 } 4127 }
4128 if (btrfs_super_chunk_root_level(sb) >= BTRFS_MAX_LEVEL) { 4128 if (btrfs_super_chunk_root_level(sb) >= BTRFS_MAX_LEVEL) {
4129 printk(KERN_ERR "BTRFS: chunk_root level too big: %d >= %d\n", 4129 pr_err("BTRFS: chunk_root level too big: %d >= %d\n",
4130 btrfs_super_chunk_root_level(sb), BTRFS_MAX_LEVEL); 4130 btrfs_super_chunk_root_level(sb), BTRFS_MAX_LEVEL);
4131 ret = -EINVAL; 4131 ret = -EINVAL;
4132 } 4132 }
4133 if (btrfs_super_log_root_level(sb) >= BTRFS_MAX_LEVEL) { 4133 if (btrfs_super_log_root_level(sb) >= BTRFS_MAX_LEVEL) {
4134 printk(KERN_ERR "BTRFS: log_root level too big: %d >= %d\n", 4134 pr_err("BTRFS: log_root level too big: %d >= %d\n",
4135 btrfs_super_log_root_level(sb), BTRFS_MAX_LEVEL); 4135 btrfs_super_log_root_level(sb), BTRFS_MAX_LEVEL);
4136 ret = -EINVAL; 4136 ret = -EINVAL;
4137 } 4137 }
@@ -4142,22 +4142,22 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
4142 */ 4142 */
4143 if (!is_power_of_2(sectorsize) || sectorsize < 4096 || 4143 if (!is_power_of_2(sectorsize) || sectorsize < 4096 ||
4144 sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) { 4144 sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) {
4145 printk(KERN_ERR "BTRFS: invalid sectorsize %llu\n", sectorsize); 4145 pr_err("BTRFS: invalid sectorsize %llu\n", sectorsize);
4146 ret = -EINVAL; 4146 ret = -EINVAL;
4147 } 4147 }
4148 /* Only PAGE SIZE is supported yet */ 4148 /* Only PAGE SIZE is supported yet */
4149 if (sectorsize != PAGE_SIZE) { 4149 if (sectorsize != PAGE_SIZE) {
4150 printk(KERN_ERR "BTRFS: sectorsize %llu not supported yet, only support %lu\n", 4150 pr_err("BTRFS: sectorsize %llu not supported yet, only support %lu\n",
4151 sectorsize, PAGE_SIZE); 4151 sectorsize, PAGE_SIZE);
4152 ret = -EINVAL; 4152 ret = -EINVAL;
4153 } 4153 }
4154 if (!is_power_of_2(nodesize) || nodesize < sectorsize || 4154 if (!is_power_of_2(nodesize) || nodesize < sectorsize ||
4155 nodesize > BTRFS_MAX_METADATA_BLOCKSIZE) { 4155 nodesize > BTRFS_MAX_METADATA_BLOCKSIZE) {
4156 printk(KERN_ERR "BTRFS: invalid nodesize %llu\n", nodesize); 4156 pr_err("BTRFS: invalid nodesize %llu\n", nodesize);
4157 ret = -EINVAL; 4157 ret = -EINVAL;
4158 } 4158 }
4159 if (nodesize != le32_to_cpu(sb->__unused_leafsize)) { 4159 if (nodesize != le32_to_cpu(sb->__unused_leafsize)) {
4160 printk(KERN_ERR "BTRFS: invalid leafsize %u, should be %llu\n", 4160 pr_err("BTRFS: invalid leafsize %u, should be %llu\n",
4161 le32_to_cpu(sb->__unused_leafsize), 4161 le32_to_cpu(sb->__unused_leafsize),
4162 nodesize); 4162 nodesize);
4163 ret = -EINVAL; 4163 ret = -EINVAL;
@@ -4165,23 +4165,23 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
4165 4165
4166 /* Root alignment check */ 4166 /* Root alignment check */
4167 if (!IS_ALIGNED(btrfs_super_root(sb), sectorsize)) { 4167 if (!IS_ALIGNED(btrfs_super_root(sb), sectorsize)) {
4168 printk(KERN_WARNING "BTRFS: tree_root block unaligned: %llu\n", 4168 pr_warn("BTRFS: tree_root block unaligned: %llu\n",
4169 btrfs_super_root(sb)); 4169 btrfs_super_root(sb));
4170 ret = -EINVAL; 4170 ret = -EINVAL;
4171 } 4171 }
4172 if (!IS_ALIGNED(btrfs_super_chunk_root(sb), sectorsize)) { 4172 if (!IS_ALIGNED(btrfs_super_chunk_root(sb), sectorsize)) {
4173 printk(KERN_WARNING "BTRFS: chunk_root block unaligned: %llu\n", 4173 pr_warn("BTRFS: chunk_root block unaligned: %llu\n",
4174 btrfs_super_chunk_root(sb)); 4174 btrfs_super_chunk_root(sb));
4175 ret = -EINVAL; 4175 ret = -EINVAL;
4176 } 4176 }
4177 if (!IS_ALIGNED(btrfs_super_log_root(sb), sectorsize)) { 4177 if (!IS_ALIGNED(btrfs_super_log_root(sb), sectorsize)) {
4178 printk(KERN_WARNING "BTRFS: log_root block unaligned: %llu\n", 4178 pr_warn("BTRFS: log_root block unaligned: %llu\n",
4179 btrfs_super_log_root(sb)); 4179 btrfs_super_log_root(sb));
4180 ret = -EINVAL; 4180 ret = -EINVAL;
4181 } 4181 }
4182 4182
4183 if (memcmp(fs_info->fsid, sb->dev_item.fsid, BTRFS_UUID_SIZE) != 0) { 4183 if (memcmp(fs_info->fsid, sb->dev_item.fsid, BTRFS_UUID_SIZE) != 0) {
4184 printk(KERN_ERR "BTRFS: dev_item UUID does not match fsid: %pU != %pU\n", 4184 pr_err("BTRFS: dev_item UUID does not match fsid: %pU != %pU\n",
4185 fs_info->fsid, sb->dev_item.fsid); 4185 fs_info->fsid, sb->dev_item.fsid);
4186 ret = -EINVAL; 4186 ret = -EINVAL;
4187 } 4187 }
@@ -4201,15 +4201,15 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
4201 ret = -EINVAL; 4201 ret = -EINVAL;
4202 } 4202 }
4203 if (btrfs_super_num_devices(sb) > (1UL << 31)) 4203 if (btrfs_super_num_devices(sb) > (1UL << 31))
4204 printk(KERN_WARNING "BTRFS: suspicious number of devices: %llu\n", 4204 pr_warn("BTRFS: suspicious number of devices: %llu\n",
4205 btrfs_super_num_devices(sb)); 4205 btrfs_super_num_devices(sb));
4206 if (btrfs_super_num_devices(sb) == 0) { 4206 if (btrfs_super_num_devices(sb) == 0) {
4207 printk(KERN_ERR "BTRFS: number of devices is 0\n"); 4207 pr_err("BTRFS: number of devices is 0\n");
4208 ret = -EINVAL; 4208 ret = -EINVAL;
4209 } 4209 }
4210 4210
4211 if (btrfs_super_bytenr(sb) != BTRFS_SUPER_INFO_OFFSET) { 4211 if (btrfs_super_bytenr(sb) != BTRFS_SUPER_INFO_OFFSET) {
4212 printk(KERN_ERR "BTRFS: super offset mismatch %llu != %u\n", 4212 pr_err("BTRFS: super offset mismatch %llu != %u\n",
4213 btrfs_super_bytenr(sb), BTRFS_SUPER_INFO_OFFSET); 4213 btrfs_super_bytenr(sb), BTRFS_SUPER_INFO_OFFSET);
4214 ret = -EINVAL; 4214 ret = -EINVAL;
4215 } 4215 }
@@ -4219,14 +4219,14 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
4219 * and one chunk 4219 * and one chunk
4220 */ 4220 */
4221 if (btrfs_super_sys_array_size(sb) > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) { 4221 if (btrfs_super_sys_array_size(sb) > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) {
4222 printk(KERN_ERR "BTRFS: system chunk array too big %u > %u\n", 4222 pr_err("BTRFS: system chunk array too big %u > %u\n",
4223 btrfs_super_sys_array_size(sb), 4223 btrfs_super_sys_array_size(sb),
4224 BTRFS_SYSTEM_CHUNK_ARRAY_SIZE); 4224 BTRFS_SYSTEM_CHUNK_ARRAY_SIZE);
4225 ret = -EINVAL; 4225 ret = -EINVAL;
4226 } 4226 }
4227 if (btrfs_super_sys_array_size(sb) < sizeof(struct btrfs_disk_key) 4227 if (btrfs_super_sys_array_size(sb) < sizeof(struct btrfs_disk_key)
4228 + sizeof(struct btrfs_chunk)) { 4228 + sizeof(struct btrfs_chunk)) {
4229 printk(KERN_ERR "BTRFS: system chunk array too small %u < %zu\n", 4229 pr_err("BTRFS: system chunk array too small %u < %zu\n",
4230 btrfs_super_sys_array_size(sb), 4230 btrfs_super_sys_array_size(sb),
4231 sizeof(struct btrfs_disk_key) 4231 sizeof(struct btrfs_disk_key)
4232 + sizeof(struct btrfs_chunk)); 4232 + sizeof(struct btrfs_chunk));
@@ -4238,13 +4238,11 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
4238 * but it's still possible that it's the one that's wrong. 4238 * but it's still possible that it's the one that's wrong.
4239 */ 4239 */
4240 if (btrfs_super_generation(sb) < btrfs_super_chunk_root_generation(sb)) 4240 if (btrfs_super_generation(sb) < btrfs_super_chunk_root_generation(sb))
4241 printk(KERN_WARNING 4241 pr_warn("BTRFS: suspicious: generation < chunk_root_generation: %llu < %llu\n",
4242 "BTRFS: suspicious: generation < chunk_root_generation: %llu < %llu\n",
4243 btrfs_super_generation(sb), btrfs_super_chunk_root_generation(sb)); 4242 btrfs_super_generation(sb), btrfs_super_chunk_root_generation(sb));
4244 if (btrfs_super_generation(sb) < btrfs_super_cache_generation(sb) 4243 if (btrfs_super_generation(sb) < btrfs_super_cache_generation(sb)
4245 && btrfs_super_cache_generation(sb) != (u64)-1) 4244 && btrfs_super_cache_generation(sb) != (u64)-1)
4246 printk(KERN_WARNING 4245 pr_warn("BTRFS: suspicious: generation < cache_generation: %llu < %llu\n",
4247 "BTRFS: suspicious: generation < cache_generation: %llu < %llu\n",
4248 btrfs_super_generation(sb), btrfs_super_cache_generation(sb)); 4246 btrfs_super_generation(sb), btrfs_super_cache_generation(sb));
4249 4247
4250 return ret; 4248 return ret;
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 1e5b39c218a9..4e9eeb48f76f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7914,12 +7914,12 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
7914 int index = 0; 7914 int index = 0;
7915 7915
7916 spin_lock(&info->lock); 7916 spin_lock(&info->lock);
7917 printk(KERN_INFO "BTRFS: space_info %llu has %llu free, is %sfull\n", 7917 pr_info("BTRFS: space_info %llu has %llu free, is %sfull\n",
7918 info->flags, 7918 info->flags,
7919 info->total_bytes - info->bytes_used - info->bytes_pinned - 7919 info->total_bytes - info->bytes_used - info->bytes_pinned -
7920 info->bytes_reserved - info->bytes_readonly - 7920 info->bytes_reserved - info->bytes_readonly -
7921 info->bytes_may_use, (info->full) ? "" : "not "); 7921 info->bytes_may_use, (info->full) ? "" : "not ");
7922 printk(KERN_INFO "BTRFS: space_info total=%llu, used=%llu, pinned=%llu, reserved=%llu, may_use=%llu, readonly=%llu\n", 7922 pr_info("BTRFS: space_info total=%llu, used=%llu, pinned=%llu, reserved=%llu, may_use=%llu, readonly=%llu\n",
7923 info->total_bytes, info->bytes_used, info->bytes_pinned, 7923 info->total_bytes, info->bytes_used, info->bytes_pinned,
7924 info->bytes_reserved, info->bytes_may_use, 7924 info->bytes_reserved, info->bytes_may_use,
7925 info->bytes_readonly); 7925 info->bytes_readonly);
@@ -7932,7 +7932,7 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
7932again: 7932again:
7933 list_for_each_entry(cache, &info->block_groups[index], list) { 7933 list_for_each_entry(cache, &info->block_groups[index], list) {
7934 spin_lock(&cache->lock); 7934 spin_lock(&cache->lock);
7935 printk(KERN_INFO "BTRFS: block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n", 7935 pr_info("BTRFS: block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n",
7936 cache->key.objectid, cache->key.offset, 7936 cache->key.objectid, cache->key.offset,
7937 btrfs_block_group_used(&cache->item), cache->pinned, 7937 btrfs_block_group_used(&cache->item), cache->pinned,
7938 cache->reserved, cache->ro ? "[readonly]" : ""); 7938 cache->reserved, cache->ro ? "[readonly]" : "");
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 906c5927b0c6..8c4a0a09c221 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -75,7 +75,7 @@ void btrfs_leak_debug_check(void)
75 75
76 while (!list_empty(&buffers)) { 76 while (!list_empty(&buffers)) {
77 eb = list_entry(buffers.next, struct extent_buffer, leak_list); 77 eb = list_entry(buffers.next, struct extent_buffer, leak_list);
78 printk(KERN_ERR "BTRFS: buffer leak start %llu len %lu refs %d\n", 78 pr_err("BTRFS: buffer leak start %llu len %lu refs %d\n",
79 eb->start, eb->len, atomic_read(&eb->refs)); 79 eb->start, eb->len, atomic_read(&eb->refs));
80 list_del(&eb->leak_list); 80 list_del(&eb->leak_list);
81 kmem_cache_free(extent_buffer_cache, eb); 81 kmem_cache_free(extent_buffer_cache, eb);
@@ -460,7 +460,7 @@ static int insert_state(struct extent_io_tree *tree,
460 if (node) { 460 if (node) {
461 struct extent_state *found; 461 struct extent_state *found;
462 found = rb_entry(node, struct extent_state, rb_node); 462 found = rb_entry(node, struct extent_state, rb_node);
463 printk(KERN_ERR "BTRFS: found node %llu %llu on insert of %llu %llu\n", 463 pr_err("BTRFS: found node %llu %llu on insert of %llu %llu\n",
464 found->start, found->end, start, end); 464 found->start, found->end, start, end);
465 return -EEXIST; 465 return -EEXIST;
466 } 466 }
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index ea09fabb06a5..60dedf400761 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -2346,7 +2346,7 @@ out:
2346 spin_unlock(&ctl->tree_lock); 2346 spin_unlock(&ctl->tree_lock);
2347 2347
2348 if (ret) { 2348 if (ret) {
2349 printk(KERN_CRIT "BTRFS: unable to add free space :%d\n", ret); 2349 pr_crit("BTRFS: unable to add free space :%d\n", ret);
2350 ASSERT(ret != -EEXIST); 2350 ASSERT(ret != -EEXIST);
2351 } 2351 }
2352 2352
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index 1adfbe7be6b8..48655da0f4ca 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -141,7 +141,7 @@ static int lzo_compress_pages(struct list_head *ws,
141 ret = lzo1x_1_compress(data_in, in_len, workspace->cbuf, 141 ret = lzo1x_1_compress(data_in, in_len, workspace->cbuf,
142 &out_len, workspace->mem); 142 &out_len, workspace->mem);
143 if (ret != LZO_E_OK) { 143 if (ret != LZO_E_OK) {
144 printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n", 144 pr_debug("BTRFS: deflate in loop returned %d\n",
145 ret); 145 ret);
146 ret = -EIO; 146 ret = -EIO;
147 goto out; 147 goto out;
@@ -356,7 +356,7 @@ cont:
356 if (need_unmap) 356 if (need_unmap)
357 kunmap(pages_in[page_in_index - 1]); 357 kunmap(pages_in[page_in_index - 1]);
358 if (ret != LZO_E_OK) { 358 if (ret != LZO_E_OK) {
359 printk(KERN_WARNING "BTRFS: decompress failed\n"); 359 pr_warn("BTRFS: decompress failed\n");
360 ret = -EIO; 360 ret = -EIO;
361 break; 361 break;
362 } 362 }
@@ -402,7 +402,7 @@ static int lzo_decompress(struct list_head *ws, unsigned char *data_in,
402 out_len = PAGE_SIZE; 402 out_len = PAGE_SIZE;
403 ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len); 403 ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len);
404 if (ret != LZO_E_OK) { 404 if (ret != LZO_E_OK) {
405 printk(KERN_WARNING "BTRFS: decompress failed!\n"); 405 pr_warn("BTRFS: decompress failed!\n");
406 ret = -EIO; 406 ret = -EIO;
407 goto out; 407 goto out;
408 } 408 }
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 2fa49f207ca0..438575ea8d25 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -24,11 +24,11 @@ static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
24{ 24{
25 int num_stripes = btrfs_chunk_num_stripes(eb, chunk); 25 int num_stripes = btrfs_chunk_num_stripes(eb, chunk);
26 int i; 26 int i;
27 printk(KERN_INFO "\t\tchunk length %llu owner %llu type %llu num_stripes %d\n", 27 pr_info("\t\tchunk length %llu owner %llu type %llu num_stripes %d\n",
28 btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk), 28 btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk),
29 btrfs_chunk_type(eb, chunk), num_stripes); 29 btrfs_chunk_type(eb, chunk), num_stripes);
30 for (i = 0 ; i < num_stripes ; i++) { 30 for (i = 0 ; i < num_stripes ; i++) {
31 printk(KERN_INFO "\t\t\tstripe %d devid %llu offset %llu\n", i, 31 pr_info("\t\t\tstripe %d devid %llu offset %llu\n", i,
32 btrfs_stripe_devid_nr(eb, chunk, i), 32 btrfs_stripe_devid_nr(eb, chunk, i),
33 btrfs_stripe_offset_nr(eb, chunk, i)); 33 btrfs_stripe_offset_nr(eb, chunk, i));
34 } 34 }
@@ -36,7 +36,7 @@ static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
36static void print_dev_item(struct extent_buffer *eb, 36static void print_dev_item(struct extent_buffer *eb,
37 struct btrfs_dev_item *dev_item) 37 struct btrfs_dev_item *dev_item)
38{ 38{
39 printk(KERN_INFO "\t\tdev item devid %llu total_bytes %llu bytes used %llu\n", 39 pr_info("\t\tdev item devid %llu total_bytes %llu bytes used %llu\n",
40 btrfs_device_id(eb, dev_item), 40 btrfs_device_id(eb, dev_item),
41 btrfs_device_total_bytes(eb, dev_item), 41 btrfs_device_total_bytes(eb, dev_item),
42 btrfs_device_bytes_used(eb, dev_item)); 42 btrfs_device_bytes_used(eb, dev_item));
@@ -44,7 +44,7 @@ static void print_dev_item(struct extent_buffer *eb,
44static void print_extent_data_ref(struct extent_buffer *eb, 44static void print_extent_data_ref(struct extent_buffer *eb,
45 struct btrfs_extent_data_ref *ref) 45 struct btrfs_extent_data_ref *ref)
46{ 46{
47 printk(KERN_INFO "\t\textent data backref root %llu objectid %llu offset %llu count %u\n", 47 pr_info("\t\textent data backref root %llu objectid %llu offset %llu count %u\n",
48 btrfs_extent_data_ref_root(eb, ref), 48 btrfs_extent_data_ref_root(eb, ref),
49 btrfs_extent_data_ref_objectid(eb, ref), 49 btrfs_extent_data_ref_objectid(eb, ref),
50 btrfs_extent_data_ref_offset(eb, ref), 50 btrfs_extent_data_ref_offset(eb, ref),
@@ -69,7 +69,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
69 struct btrfs_extent_item_v0 *ei0; 69 struct btrfs_extent_item_v0 *ei0;
70 BUG_ON(item_size != sizeof(*ei0)); 70 BUG_ON(item_size != sizeof(*ei0));
71 ei0 = btrfs_item_ptr(eb, slot, struct btrfs_extent_item_v0); 71 ei0 = btrfs_item_ptr(eb, slot, struct btrfs_extent_item_v0);
72 printk(KERN_INFO "\t\textent refs %u\n", 72 pr_info("\t\textent refs %u\n",
73 btrfs_extent_refs_v0(eb, ei0)); 73 btrfs_extent_refs_v0(eb, ei0));
74 return; 74 return;
75#else 75#else
@@ -80,7 +80,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
80 ei = btrfs_item_ptr(eb, slot, struct btrfs_extent_item); 80 ei = btrfs_item_ptr(eb, slot, struct btrfs_extent_item);
81 flags = btrfs_extent_flags(eb, ei); 81 flags = btrfs_extent_flags(eb, ei);
82 82
83 printk(KERN_INFO "\t\textent refs %llu gen %llu flags %llu\n", 83 pr_info("\t\textent refs %llu gen %llu flags %llu\n",
84 btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei), 84 btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei),
85 flags); 85 flags);
86 86
@@ -89,7 +89,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
89 struct btrfs_tree_block_info *info; 89 struct btrfs_tree_block_info *info;
90 info = (struct btrfs_tree_block_info *)(ei + 1); 90 info = (struct btrfs_tree_block_info *)(ei + 1);
91 btrfs_tree_block_key(eb, info, &key); 91 btrfs_tree_block_key(eb, info, &key);
92 printk(KERN_INFO "\t\ttree block key (%llu %u %llu) level %d\n", 92 pr_info("\t\ttree block key (%llu %u %llu) level %d\n",
93 btrfs_disk_key_objectid(&key), key.type, 93 btrfs_disk_key_objectid(&key), key.type,
94 btrfs_disk_key_offset(&key), 94 btrfs_disk_key_offset(&key),
95 btrfs_tree_block_level(eb, info)); 95 btrfs_tree_block_level(eb, info));
@@ -106,10 +106,10 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
106 offset = btrfs_extent_inline_ref_offset(eb, iref); 106 offset = btrfs_extent_inline_ref_offset(eb, iref);
107 switch (type) { 107 switch (type) {
108 case BTRFS_TREE_BLOCK_REF_KEY: 108 case BTRFS_TREE_BLOCK_REF_KEY:
109 printk(KERN_INFO "\t\ttree block backref root %llu\n", offset); 109 pr_info("\t\ttree block backref root %llu\n", offset);
110 break; 110 break;
111 case BTRFS_SHARED_BLOCK_REF_KEY: 111 case BTRFS_SHARED_BLOCK_REF_KEY:
112 printk(KERN_INFO "\t\tshared block backref parent %llu\n", offset); 112 pr_info("\t\tshared block backref parent %llu\n", offset);
113 break; 113 break;
114 case BTRFS_EXTENT_DATA_REF_KEY: 114 case BTRFS_EXTENT_DATA_REF_KEY:
115 dref = (struct btrfs_extent_data_ref *)(&iref->offset); 115 dref = (struct btrfs_extent_data_ref *)(&iref->offset);
@@ -117,7 +117,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
117 break; 117 break;
118 case BTRFS_SHARED_DATA_REF_KEY: 118 case BTRFS_SHARED_DATA_REF_KEY:
119 sref = (struct btrfs_shared_data_ref *)(iref + 1); 119 sref = (struct btrfs_shared_data_ref *)(iref + 1);
120 printk(KERN_INFO "\t\tshared data backref parent %llu count %u\n", 120 pr_info("\t\tshared data backref parent %llu count %u\n",
121 offset, btrfs_shared_data_ref_count(eb, sref)); 121 offset, btrfs_shared_data_ref_count(eb, sref));
122 break; 122 break;
123 default: 123 default:
@@ -154,7 +154,7 @@ static void print_uuid_item(struct extent_buffer *l, unsigned long offset,
154 __le64 subvol_id; 154 __le64 subvol_id;
155 155
156 read_extent_buffer(l, &subvol_id, offset, sizeof(subvol_id)); 156 read_extent_buffer(l, &subvol_id, offset, sizeof(subvol_id));
157 printk(KERN_INFO "\t\tsubvol_id %llu\n", 157 pr_info("\t\tsubvol_id %llu\n",
158 (unsigned long long)le64_to_cpu(subvol_id)); 158 (unsigned long long)le64_to_cpu(subvol_id));
159 item_size -= sizeof(u64); 159 item_size -= sizeof(u64);
160 offset += sizeof(u64); 160 offset += sizeof(u64);
@@ -188,13 +188,13 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
188 item = btrfs_item_nr(i); 188 item = btrfs_item_nr(i);
189 btrfs_item_key_to_cpu(l, &key, i); 189 btrfs_item_key_to_cpu(l, &key, i);
190 type = key.type; 190 type = key.type;
191 printk(KERN_INFO "\titem %d key (%llu %u %llu) itemoff %d itemsize %d\n", 191 pr_info("\titem %d key (%llu %u %llu) itemoff %d itemsize %d\n",
192 i, key.objectid, type, key.offset, 192 i, key.objectid, type, key.offset,
193 btrfs_item_offset(l, item), btrfs_item_size(l, item)); 193 btrfs_item_offset(l, item), btrfs_item_size(l, item));
194 switch (type) { 194 switch (type) {
195 case BTRFS_INODE_ITEM_KEY: 195 case BTRFS_INODE_ITEM_KEY:
196 ii = btrfs_item_ptr(l, i, struct btrfs_inode_item); 196 ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
197 printk(KERN_INFO "\t\tinode generation %llu size %llu mode %o\n", 197 pr_info("\t\tinode generation %llu size %llu mode %o\n",
198 btrfs_inode_generation(l, ii), 198 btrfs_inode_generation(l, ii),
199 btrfs_inode_size(l, ii), 199 btrfs_inode_size(l, ii),
200 btrfs_inode_mode(l, ii)); 200 btrfs_inode_mode(l, ii));
@@ -202,13 +202,13 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
202 case BTRFS_DIR_ITEM_KEY: 202 case BTRFS_DIR_ITEM_KEY:
203 di = btrfs_item_ptr(l, i, struct btrfs_dir_item); 203 di = btrfs_item_ptr(l, i, struct btrfs_dir_item);
204 btrfs_dir_item_key_to_cpu(l, di, &found_key); 204 btrfs_dir_item_key_to_cpu(l, di, &found_key);
205 printk(KERN_INFO "\t\tdir oid %llu type %u\n", 205 pr_info("\t\tdir oid %llu type %u\n",
206 found_key.objectid, 206 found_key.objectid,
207 btrfs_dir_type(l, di)); 207 btrfs_dir_type(l, di));
208 break; 208 break;
209 case BTRFS_ROOT_ITEM_KEY: 209 case BTRFS_ROOT_ITEM_KEY:
210 ri = btrfs_item_ptr(l, i, struct btrfs_root_item); 210 ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
211 printk(KERN_INFO "\t\troot data bytenr %llu refs %u\n", 211 pr_info("\t\troot data bytenr %llu refs %u\n",
212 btrfs_disk_root_bytenr(l, ri), 212 btrfs_disk_root_bytenr(l, ri),
213 btrfs_disk_root_refs(l, ri)); 213 btrfs_disk_root_refs(l, ri));
214 break; 214 break;
@@ -217,10 +217,10 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
217 print_extent_item(l, i, type); 217 print_extent_item(l, i, type);
218 break; 218 break;
219 case BTRFS_TREE_BLOCK_REF_KEY: 219 case BTRFS_TREE_BLOCK_REF_KEY:
220 printk(KERN_INFO "\t\ttree block backref\n"); 220 pr_info("\t\ttree block backref\n");
221 break; 221 break;
222 case BTRFS_SHARED_BLOCK_REF_KEY: 222 case BTRFS_SHARED_BLOCK_REF_KEY:
223 printk(KERN_INFO "\t\tshared block backref\n"); 223 pr_info("\t\tshared block backref\n");
224 break; 224 break;
225 case BTRFS_EXTENT_DATA_REF_KEY: 225 case BTRFS_EXTENT_DATA_REF_KEY:
226 dref = btrfs_item_ptr(l, i, 226 dref = btrfs_item_ptr(l, i,
@@ -230,7 +230,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
230 case BTRFS_SHARED_DATA_REF_KEY: 230 case BTRFS_SHARED_DATA_REF_KEY:
231 sref = btrfs_item_ptr(l, i, 231 sref = btrfs_item_ptr(l, i,
232 struct btrfs_shared_data_ref); 232 struct btrfs_shared_data_ref);
233 printk(KERN_INFO "\t\tshared data backref count %u\n", 233 pr_info("\t\tshared data backref count %u\n",
234 btrfs_shared_data_ref_count(l, sref)); 234 btrfs_shared_data_ref_count(l, sref));
235 break; 235 break;
236 case BTRFS_EXTENT_DATA_KEY: 236 case BTRFS_EXTENT_DATA_KEY:
@@ -238,14 +238,14 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
238 struct btrfs_file_extent_item); 238 struct btrfs_file_extent_item);
239 if (btrfs_file_extent_type(l, fi) == 239 if (btrfs_file_extent_type(l, fi) ==
240 BTRFS_FILE_EXTENT_INLINE) { 240 BTRFS_FILE_EXTENT_INLINE) {
241 printk(KERN_INFO "\t\tinline extent data size %u\n", 241 pr_info("\t\tinline extent data size %u\n",
242 btrfs_file_extent_inline_len(l, i, fi)); 242 btrfs_file_extent_inline_len(l, i, fi));
243 break; 243 break;
244 } 244 }
245 printk(KERN_INFO "\t\textent data disk bytenr %llu nr %llu\n", 245 pr_info("\t\textent data disk bytenr %llu nr %llu\n",
246 btrfs_file_extent_disk_bytenr(l, fi), 246 btrfs_file_extent_disk_bytenr(l, fi),
247 btrfs_file_extent_disk_num_bytes(l, fi)); 247 btrfs_file_extent_disk_num_bytes(l, fi));
248 printk(KERN_INFO "\t\textent data offset %llu nr %llu ram %llu\n", 248 pr_info("\t\textent data offset %llu nr %llu ram %llu\n",
249 btrfs_file_extent_offset(l, fi), 249 btrfs_file_extent_offset(l, fi),
250 btrfs_file_extent_num_bytes(l, fi), 250 btrfs_file_extent_num_bytes(l, fi),
251 btrfs_file_extent_ram_bytes(l, fi)); 251 btrfs_file_extent_ram_bytes(l, fi));
@@ -260,7 +260,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
260 case BTRFS_BLOCK_GROUP_ITEM_KEY: 260 case BTRFS_BLOCK_GROUP_ITEM_KEY:
261 bi = btrfs_item_ptr(l, i, 261 bi = btrfs_item_ptr(l, i,
262 struct btrfs_block_group_item); 262 struct btrfs_block_group_item);
263 printk(KERN_INFO "\t\tblock group used %llu\n", 263 pr_info("\t\tblock group used %llu\n",
264 btrfs_disk_block_group_used(l, bi)); 264 btrfs_disk_block_group_used(l, bi));
265 break; 265 break;
266 case BTRFS_CHUNK_ITEM_KEY: 266 case BTRFS_CHUNK_ITEM_KEY:
@@ -274,36 +274,36 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
274 case BTRFS_DEV_EXTENT_KEY: 274 case BTRFS_DEV_EXTENT_KEY:
275 dev_extent = btrfs_item_ptr(l, i, 275 dev_extent = btrfs_item_ptr(l, i,
276 struct btrfs_dev_extent); 276 struct btrfs_dev_extent);
277 printk(KERN_INFO "\t\tdev extent chunk_tree %llu\n\t\tchunk objectid %llu chunk offset %llu length %llu\n", 277 pr_info("\t\tdev extent chunk_tree %llu\n\t\tchunk objectid %llu chunk offset %llu length %llu\n",
278 btrfs_dev_extent_chunk_tree(l, dev_extent), 278 btrfs_dev_extent_chunk_tree(l, dev_extent),
279 btrfs_dev_extent_chunk_objectid(l, dev_extent), 279 btrfs_dev_extent_chunk_objectid(l, dev_extent),
280 btrfs_dev_extent_chunk_offset(l, dev_extent), 280 btrfs_dev_extent_chunk_offset(l, dev_extent),
281 btrfs_dev_extent_length(l, dev_extent)); 281 btrfs_dev_extent_length(l, dev_extent));
282 break; 282 break;
283 case BTRFS_PERSISTENT_ITEM_KEY: 283 case BTRFS_PERSISTENT_ITEM_KEY:
284 printk(KERN_INFO "\t\tpersistent item objectid %llu offset %llu\n", 284 pr_info("\t\tpersistent item objectid %llu offset %llu\n",
285 key.objectid, key.offset); 285 key.objectid, key.offset);
286 switch (key.objectid) { 286 switch (key.objectid) {
287 case BTRFS_DEV_STATS_OBJECTID: 287 case BTRFS_DEV_STATS_OBJECTID:
288 printk(KERN_INFO "\t\tdevice stats\n"); 288 pr_info("\t\tdevice stats\n");
289 break; 289 break;
290 default: 290 default:
291 printk(KERN_INFO "\t\tunknown persistent item\n"); 291 pr_info("\t\tunknown persistent item\n");
292 } 292 }
293 break; 293 break;
294 case BTRFS_TEMPORARY_ITEM_KEY: 294 case BTRFS_TEMPORARY_ITEM_KEY:
295 printk(KERN_INFO "\t\ttemporary item objectid %llu offset %llu\n", 295 pr_info("\t\ttemporary item objectid %llu offset %llu\n",
296 key.objectid, key.offset); 296 key.objectid, key.offset);
297 switch (key.objectid) { 297 switch (key.objectid) {
298 case BTRFS_BALANCE_OBJECTID: 298 case BTRFS_BALANCE_OBJECTID:
299 printk(KERN_INFO "\t\tbalance status\n"); 299 pr_info("\t\tbalance status\n");
300 break; 300 break;
301 default: 301 default:
302 printk(KERN_INFO "\t\tunknown temporary item\n"); 302 pr_info("\t\tunknown temporary item\n");
303 } 303 }
304 break; 304 break;
305 case BTRFS_DEV_REPLACE_KEY: 305 case BTRFS_DEV_REPLACE_KEY:
306 printk(KERN_INFO "\t\tdev replace\n"); 306 pr_info("\t\tdev replace\n");
307 break; 307 break;
308 case BTRFS_UUID_KEY_SUBVOL: 308 case BTRFS_UUID_KEY_SUBVOL:
309 case BTRFS_UUID_KEY_RECEIVED_SUBVOL: 309 case BTRFS_UUID_KEY_RECEIVED_SUBVOL:
@@ -334,7 +334,7 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
334 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr); 334 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
335 for (i = 0; i < nr; i++) { 335 for (i = 0; i < nr; i++) {
336 btrfs_node_key_to_cpu(c, &key, i); 336 btrfs_node_key_to_cpu(c, &key, i);
337 printk(KERN_INFO "\tkey %d (%llu %u %llu) block %llu\n", 337 pr_info("\tkey %d (%llu %u %llu) block %llu\n",
338 i, key.objectid, key.type, key.offset, 338 i, key.objectid, key.type, key.offset,
339 btrfs_node_blockptr(c, i)); 339 btrfs_node_blockptr(c, i));
340 } 340 }
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
index 9e1bdafbd44b..9e85300051cc 100644
--- a/fs/btrfs/reada.c
+++ b/fs/btrfs/reada.c
@@ -820,7 +820,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
820 820
821 spin_lock(&fs_info->reada_lock); 821 spin_lock(&fs_info->reada_lock);
822 list_for_each_entry(device, &fs_devices->devices, dev_list) { 822 list_for_each_entry(device, &fs_devices->devices, dev_list) {
823 printk(KERN_DEBUG "dev %lld has %d in flight\n", device->devid, 823 pr_debug("dev %lld has %d in flight\n", device->devid,
824 atomic_read(&device->reada_in_flight)); 824 atomic_read(&device->reada_in_flight));
825 index = 0; 825 index = 0;
826 while (1) { 826 while (1) {
@@ -829,17 +829,17 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
829 (void **)&zone, index, 1); 829 (void **)&zone, index, 1);
830 if (ret == 0) 830 if (ret == 0)
831 break; 831 break;
832 printk(KERN_DEBUG " zone %llu-%llu elems %llu locked %d devs", 832 pr_debug(" zone %llu-%llu elems %llu locked %d devs",
833 zone->start, zone->end, zone->elems, 833 zone->start, zone->end, zone->elems,
834 zone->locked); 834 zone->locked);
835 for (j = 0; j < zone->ndevs; ++j) { 835 for (j = 0; j < zone->ndevs; ++j) {
836 printk(KERN_CONT " %lld", 836 pr_cont(" %lld",
837 zone->devs[j]->devid); 837 zone->devs[j]->devid);
838 } 838 }
839 if (device->reada_curr_zone == zone) 839 if (device->reada_curr_zone == zone)
840 printk(KERN_CONT " curr off %llu", 840 pr_cont(" curr off %llu",
841 device->reada_next - zone->start); 841 device->reada_next - zone->start);
842 printk(KERN_CONT "\n"); 842 pr_cont("\n");
843 index = (zone->end >> PAGE_SHIFT) + 1; 843 index = (zone->end >> PAGE_SHIFT) + 1;
844 } 844 }
845 cnt = 0; 845 cnt = 0;
@@ -851,21 +851,20 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
851 (void **)&re, index, 1); 851 (void **)&re, index, 1);
852 if (ret == 0) 852 if (ret == 0)
853 break; 853 break;
854 printk(KERN_DEBUG 854 pr_debug(" re: logical %llu size %u empty %d scheduled %d",
855 " re: logical %llu size %u empty %d scheduled %d",
856 re->logical, fs_info->tree_root->nodesize, 855 re->logical, fs_info->tree_root->nodesize,
857 list_empty(&re->extctl), re->scheduled); 856 list_empty(&re->extctl), re->scheduled);
858 857
859 for (i = 0; i < re->nzones; ++i) { 858 for (i = 0; i < re->nzones; ++i) {
860 printk(KERN_CONT " zone %llu-%llu devs", 859 pr_cont(" zone %llu-%llu devs",
861 re->zones[i]->start, 860 re->zones[i]->start,
862 re->zones[i]->end); 861 re->zones[i]->end);
863 for (j = 0; j < re->zones[i]->ndevs; ++j) { 862 for (j = 0; j < re->zones[i]->ndevs; ++j) {
864 printk(KERN_CONT " %lld", 863 pr_cont(" %lld",
865 re->zones[i]->devs[j]->devid); 864 re->zones[i]->devs[j]->devid);
866 } 865 }
867 } 866 }
868 printk(KERN_CONT "\n"); 867 pr_cont("\n");
869 index = (re->logical >> PAGE_SHIFT) + 1; 868 index = (re->logical >> PAGE_SHIFT) + 1;
870 if (++cnt > 15) 869 if (++cnt > 15)
871 break; 870 break;
@@ -885,20 +884,19 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
885 index = (re->logical >> PAGE_SHIFT) + 1; 884 index = (re->logical >> PAGE_SHIFT) + 1;
886 continue; 885 continue;
887 } 886 }
888 printk(KERN_DEBUG 887 pr_debug("re: logical %llu size %u list empty %d scheduled %d",
889 "re: logical %llu size %u list empty %d scheduled %d",
890 re->logical, fs_info->tree_root->nodesize, 888 re->logical, fs_info->tree_root->nodesize,
891 list_empty(&re->extctl), re->scheduled); 889 list_empty(&re->extctl), re->scheduled);
892 for (i = 0; i < re->nzones; ++i) { 890 for (i = 0; i < re->nzones; ++i) {
893 printk(KERN_CONT " zone %llu-%llu devs", 891 pr_cont(" zone %llu-%llu devs",
894 re->zones[i]->start, 892 re->zones[i]->start,
895 re->zones[i]->end); 893 re->zones[i]->end);
896 for (j = 0; j < re->zones[i]->ndevs; ++j) { 894 for (j = 0; j < re->zones[i]->ndevs; ++j) {
897 printk(KERN_CONT " %lld", 895 pr_cont(" %lld",
898 re->zones[i]->devs[j]->devid); 896 re->zones[i]->devs[j]->devid);
899 } 897 }
900 } 898 }
901 printk(KERN_CONT "\n"); 899 pr_cont("\n");
902 index = (re->logical >> PAGE_SHIFT) + 1; 900 index = (re->logical >> PAGE_SHIFT) + 1;
903 } 901 }
904 spin_unlock(&fs_info->reada_lock); 902 spin_unlock(&fs_info->reada_lock);
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index cb45749df9c4..0128bc369292 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -151,12 +151,11 @@ void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function
151 vaf.fmt = fmt; 151 vaf.fmt = fmt;
152 vaf.va = &args; 152 vaf.va = &args;
153 153
154 printk(KERN_CRIT 154 pr_crit("BTRFS: error (device %s) in %s:%d: errno=%d %s (%pV)\n",
155 "BTRFS: error (device %s) in %s:%d: errno=%d %s (%pV)\n",
156 sb->s_id, function, line, errno, errstr, &vaf); 155 sb->s_id, function, line, errno, errstr, &vaf);
157 va_end(args); 156 va_end(args);
158 } else { 157 } else {
159 printk(KERN_CRIT "BTRFS: error (device %s) in %s:%d: errno=%d %s\n", 158 pr_crit("BTRFS: error (device %s) in %s:%d: errno=%d %s\n",
160 sb->s_id, function, line, errno, errstr); 159 sb->s_id, function, line, errno, errstr);
161 } 160 }
162#endif 161#endif
@@ -925,8 +924,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags,
925 } 924 }
926 break; 925 break;
927 case Opt_subvolrootid: 926 case Opt_subvolrootid:
928 printk(KERN_WARNING 927 pr_warn("BTRFS: 'subvolrootid' mount option is deprecated and has no effect\n");
929 "BTRFS: 'subvolrootid' mount option is deprecated and has no effect\n");
930 break; 928 break;
931 case Opt_device: 929 case Opt_device:
932 device_name = match_strdup(&args[0]); 930 device_name = match_strdup(&args[0]);
@@ -1150,7 +1148,7 @@ static int btrfs_fill_super(struct super_block *sb,
1150 sb->s_iflags |= SB_I_CGROUPWB; 1148 sb->s_iflags |= SB_I_CGROUPWB;
1151 err = open_ctree(sb, fs_devices, (char *)data); 1149 err = open_ctree(sb, fs_devices, (char *)data);
1152 if (err) { 1150 if (err) {
1153 printk(KERN_ERR "BTRFS: open_ctree failed\n"); 1151 pr_err("BTRFS: open_ctree failed\n");
1154 return err; 1152 return err;
1155 } 1153 }
1156 1154
@@ -2356,7 +2354,7 @@ static void btrfs_interface_exit(void)
2356 2354
2357static void btrfs_print_mod_info(void) 2355static void btrfs_print_mod_info(void)
2358{ 2356{
2359 printk(KERN_INFO "Btrfs loaded, crc32c=%s" 2357 pr_info("Btrfs loaded, crc32c=%s"
2360#ifdef CONFIG_BTRFS_DEBUG 2358#ifdef CONFIG_BTRFS_DEBUG
2361 ", debug=on" 2359 ", debug=on"
2362#endif 2360#endif
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index e5ab27ecbf90..1f157fba8940 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -77,7 +77,7 @@ static int can_modify_feature(struct btrfs_feature_attr *fa)
77 clear = BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR; 77 clear = BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR;
78 break; 78 break;
79 default: 79 default:
80 printk(KERN_WARNING "btrfs: sysfs: unknown feature set %d\n", 80 pr_warn("btrfs: sysfs: unknown feature set %d\n",
81 fa->feature_set); 81 fa->feature_set);
82 return 0; 82 return 0;
83 } 83 }
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index a80b9a09474d..69f7d4ccaf35 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -65,7 +65,7 @@ void btrfs_put_transaction(struct btrfs_transaction *transaction)
65 BUG_ON(!list_empty(&transaction->list)); 65 BUG_ON(!list_empty(&transaction->list));
66 WARN_ON(!RB_EMPTY_ROOT(&transaction->delayed_refs.href_root)); 66 WARN_ON(!RB_EMPTY_ROOT(&transaction->delayed_refs.href_root));
67 if (transaction->delayed_refs.pending_csums) 67 if (transaction->delayed_refs.pending_csums)
68 printk(KERN_ERR "pending csums is %llu\n", 68 pr_err("pending csums is %llu\n",
69 transaction->delayed_refs.pending_csums); 69 transaction->delayed_refs.pending_csums);
70 while (!list_empty(&transaction->pending_chunks)) { 70 while (!list_empty(&transaction->pending_chunks)) {
71 struct extent_map *em; 71 struct extent_map *em;
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3fd983dd722f..eeb6733eb9f5 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1140,12 +1140,12 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
1140 ret = device_list_add(path, disk_super, devid, fs_devices_ret); 1140 ret = device_list_add(path, disk_super, devid, fs_devices_ret);
1141 if (ret > 0) { 1141 if (ret > 0) {
1142 if (disk_super->label[0]) { 1142 if (disk_super->label[0]) {
1143 printk(KERN_INFO "BTRFS: device label %s ", disk_super->label); 1143 pr_info("BTRFS: device label %s ", disk_super->label);
1144 } else { 1144 } else {
1145 printk(KERN_INFO "BTRFS: device fsid %pU ", disk_super->fsid); 1145 pr_info("BTRFS: device fsid %pU ", disk_super->fsid);
1146 } 1146 }
1147 1147
1148 printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path); 1148 pr_cont("devid %llu transid %llu %s\n", devid, transid, path);
1149 ret = 0; 1149 ret = 0;
1150 } 1150 }
1151 if (!ret && fs_devices_ret) 1151 if (!ret && fs_devices_ret)
@@ -5907,13 +5907,13 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
5907 read_unlock(&em_tree->lock); 5907 read_unlock(&em_tree->lock);
5908 5908
5909 if (!em) { 5909 if (!em) {
5910 printk(KERN_ERR "BTRFS: couldn't find em for chunk %Lu\n", 5910 pr_err("BTRFS: couldn't find em for chunk %Lu\n",
5911 chunk_start); 5911 chunk_start);
5912 return -EIO; 5912 return -EIO;
5913 } 5913 }
5914 5914
5915 if (em->start != chunk_start) { 5915 if (em->start != chunk_start) {
5916 printk(KERN_ERR "BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n", 5916 pr_err("BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n",
5917 em->start, chunk_start); 5917 em->start, chunk_start);
5918 free_extent_map(em); 5918 free_extent_map(em);
5919 return -EIO; 5919 return -EIO;
@@ -6715,8 +6715,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6715 6715
6716 num_stripes = btrfs_chunk_num_stripes(sb, chunk); 6716 num_stripes = btrfs_chunk_num_stripes(sb, chunk);
6717 if (!num_stripes) { 6717 if (!num_stripes) {
6718 printk(KERN_ERR 6718 pr_err("BTRFS: invalid number of stripes %u in sys_array at offset %u\n",
6719 "BTRFS: invalid number of stripes %u in sys_array at offset %u\n",
6720 num_stripes, cur_offset); 6719 num_stripes, cur_offset);
6721 ret = -EIO; 6720 ret = -EIO;
6722 break; 6721 break;
@@ -6739,8 +6738,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6739 if (ret) 6738 if (ret)
6740 break; 6739 break;
6741 } else { 6740 } else {
6742 printk(KERN_ERR 6741 pr_err("BTRFS: unexpected item type %u in sys_array at offset %u\n",
6743 "BTRFS: unexpected item type %u in sys_array at offset %u\n",
6744 (u32)key.type, cur_offset); 6742 (u32)key.type, cur_offset);
6745 ret = -EIO; 6743 ret = -EIO;
6746 break; 6744 break;
@@ -6754,7 +6752,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6754 return ret; 6752 return ret;
6755 6753
6756out_short_read: 6754out_short_read:
6757 printk(KERN_ERR "BTRFS: sys_array too short to read %u bytes at offset %u\n", 6755 pr_err("BTRFS: sys_array too short to read %u bytes at offset %u\n",
6758 len, cur_offset); 6756 len, cur_offset);
6759 clear_extent_buffer_uptodate(sb); 6757 clear_extent_buffer_uptodate(sb);
6760 free_extent_buffer_stale(sb); 6758 free_extent_buffer_stale(sb);
diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
index 88d274e8ecf2..441b81a3e545 100644
--- a/fs/btrfs/zlib.c
+++ b/fs/btrfs/zlib.c
@@ -95,7 +95,7 @@ static int zlib_compress_pages(struct list_head *ws,
95 *total_in = 0; 95 *total_in = 0;
96 96
97 if (Z_OK != zlib_deflateInit(&workspace->strm, 3)) { 97 if (Z_OK != zlib_deflateInit(&workspace->strm, 3)) {
98 printk(KERN_WARNING "BTRFS: deflateInit failed\n"); 98 pr_warn("BTRFS: deflateInit failed\n");
99 ret = -EIO; 99 ret = -EIO;
100 goto out; 100 goto out;
101 } 101 }
@@ -123,7 +123,7 @@ static int zlib_compress_pages(struct list_head *ws,
123 while (workspace->strm.total_in < len) { 123 while (workspace->strm.total_in < len) {
124 ret = zlib_deflate(&workspace->strm, Z_SYNC_FLUSH); 124 ret = zlib_deflate(&workspace->strm, Z_SYNC_FLUSH);
125 if (ret != Z_OK) { 125 if (ret != Z_OK) {
126 printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n", 126 pr_debug("BTRFS: deflate in loop returned %d\n",
127 ret); 127 ret);
128 zlib_deflateEnd(&workspace->strm); 128 zlib_deflateEnd(&workspace->strm);
129 ret = -EIO; 129 ret = -EIO;
@@ -249,7 +249,7 @@ static int zlib_decompress_biovec(struct list_head *ws, struct page **pages_in,
249 } 249 }
250 250
251 if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) { 251 if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
252 printk(KERN_WARNING "BTRFS: inflateInit failed\n"); 252 pr_warn("BTRFS: inflateInit failed\n");
253 return -EIO; 253 return -EIO;
254 } 254 }
255 while (workspace->strm.total_in < srclen) { 255 while (workspace->strm.total_in < srclen) {
@@ -339,7 +339,7 @@ static int zlib_decompress(struct list_head *ws, unsigned char *data_in,
339 } 339 }
340 340
341 if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) { 341 if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
342 printk(KERN_WARNING "BTRFS: inflateInit failed\n"); 342 pr_warn("BTRFS: inflateInit failed\n");
343 return -EIO; 343 return -EIO;
344 } 344 }
345 345