Skip to contentSkip to conversation

btrfs: Convert printk() to pr_<level>

PATCH New Joe Perches 1 participant 1 message Jul 10, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: Convert printk() to pr_<level>

Use more a current logging style by converting
printks to pr_<level>.

All pr_<level> messages are now prefixed with "btrfs: " or "btrfsic: " instead of a mixture of "BTRFS", "btrfs:" "btrfsic: " and no prefix at all. If dmesg log scrapers were used, these may need rewrite.

Add #define pr_fmt(fmt) as necessary.
Add "btrfsic: " to check-integrity, KBUILD_MODNAME otherwise. Remove unnecessary OOM messages after k.allocs. (There are other OOM messages after internal functions) Fix a couple of typos and add a couple missing newlines. Remove embedded prefixes.
Coalesce formats, align multiline arguments.

---
 fs/btrfs/check-integrity.c  | 998 +++++++++++++++++++-------------------------
 fs/btrfs/compression.c      |  12 +-
 fs/btrfs/ctree.c            |  22 +-
 fs/btrfs/ctree.h            |   3 +-
 fs/btrfs/delayed-inode.c    |  26 +-
 fs/btrfs/dev-replace.c      |  26 +-
 fs/btrfs/dir-item.c         |  13 +-
 fs/btrfs/disk-io.c          | 137 +++---
 fs/btrfs/extent-tree.c      |  46 +-
 fs/btrfs/extent_io.c        |  32 +-
 fs/btrfs/file-item.c        |  11 +-
 fs/btrfs/free-space-cache.c |  32 +-
 fs/btrfs/inode.c            |   9 +-
 fs/btrfs/ioctl.c            |  37 +-
 fs/btrfs/lzo.c              |   8 +-
 fs/btrfs/ordered-data.c     |  20 +-
 fs/btrfs/print-tree.c       | 178 ++++----
 fs/btrfs/qgroup.c           |  32 +-
 fs/btrfs/reada.c            |  26 +-
 fs/btrfs/relocation.c       |  10 +-
 fs/btrfs/root-tree.c        |  15 +-
 fs/btrfs/scrub.c            |  26 +-
 fs/btrfs/send.c             |  11 +-
 fs/btrfs/super.c            |  94 ++---
 fs/btrfs/transaction.c      |   5 +-
 fs/btrfs/volumes.c          |  56 ++-
 fs/btrfs/zlib.c             |   8 +-
 27 files changed, 854 insertions(+), 1039 deletions(-)
fs/btrfs/check-integrity.c +431 -567
index 1431a69..95ca66f 100644
@@ -79,6 +79,8 @@
  * include and compile the integrity check tool.
  */
 
+#define pr_fmt(fmt) "btrfsic: " fmt
+
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/buffer_head.h>
@@ -658,10 +660,8 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 
 	BUG_ON(NULL == state);
 	selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS);
-	if (NULL == selected_super) {
-		printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
+	if (NULL == selected_super)
 		return -1;
-	}
 
 	list_for_each_entry(device, dev_head, dev_list) {
 		int i;
@@ -684,7 +684,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 	}
 
 	if (NULL == state->latest_superblock) {
-		printk(KERN_INFO "btrfsic: no superblock found!\n");
+		pr_info("no superblock found!\n");
 		kfree(selected_super);
 		return -1;
 	}
@@ -701,15 +701,15 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 			next_bytenr = btrfs_super_root(selected_super);
 			if (state->print_mask &
 			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
-				printk(KERN_INFO "root@%llu\n",
-				       (unsigned long long)next_bytenr);
+				pr_info("root@%llu\n",
+					(unsigned long long)next_bytenr);
 			break;
 		case 1:
 			next_bytenr = btrfs_super_chunk_root(selected_super);
 			if (state->print_mask &
 			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
-				printk(KERN_INFO "chunk@%llu\n",
-				       (unsigned long long)next_bytenr);
+				pr_info("chunk@%llu\n",
+					(unsigned long long)next_bytenr);
 			break;
 		case 2:
 			next_bytenr = btrfs_super_log_root(selected_super);
@@ -717,8 +717,8 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 				continue;
 			if (state->print_mask &
 			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
-				printk(KERN_INFO "log@%llu\n",
-				       (unsigned long long)next_bytenr);
+				pr_info("log@%llu\n",
+					(unsigned long long)next_bytenr);
 			break;
 		}
 
@@ -726,8 +726,8 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 		    btrfs_num_copies(state->root->fs_info,
 				     next_bytenr, state->metablock_size);
 		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
-			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
-			       (unsigned long long)next_bytenr, num_copies);
+			pr_info("num_copies(log_bytenr=%llu) = %d\n",
+				(unsigned long long)next_bytenr, num_copies);
 
 		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 			struct btrfsic_block *next_block;
@@ -739,11 +739,9 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 						&tmp_next_block_ctx,
 						mirror_num);
 			if (ret) {
-				printk(KERN_INFO "btrfsic:"
-				       " btrfsic_map_block(root @%llu,"
-				       " mirror %d) failed!\n",
-				       (unsigned long long)next_bytenr,
-				       mirror_num);
+				pr_info("btrfsic_map_block(root @%llu, mirror %d) failed!\n",
+					(unsigned long long)next_bytenr,
+					mirror_num);
 				kfree(selected_super);
 				return -1;
 			}
@@ -765,10 +763,9 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 
 			ret = btrfsic_read_block(state, &tmp_next_block_ctx);
 			if (ret < (int)PAGE_CACHE_SIZE) {
-				printk(KERN_INFO
-				       "btrfsic: read @logical %llu failed!\n",
-				       (unsigned long long)
-				       tmp_next_block_ctx.start);
+				pr_info("read @logical %llu failed!\n",
+					(unsigned long long)
+					tmp_next_block_ctx.start);
 				btrfsic_release_block_ctx(&tmp_next_block_ctx);
 				kfree(selected_super);
 				return -1;
@@ -829,7 +826,7 @@ static int btrfsic_process_superblock_dev_mirror(
 	if (NULL == superblock_tmp) {
 		superblock_tmp = btrfsic_block_alloc();
 		if (NULL == superblock_tmp) {
-			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
+			pr_info("error, kmalloc failed!\n");
 			brelse(bh);
 			return -1;
 		}
@@ -905,8 +902,8 @@ static int btrfsic_process_superblock_dev_mirror(
 		    btrfs_num_copies(state->root->fs_info,
 				     next_bytenr, state->metablock_size);
 		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
-			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
-			       (unsigned long long)next_bytenr, num_copies);
+			pr_info("num_copies(log_bytenr=%llu) = %d\n",
+				(unsigned long long)next_bytenr, num_copies);
 		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 			struct btrfsic_block *next_block;
 			struct btrfsic_block_data_ctx tmp_next_block_ctx;
@@ -916,10 +913,9 @@ static int btrfsic_process_superblock_dev_mirror(
 					      state->metablock_size,
 					      &tmp_next_block_ctx,
 					      mirror_num)) {
-				printk(KERN_INFO "btrfsic: btrfsic_map_block("
-				       "bytenr @%llu, mirror %d) failed!\n",
-				       (unsigned long long)next_bytenr,
-				       mirror_num);
+				pr_info("btrfsic_map_block(bytenr @%llu, mirror %d) failed!\n",
+					(unsigned long long)next_bytenr,
+					mirror_num);
 				brelse(bh);
 				return -1;
 			}
@@ -959,9 +955,7 @@ static struct btrfsic_stack_frame *btrfsic_stack_frame_alloc(void)
 	struct btrfsic_stack_frame *sf;
 
 	sf = kzalloc(sizeof(*sf), GFP_NOFS);
-	if (NULL == sf)
-		printk(KERN_INFO "btrfsic: alloc memory failed!\n");
-	else
+	if (sf)
 		sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER;
 	return sf;
 }
@@ -1006,16 +1000,14 @@ continue_with_new_stack_frame:
 			sf->nr = le32_to_cpu(leafhdr->header.nritems);
 
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO
-				       "leaf %llu items %d generation %llu"
-				       " owner %llu\n",
-				       (unsigned long long)
-				       sf->block_ctx->start,
-				       sf->nr,
-				       (unsigned long long)
-				       le64_to_cpu(leafhdr->header.generation),
-				       (unsigned long long)
-				       le64_to_cpu(leafhdr->header.owner));
+				pr_info("leaf %llu items %d generation %llu owner %llu\n",
+					(unsigned long long)
+					sf->block_ctx->start,
+					sf->nr,
+					(unsigned long long)
+					le64_to_cpu(leafhdr->header.generation),
+					(unsigned long long)
+					le64_to_cpu(leafhdr->header.owner));
 		}
 
 continue_with_current_leaf_stack_frame:
@@ -1037,10 +1029,9 @@ continue_with_current_leaf_stack_frame:
 			if (disk_item_offset + sizeof(struct btrfs_item) >
 			    sf->block_ctx->len) {
 leaf_item_out_of_bounce_error:
-				printk(KERN_INFO
-				       "btrfsic: leaf item out of bounce at logical %llu, dev %s\n",
-				       sf->block_ctx->start,
-				       sf->block_ctx->dev->name);
+				pr_info("leaf item out of bounce at logical %llu, dev %s\n",
+					sf->block_ctx->start,
+					sf->block_ctx->dev->name);
 				goto one_stack_frame_backwards;
 			}
 			btrfsic_read_from_block_data(sf->block_ctx,
@@ -1133,15 +1124,14 @@ leaf_item_out_of_bounce_error:
 			sf->nr = le32_to_cpu(nodehdr->header.nritems);
 
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO "node %llu level %d items %d"
-				       " generation %llu owner %llu\n",
-				       (unsigned long long)
-				       sf->block_ctx->start,
-				       nodehdr->header.level, sf->nr,
-				       (unsigned long long)
-				       le64_to_cpu(nodehdr->header.generation),
-				       (unsigned long long)
-				       le64_to_cpu(nodehdr->header.owner));
+				pr_info("node %llu level %d items %d generation %llu owner %llu\n",
+					(unsigned long long)
+					sf->block_ctx->start,
+					nodehdr->header.level, sf->nr,
+					(unsigned long long)
+					le64_to_cpu(nodehdr->header.generation),
+					(unsigned long long)
+					le64_to_cpu(nodehdr->header.owner));
 		}
 
 continue_with_current_node_stack_frame:
@@ -1159,10 +1149,9 @@ continue_with_current_node_stack_frame:
 					  (uintptr_t)nodehdr;
 			if (key_ptr_offset + sizeof(struct btrfs_key_ptr) >
 			    sf->block_ctx->len) {
-				printk(KERN_INFO
-				       "btrfsic: node item out of bounce at logical %llu, dev %s\n",
-				       sf->block_ctx->start,
-				       sf->block_ctx->dev->name);
+				pr_info("node item out of bounce at logical %llu, dev %s\n",
+					sf->block_ctx->start,
+					sf->block_ctx->dev->name);
 				goto one_stack_frame_backwards;
 			}
 			btrfsic_read_from_block_data(
@@ -1289,8 +1278,8 @@ static int btrfsic_create_link_to_next_block(
 		    btrfs_num_copies(state->root->fs_info,
 				     next_bytenr, state->metablock_size);
 		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
-			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
-			       (unsigned long long)next_bytenr, *num_copiesp);
+			pr_info("num_copies(log_bytenr=%llu) = %d\n",
+				(unsigned long long)next_bytenr, *num_copiesp);
 		*mirror_nump = 1;
 	}
 
@@ -1298,16 +1287,14 @@ static int btrfsic_create_link_to_next_block(
 		return 0;
 
 	if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-		printk(KERN_INFO
-		       "btrfsic_create_link_to_next_block(mirror_num=%d)\n",
-		       *mirror_nump);
+		pr_info("btrfsic_create_link_to_next_block(mirror_num=%d)\n",
+			*mirror_nump);
 	ret = btrfsic_map_block(state, next_bytenr,
 				state->metablock_size,
 				next_block_ctx, *mirror_nump);
 	if (ret) {
-		printk(KERN_INFO
-		       "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
-		       (unsigned long long)next_bytenr, *mirror_nump);
+		pr_info("btrfsic_map_block(@%llu, mirror=%d) failed!\n",
+			(unsigned long long)next_bytenr, *mirror_nump);
 		btrfsic_release_block_ctx(next_block_ctx);
 		*next_blockp = NULL;
 		return -1;
@@ -1331,25 +1318,20 @@ static int btrfsic_create_link_to_next_block(
 		if (next_block->logical_bytenr != next_bytenr &&
 		    !(!next_block->is_metadata &&
 		      0 == next_block->logical_bytenr)) {
-			printk(KERN_INFO
-			       "Referenced block @%llu (%s/%llu/%d)"
-			       " found in hash table, %c,"
-			       " bytenr mismatch (!= stored %llu).\n",
-			       (unsigned long long)next_bytenr,
-			       next_block_ctx->dev->name,
-			       (unsigned long long)next_block_ctx->dev_bytenr,
-			       *mirror_nump,
-			       btrfsic_get_block_type(state, next_block),
-			       (unsigned long long)next_block->logical_bytenr);
+			pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu)\n",
+				(unsigned long long)next_bytenr,
+				next_block_ctx->dev->name,
+				(unsigned long long)next_block_ctx->dev_bytenr,
+				*mirror_nump,
+				btrfsic_get_block_type(state, next_block),
+				(unsigned long long)next_block->logical_bytenr);
 		} else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "Referenced block @%llu (%s/%llu/%d)"
-			       " found in hash table, %c.\n",
-			       (unsigned long long)next_bytenr,
-			       next_block_ctx->dev->name,
-			       (unsigned long long)next_block_ctx->dev_bytenr,
-			       *mirror_nump,
-			       btrfsic_get_block_type(state, next_block));
+			pr_info("Referenced lock @%llu (%s/%llu/%d) found in hash table, %c\n",
+				(unsigned long long)next_bytenr,
+				next_block_ctx->dev->name,
+				(unsigned long long)next_block_ctx->dev_bytenr,
+				*mirror_nump,
+				btrfsic_get_block_type(state, next_block));
 		next_block->logical_bytenr = next_bytenr;
 
 		next_block->mirror_num = *mirror_nump;
@@ -1365,7 +1347,7 @@ static int btrfsic_create_link_to_next_block(
 	if (NULL == l) {
 		l = btrfsic_block_link_alloc();
 		if (NULL == l) {
-			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
+			pr_info("error, kmalloc failed!\n");
 			btrfsic_release_block_ctx(next_block_ctx);
 			*next_blockp = NULL;
 			return -1;
@@ -1398,9 +1380,8 @@ static int btrfsic_create_link_to_next_block(
 	if (limit_nesting > 0 && did_alloc_block_link) {
 		ret = btrfsic_read_block(state, next_block_ctx);
 		if (ret < (int)next_block_ctx->len) {
-			printk(KERN_INFO
-			       "btrfsic: read block @logical %llu failed!\n",
-			       (unsigned long long)next_bytenr);
+			pr_info("read block @logical %llu failed!\n",
+				(unsigned long long)next_bytenr);
 			btrfsic_release_block_ctx(next_block_ctx);
 			*next_blockp = NULL;
 			return -1;
@@ -1434,9 +1415,8 @@ static int btrfsic_handle_extent_data(
 	if (file_extent_item_offset +
 	    offsetof(struct btrfs_file_extent_item, disk_num_bytes) >
 	    block_ctx->len) {
-		printk(KERN_INFO
-		       "btrfsic: file item out of bounce at logical %llu, dev %s\n",
-		       block_ctx->start, block_ctx->dev->name);
+		pr_info("file item out of bounce at logical %llu, dev %s\n",
+			block_ctx->start, block_ctx->dev->name);
 		return -1;
 	}
 
@@ -1446,18 +1426,17 @@ static int btrfsic_handle_extent_data(
 	if (BTRFS_FILE_EXTENT_REG != file_extent_item.type ||
 	    ((u64)0) == le64_to_cpu(file_extent_item.disk_bytenr)) {
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
-			printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu\n",
-			       file_extent_item.type,
-			       (unsigned long long)
-			       le64_to_cpu(file_extent_item.disk_bytenr));
+			pr_info("extent_data: type %u, disk_bytenr = %llu\n",
+				file_extent_item.type,
+				(unsigned long long)
+				le64_to_cpu(file_extent_item.disk_bytenr));
 		return 0;
 	}
 
 	if (file_extent_item_offset + sizeof(struct btrfs_file_extent_item) >
 	    block_ctx->len) {
-		printk(KERN_INFO
-		       "btrfsic: file item out of bounce at logical %llu, dev %s\n",
-		       block_ctx->start, block_ctx->dev->name);
+		pr_info("file item out of bounce at logical %llu, dev %s\n",
+			block_ctx->start, block_ctx->dev->name);
 		return -1;
 	}
 	btrfsic_read_from_block_data(block_ctx, &file_extent_item,
@@ -1470,13 +1449,12 @@ static int btrfsic_handle_extent_data(
 	generation = le64_to_cpu(file_extent_item.generation);
 
 	if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
-		printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu,"
-		       " offset = %llu, num_bytes = %llu\n",
-		       file_extent_item.type,
-		       (unsigned long long)
-		       le64_to_cpu(file_extent_item.disk_bytenr),
-		       (unsigned long long)le64_to_cpu(file_extent_item.offset),
-		       (unsigned long long)num_bytes);
+		pr_info("extent_data: type %u, disk_bytenr = %llu, offset = %llu, num_bytes = %llu\n",
+			file_extent_item.type,
+			(unsigned long long)
+			le64_to_cpu(file_extent_item.disk_bytenr),
+			(unsigned long long)le64_to_cpu(file_extent_item.offset),
+			(unsigned long long)num_bytes);
 	while (num_bytes > 0) {
 		u32 chunk_len;
 		int num_copies;
@@ -1491,30 +1469,27 @@ static int btrfsic_handle_extent_data(
 		    btrfs_num_copies(state->root->fs_info,
 				     next_bytenr, state->datablock_size);
 		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
-			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
-			       (unsigned long long)next_bytenr, num_copies);
+			pr_info("num_copies(log_bytenr=%llu) = %d\n",
+				(unsigned long long)next_bytenr, num_copies);
 		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 			struct btrfsic_block_data_ctx next_block_ctx;
 			struct btrfsic_block *next_block;
 			int block_was_created;
 
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO "btrfsic_handle_extent_data("
-				       "mirror_num=%d)\n", mirror_num);
+				pr_info("%s(mirror_num=%d)\n",
+					__func__, mirror_num);
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
-				printk(KERN_INFO
-				       "\tdisk_bytenr = %llu, num_bytes %u\n",
-				       (unsigned long long)next_bytenr,
-				       chunk_len);
+				pr_info("\tdisk_bytenr = %llu, num_bytes %u\n",
+					(unsigned long long)next_bytenr,
+					chunk_len);
 			ret = btrfsic_map_block(state, next_bytenr,
 						chunk_len, &next_block_ctx,
 						mirror_num);
 			if (ret) {
-				printk(KERN_INFO
-				       "btrfsic: btrfsic_map_block(@%llu,"
-				       " mirror=%d) failed!\n",
-				       (unsigned long long)next_bytenr,
-				       mirror_num);
+				pr_info("btrfsic_map_block(@%llu, mirror=%d) failed!\n",
+					(unsigned long long)next_bytenr,
+					mirror_num);
 				return -1;
 			}
 
@@ -1528,8 +1503,7 @@ static int btrfsic_handle_extent_data(
 					mirror_num,
 					&block_was_created);
 			if (NULL == next_block) {
-				printk(KERN_INFO
-				       "btrfsic: error, kmalloc failed!\n");
+				pr_info("error, kmalloc failed!\n");
 				btrfsic_release_block_ctx(&next_block_ctx);
 				return -1;
 			}
@@ -1537,19 +1511,14 @@ static int btrfsic_handle_extent_data(
 				if (next_block->logical_bytenr != next_bytenr &&
 				    !(!next_block->is_metadata &&
 				      0 == next_block->logical_bytenr)) {
-					printk(KERN_INFO
-					       "Referenced block"
-					       " @%llu (%s/%llu/%d)"
-					       " found in hash table, D,"
-					       " bytenr mismatch"
-					       " (!= stored %llu).\n",
-					       (unsigned long long)next_bytenr,
-					       next_block_ctx.dev->name,
-					       (unsigned long long)
-					       next_block_ctx.dev_bytenr,
-					       mirror_num,
-					       (unsigned long long)
-					       next_block->logical_bytenr);
+					pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, D, bytenr mismatch (!= stored %llu)\n",
+						(unsigned long long)next_bytenr,
+						next_block_ctx.dev->name,
+						(unsigned long long)
+						next_block_ctx.dev_bytenr,
+						mirror_num,
+						(unsigned long long)
+						next_block->logical_bytenr);
 				}
 				next_block->logical_bytenr = next_bytenr;
 				next_block->mirror_num = mirror_num;
@@ -1608,7 +1577,7 @@ static int btrfsic_map_block(struct btrfsic_state *state, u64 bytenr, u32 len,
 	kfree(multi);
 	if (NULL == block_ctx_out->dev) {
 		ret = -ENXIO;
-		printk(KERN_INFO "btrfsic: error, cannot lookup dev (#1)!\n");
+		pr_info("error, cannot lookup dev (#1)!\n");
 	}
 
 	return ret;
@@ -1628,7 +1597,7 @@ static int btrfsic_map_superblock(struct btrfsic_state *state, u64 bytenr,
 	if (NULL != block_ctx_out->dev) {
 		return 0;
 	} else {
-		printk(KERN_INFO "btrfsic: error, cannot lookup dev (#2)!\n");
+		pr_info("error, cannot lookup dev (#2)!\n");
 		return -ENXIO;
 	}
 }
@@ -1673,9 +1642,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 	BUG_ON(block_ctx->pagev);
 	BUG_ON(block_ctx->mem_to_free);
 	if (block_ctx->dev_bytenr & ((u64)PAGE_CACHE_SIZE - 1)) {
-		printk(KERN_INFO
-		       "btrfsic: read_block() with unaligned bytenr %llu\n",
-		       (unsigned long long)block_ctx->dev_bytenr);
+		pr_info("read_block() with unaligned bytenr %llu\n",
+			(unsigned long long)block_ctx->dev_bytenr);
 		return -1;
 	}
 
@@ -1702,9 +1670,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 
 		bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i);
 		if (!bio) {
-			printk(KERN_INFO
-			       "btrfsic: bio_alloc() for %u pages failed!\n",
-			       num_pages - i);
+			pr_info("bio_alloc() for %u pages failed!\n",
+				num_pages - i);
 			return -1;
 		}
 		bio->bi_bdev = block_ctx->dev->bdev;
@@ -1719,8 +1686,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 				break;
 		}
 		if (j == i) {
-			printk(KERN_INFO
-			       "btrfsic: error, failed to add a single page!\n");
+			pr_info("error, failed to add a single page!\n");
 			return -1;
 		}
 		submit_bio(READ, bio);
@@ -1729,9 +1695,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 		wait_for_completion(&complete);
 
 		if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
-			printk(KERN_INFO
-			       "btrfsic: read error at logical %llu dev %s!\n",
-			       block_ctx->start, block_ctx->dev->name);
+			pr_info("read error at logical %llu dev %s!\n",
+				block_ctx->start, block_ctx->dev->name);
 			bio_put(bio);
 			return -1;
 		}
@@ -1742,8 +1707,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 	for (i = 0; i < num_pages; i++) {
 		block_ctx->datav[i] = kmap(block_ctx->pagev[i]);
 		if (!block_ctx->datav[i]) {
-			printk(KERN_INFO "btrfsic: kmap() failed (dev %s)!\n",
-			       block_ctx->dev->name);
+			pr_info("kmap() failed (dev %s)!\n",
+				block_ctx->dev->name);
 			return -1;
 		}
 	}
@@ -1762,7 +1727,7 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
 
 	BUG_ON(NULL == state);
 
-	printk(KERN_INFO "all_blocks_list:\n");
+	pr_info("all_blocks_list:\n");
 	list_for_each(elem_all, &state->all_blocks_list) {
 		const struct btrfsic_block *const b_all =
 		    list_entry(elem_all, struct btrfsic_block,
@@ -1770,12 +1735,12 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
 		struct list_head *elem_ref_to;
 		struct list_head *elem_ref_from;
 
-		printk(KERN_INFO "%c-block @%llu (%s/%llu/%d)\n",
-		       btrfsic_get_block_type(state, b_all),
-		       (unsigned long long)b_all->logical_bytenr,
-		       b_all->dev_state->name,
-		       (unsigned long long)b_all->dev_bytenr,
-		       b_all->mirror_num);
+		pr_info("%c-block @%llu (%s/%llu/%d)\n",
+			btrfsic_get_block_type(state, b_all),
+			(unsigned long long)b_all->logical_bytenr,
+			b_all->dev_state->name,
+			(unsigned long long)b_all->dev_bytenr,
+			b_all->mirror_num);
 
 		list_for_each(elem_ref_to, &b_all->ref_to_list) {
 			const struct btrfsic_block_link *const l =
@@ -1783,21 +1748,19 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
 				       struct btrfsic_block_link,
 				       node_ref_to);
 
-			printk(KERN_INFO " %c @%llu (%s/%llu/%d)"
-			       " refers %u* to"
-			       " %c @%llu (%s/%llu/%d)\n",
-			       btrfsic_get_block_type(state, b_all),
-			       (unsigned long long)b_all->logical_bytenr,
-			       b_all->dev_state->name,
-			       (unsigned long long)b_all->dev_bytenr,
-			       b_all->mirror_num,
-			       l->ref_cnt,
-			       btrfsic_get_block_type(state, l->block_ref_to),
-			       (unsigned long long)
-			       l->block_ref_to->logical_bytenr,
-			       l->block_ref_to->dev_state->name,
-			       (unsigned long long)l->block_ref_to->dev_bytenr,
-			       l->block_ref_to->mirror_num);
+			pr_info(" %c @%llu (%s/%llu/%d) refers %u* to %c @%llu (%s/%llu/%d)\n",
+				btrfsic_get_block_type(state, b_all),
+				(unsigned long long)b_all->logical_bytenr,
+				b_all->dev_state->name,
+				(unsigned long long)b_all->dev_bytenr,
+				b_all->mirror_num,
+				l->ref_cnt,
+				btrfsic_get_block_type(state, l->block_ref_to),
+				(unsigned long long)
+				l->block_ref_to->logical_bytenr,
+				l->block_ref_to->dev_state->name,
+				(unsigned long long)l->block_ref_to->dev_bytenr,
+				l->block_ref_to->mirror_num);
 		}
 
 		list_for_each(elem_ref_from, &b_all->ref_from_list) {
@@ -1806,25 +1769,23 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
 				       struct btrfsic_block_link,
 				       node_ref_from);
 
-			printk(KERN_INFO " %c @%llu (%s/%llu/%d)"
-			       " is ref %u* from"
-			       " %c @%llu (%s/%llu/%d)\n",
-			       btrfsic_get_block_type(state, b_all),
-			       (unsigned long long)b_all->logical_bytenr,
-			       b_all->dev_state->name,
-			       (unsigned long long)b_all->dev_bytenr,
-			       b_all->mirror_num,
-			       l->ref_cnt,
-			       btrfsic_get_block_type(state, l->block_ref_from),
-			       (unsigned long long)
-			       l->block_ref_from->logical_bytenr,
-			       l->block_ref_from->dev_state->name,
-			       (unsigned long long)
-			       l->block_ref_from->dev_bytenr,
-			       l->block_ref_from->mirror_num);
+			pr_info(" %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
+				btrfsic_get_block_type(state, b_all),
+				(unsigned long long)b_all->logical_bytenr,
+				b_all->dev_state->name,
+				(unsigned long long)b_all->dev_bytenr,
+				b_all->mirror_num,
+				l->ref_cnt,
+				btrfsic_get_block_type(state, l->block_ref_from),
+				(unsigned long long)
+				l->block_ref_from->logical_bytenr,
+				l->block_ref_from->dev_state->name,
+				(unsigned long long)
+				l->block_ref_from->dev_bytenr,
+				l->block_ref_from->mirror_num);
 		}
 
-		printk(KERN_INFO "\n");
+		pr_info("\n");
 	}
 }
 
@@ -1900,8 +1861,7 @@ again:
 					      mapped_datav[0])->bytenr);
 			if (num_pages * PAGE_CACHE_SIZE <
 			    BTRFS_SUPER_INFO_SIZE) {
-				printk(KERN_INFO
-				       "btrfsic: cannot work with too short bios!\n");
+				pr_info("cannot work with too short bios!\n");
 				return;
 			}
 			is_metadata = 1;
@@ -1909,8 +1869,7 @@ again:
 			processed_len = BTRFS_SUPER_INFO_SIZE;
 			if (state->print_mask &
 			    BTRFSIC_PRINT_MASK_TREE_BEFORE_SB_WRITE) {
-				printk(KERN_INFO
-				       "[before new superblock is written]:\n");
+				pr_info("[before new superblock is written]:\n");
 				btrfsic_dump_tree_sub(state, block, 0);
 			}
 		}
@@ -1918,8 +1877,7 @@ again:
 			if (!block->is_superblock) {
 				if (num_pages * PAGE_CACHE_SIZE <
 				    state->metablock_size) {
-					printk(KERN_INFO
-					       "btrfsic: cannot work with too short bios!\n");
+					pr_info("cannot work with too short bios!\n");
 					return;
 				}
 				processed_len = state->metablock_size;
@@ -1930,93 +1888,76 @@ again:
 							       dev_bytenr);
 			}
 			if (block->logical_bytenr != bytenr) {
-				printk(KERN_INFO
-				       "Written block @%llu (%s/%llu/%d)"
-				       " found in hash table, %c,"
-				       " bytenr mismatch"
-				       " (!= stored %llu).\n",
-				       (unsigned long long)bytenr,
-				       dev_state->name,
-				       (unsigned long long)dev_bytenr,
-				       block->mirror_num,
-				       btrfsic_get_block_type(state, block),
-				       (unsigned long long)
-				       block->logical_bytenr);
+				pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu)\n",
+					(unsigned long long)bytenr,
+					dev_state->name,
+					(unsigned long long)dev_bytenr,
+					block->mirror_num,
+					btrfsic_get_block_type(state, block),
+					(unsigned long long)
+					block->logical_bytenr);
 				block->logical_bytenr = bytenr;
 			} else if (state->print_mask &
 				   BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO
-				       "Written block @%llu (%s/%llu/%d)"
-				       " found in hash table, %c.\n",
-				       (unsigned long long)bytenr,
-				       dev_state->name,
-				       (unsigned long long)dev_bytenr,
-				       block->mirror_num,
-				       btrfsic_get_block_type(state, block));
+				pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c\n",
+					(unsigned long long)bytenr,
+					dev_state->name,
+					(unsigned long long)dev_bytenr,
+					block->mirror_num,
+					btrfsic_get_block_type(state, block));
 		} else {
 			if (num_pages * PAGE_CACHE_SIZE <
 			    state->datablock_size) {
-				printk(KERN_INFO
-				       "btrfsic: cannot work with too short bios!\n");
+				pr_info("cannot work with too short bios!\n");
 				return;
 			}
 			processed_len = state->datablock_size;
 			bytenr = block->logical_bytenr;
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO
-				       "Written block @%llu (%s/%llu/%d)"
-				       " found in hash table, %c.\n",
-				       (unsigned long long)bytenr,
-				       dev_state->name,
-				       (unsigned long long)dev_bytenr,
-				       block->mirror_num,
-				       btrfsic_get_block_type(state, block));
+				pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c\n",
+					(unsigned long long)bytenr,
+					dev_state->name,
+					(unsigned long long)dev_bytenr,
+					block->mirror_num,
+					btrfsic_get_block_type(state, block));
 		}
 
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "ref_to_list: %cE, ref_from_list: %cE\n",
-			       list_empty(&block->ref_to_list) ? ' ' : '!',
-			       list_empty(&block->ref_from_list) ? ' ' : '!');
+			pr_info("ref_to_list: %cE, ref_from_list: %cE\n",
+				list_empty(&block->ref_to_list) ? ' ' : '!',
+				list_empty(&block->ref_from_list) ? ' ' : '!');
 		if (btrfsic_is_block_ref_by_superblock(state, block, 0)) {
-			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",
-			       btrfsic_get_block_type(state, block),
-			       (unsigned long long)bytenr,
-			       dev_state->name,
-			       (unsigned long long)dev_bytenr,
-			       block->mirror_num,
-			       (unsigned long long)block->generation,
-			       (unsigned long long)
-			       le64_to_cpu(block->disk_key.objectid),
-			       block->disk_key.type,
-			       (unsigned long long)
-			       le64_to_cpu(block->disk_key.offset),
-			       (unsigned long long)
-			       le64_to_cpu(((struct btrfs_header *)
-					    mapped_datav[0])->generation),
-			       (unsigned long long)
-			       state->max_superblock_generation);
+			pr_info("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",
+				btrfsic_get_block_type(state, block),
+				(unsigned long long)bytenr,
+				dev_state->name,
+				(unsigned long long)dev_bytenr,
+				block->mirror_num,
+				(unsigned long long)block->generation,
+				(unsigned long long)
+				le64_to_cpu(block->disk_key.objectid),
+				block->disk_key.type,
+				(unsigned long long)
+				le64_to_cpu(block->disk_key.offset),
+				(unsigned long long)
+				le64_to_cpu(((struct btrfs_header *)
+					     mapped_datav[0])->generation),
+				(unsigned long long)
+				state->max_superblock_generation);
 			btrfsic_dump_tree(state);
 		}
 
 		if (!block->is_iodone && !block->never_written) {
-			printk(KERN_INFO "btrfs: attempt to overwrite %c-block"
-			       " @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu,"
-			       " which is not yet iodone!\n",
-			       btrfsic_get_block_type(state, block),
-			       (unsigned long long)bytenr,
-			       dev_state->name,
-			       (unsigned long long)dev_bytenr,
-			       block->mirror_num,
-			       (unsigned long long)block->generation,
-			       (unsigned long long)
-			       le64_to_cpu(((struct btrfs_header *)
-					    mapped_datav[0])->generation));
+			pr_info("attempt to overwrite %c-block @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu, which is not yet iodone!\n",
+				btrfsic_get_block_type(state, block),
+				(unsigned long long)bytenr,
+				dev_state->name,
+				(unsigned long long)dev_bytenr,
+				block->mirror_num,
+				(unsigned long long)block->generation,
+				(unsigned long long)
+				le64_to_cpu(((struct btrfs_header *)
+					     mapped_datav[0])->generation));
 			/* it would not be safe to go on */
 			btrfsic_dump_tree(state);
 			goto continue_loop;
@@ -2054,9 +1995,8 @@ again:
 			ret = btrfsic_map_block(state, bytenr, processed_len,
 						&block_ctx, 0);
 		if (ret) {
-			printk(KERN_INFO
-			       "btrfsic: btrfsic_map_block(root @%llu)"
-			       " failed!\n", (unsigned long long)bytenr);
+			pr_info("btrfsic_map_block(root @%llu) failed!\n",
+				(unsigned long long)bytenr);
 			goto continue_loop;
 		}
 		block_ctx.datav = mapped_datav;
@@ -2124,8 +2064,7 @@ again:
 						mapped_datav[0]);
 				if (state->print_mask &
 				    BTRFSIC_PRINT_MASK_TREE_AFTER_SB_WRITE) {
-					printk(KERN_INFO
-					"[after new superblock is written]:\n");
+					pr_info("[after new superblock is written]:\n");
 					btrfsic_dump_tree_sub(state, block, 0);
 				}
 			} else {
@@ -2137,10 +2076,8 @@ again:
 						0, 0);
 			}
 			if (ret)
-				printk(KERN_INFO
-				       "btrfsic: btrfsic_process_metablock"
-				       "(root @%llu) failed!\n",
-				       (unsigned long long)dev_bytenr);
+				pr_info("btrfsic_process_metablock(root @%llu) failed!\n",
+					(unsigned long long)dev_bytenr);
 		} else {
 			block->is_metadata = 0;
 			block->mirror_num = 0;	/* unknown */
@@ -2166,10 +2103,9 @@ again:
 		if (!is_metadata) {
 			processed_len = state->datablock_size;
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO "Written block (%s/%llu/?)"
-				       " !found in hash table, D.\n",
-				       dev_state->name,
-				       (unsigned long long)dev_bytenr);
+				pr_info("Written block (%s/%llu/?) !found in hash table, D\n",
+					dev_state->name,
+					(unsigned long long)dev_bytenr);
 			if (!state->include_extent_data) {
 				/* ignore that written D block */
 				goto continue_loop;
@@ -2189,20 +2125,16 @@ again:
 			btrfsic_cmp_log_and_dev_bytenr(state, bytenr, dev_state,
 						       dev_bytenr);
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO
-				       "Written block @%llu (%s/%llu/?)"
-				       " !found in hash table, M.\n",
-				       (unsigned long long)bytenr,
-				       dev_state->name,
-				       (unsigned long long)dev_bytenr);
+				pr_info("Written block @%llu (%s/%llu/?) !found in hash table, M\n",
+					(unsigned long long)bytenr,
+					dev_state->name,
+					(unsigned long long)dev_bytenr);
 
 			ret = btrfsic_map_block(state, bytenr, processed_len,
 						&block_ctx, 0);
 			if (ret) {
-				printk(KERN_INFO
-				       "btrfsic: btrfsic_map_block(root @%llu)"
-				       " failed!\n",
-				       (unsigned long long)dev_bytenr);
+				pr_info("btrfsic_map_block(root @%llu) failed!\n",
+					(unsigned long long)dev_bytenr);
 				goto continue_loop;
 			}
 		}
@@ -2214,7 +2146,7 @@ again:
 
 		block = btrfsic_block_alloc();
 		if (NULL == block) {
-			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
+			pr_info("error, kmalloc failed!\n");
 			btrfsic_release_block_ctx(&block_ctx);
 			goto continue_loop;
 		}
@@ -2264,13 +2196,12 @@ again:
 			block->next_in_same_bio = NULL;
 		}
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "New written %c-block @%llu (%s/%llu/%d)\n",
-			       is_metadata ? 'M' : 'D',
-			       (unsigned long long)block->logical_bytenr,
-			       block->dev_state->name,
-			       (unsigned long long)block->dev_bytenr,
-			       block->mirror_num);
+			pr_info("New written %c-block @%llu (%s/%llu/%d)\n",
+				is_metadata ? 'M' : 'D',
+				(unsigned long long)block->logical_bytenr,
+				block->dev_state->name,
+				(unsigned long long)block->dev_bytenr,
+				block->mirror_num);
 		list_add(&block->all_blocks_node, &state->all_blocks_list);
 		btrfsic_block_hashtable_add(block, &state->block_hashtable);
 
@@ -2278,10 +2209,8 @@ again:
 			ret = btrfsic_process_metablock(state, block,
 							&block_ctx, 0, 0);
 			if (ret)
-				printk(KERN_INFO
-				       "btrfsic: process_metablock(root @%llu)"
-				       " failed!\n",
-				       (unsigned long long)dev_bytenr);
+				pr_info("process_metablock(root @%llu) failed!\n",
+					(unsigned long long)dev_bytenr);
 		}
 		btrfsic_release_block_ctx(&block_ctx);
 	}
@@ -2315,25 +2244,23 @@ static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status)
 
 		if ((dev_state->state->print_mask &
 		     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
-			printk(KERN_INFO
-			       "bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n",
-			       bio_error_status,
-			       btrfsic_get_block_type(dev_state->state, block),
-			       (unsigned long long)block->logical_bytenr,
-			       dev_state->name,
-			       (unsigned long long)block->dev_bytenr,
-			       block->mirror_num);
+			pr_info("bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n",
+				bio_error_status,
+				btrfsic_get_block_type(dev_state->state, block),
+				(unsigned long long)block->logical_bytenr,
+				dev_state->name,
+				(unsigned long long)block->dev_bytenr,
+				block->mirror_num);
 		next_block = block->next_in_same_bio;
 		block->iodone_w_error = iodone_w_error;
 		if (block->submit_bio_bh_rw & REQ_FLUSH) {
 			dev_state->last_flush_gen++;
 			if ((dev_state->state->print_mask &
 			     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
-				printk(KERN_INFO
-				       "bio_end_io() new %s flush_gen=%llu\n",
-				       dev_state->name,
-				       (unsigned long long)
-				       dev_state->last_flush_gen);
+				pr_info("bio_end_io() new %s flush_gen=%llu\n",
+					dev_state->name,
+					(unsigned long long)
+					dev_state->last_flush_gen);
 		}
 		if (block->submit_bio_bh_rw & REQ_FUA)
 			block->flush_gen = 0; /* FUA completed means block is
@@ -2354,24 +2281,22 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
 	BUG_ON(NULL == block);
 	dev_state = block->dev_state;
 	if ((dev_state->state->print_mask & BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
-		printk(KERN_INFO
-		       "bh_end_io(error=%d) for %c @%llu (%s/%llu/%d)\n",
-		       iodone_w_error,
-		       btrfsic_get_block_type(dev_state->state, block),
-		       (unsigned long long)block->logical_bytenr,
-		       block->dev_state->name,
-		       (unsigned long long)block->dev_bytenr,
-		       block->mirror_num);
+		pr_info("bh_end_io(error=%d) for %c @%llu (%s/%llu/%d)\n",
+			iodone_w_error,
+			btrfsic_get_block_type(dev_state->state, block),
+			(unsigned long long)block->logical_bytenr,
+			block->dev_state->name,
+			(unsigned long long)block->dev_bytenr,
+			block->mirror_num);
 
 	block->iodone_w_error = iodone_w_error;
 	if (block->submit_bio_bh_rw & REQ_FLUSH) {
 		dev_state->last_flush_gen++;
 		if ((dev_state->state->print_mask &
 		     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
-			printk(KERN_INFO
-			       "bh_end_io() new %s flush_gen=%llu\n",
-			       dev_state->name,
-			       (unsigned long long)dev_state->last_flush_gen);
+			pr_info("bh_end_io() new %s flush_gen=%llu\n",
+				dev_state->name,
+				(unsigned long long)dev_state->last_flush_gen);
 	}
 	if (block->submit_bio_bh_rw & REQ_FUA)
 		block->flush_gen = 0; /* FUA completed means block is on disk */
@@ -2393,30 +2318,26 @@ static int btrfsic_process_written_superblock(
 	if (!(superblock->generation > state->max_superblock_generation ||
 	      0 == state->max_superblock_generation)) {
 		if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
-			printk(KERN_INFO
-			       "btrfsic: superblock @%llu (%s/%llu/%d)"
-			       " with old gen %llu <= %llu\n",
-			       (unsigned long long)superblock->logical_bytenr,
-			       superblock->dev_state->name,
-			       (unsigned long long)superblock->dev_bytenr,
-			       superblock->mirror_num,
-			       (unsigned long long)
-			       btrfs_super_generation(super_hdr),
-			       (unsigned long long)
-			       state->max_superblock_generation);
+			pr_info("superblock @%llu (%s/%llu/%d) with old gen %llu <= %llu\n",
+				(unsigned long long)superblock->logical_bytenr,
+				superblock->dev_state->name,
+				(unsigned long long)superblock->dev_bytenr,
+				superblock->mirror_num,
+				(unsigned long long)
+				btrfs_super_generation(super_hdr),
+				(unsigned long long)
+				state->max_superblock_generation);
 	} else {
 		if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
-			printk(KERN_INFO
-			       "btrfsic: got new superblock @%llu (%s/%llu/%d)"
-			       " with new gen %llu > %llu\n",
-			       (unsigned long long)superblock->logical_bytenr,
-			       superblock->dev_state->name,
-			       (unsigned long long)superblock->dev_bytenr,
-			       superblock->mirror_num,
-			       (unsigned long long)
-			       btrfs_super_generation(super_hdr),
-			       (unsigned long long)
-			       state->max_superblock_generation);
+			pr_info("got new superblock @%llu (%s/%llu/%d) with new gen %llu > %llu\n",
+				(unsigned long long)superblock->logical_bytenr,
+				superblock->dev_state->name,
+				(unsigned long long)superblock->dev_bytenr,
+				superblock->mirror_num,
+				(unsigned long long)
+				btrfs_super_generation(super_hdr),
+				(unsigned long long)
+				state->max_superblock_generation);
 
 		state->max_superblock_generation =
 		    btrfs_super_generation(super_hdr);
@@ -2445,8 +2366,8 @@ static int btrfsic_process_written_superblock(
 			next_bytenr = btrfs_super_root(super_hdr);
 			if (state->print_mask &
 			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
-				printk(KERN_INFO "root@%llu\n",
-				       (unsigned long long)next_bytenr);
+				pr_info("root@%llu\n",
+					(unsigned long long)next_bytenr);
 			break;
 		case 1:
 			tmp_disk_key.objectid =
@@ -2455,8 +2376,8 @@ static int btrfsic_process_written_superblock(
 			next_bytenr = btrfs_super_chunk_root(super_hdr);
 			if (state->print_mask &
 			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
-				printk(KERN_INFO "chunk@%llu\n",
-				       (unsigned long long)next_bytenr);
+				pr_info("chunk@%llu\n",
+					(unsigned long long)next_bytenr);
 			break;
 		case 2:
 			tmp_disk_key.objectid =
@@ -2467,8 +2388,8 @@ static int btrfsic_process_written_superblock(
 				continue;
 			if (state->print_mask &
 			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
-				printk(KERN_INFO "log@%llu\n",
-				       (unsigned long long)next_bytenr);
+				pr_info("log@%llu\n",
+					(unsigned long long)next_bytenr);
 			break;
 		}
 
@@ -2476,25 +2397,22 @@ static int btrfsic_process_written_superblock(
 		    btrfs_num_copies(state->root->fs_info,
 				     next_bytenr, BTRFS_SUPER_INFO_SIZE);
 		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
-			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
-			       (unsigned long long)next_bytenr, num_copies);
+			pr_info("num_copies(log_bytenr=%llu) = %d\n",
+				(unsigned long long)next_bytenr, num_copies);
 		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 			int was_created;
 
 			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-				printk(KERN_INFO
-				       "btrfsic_process_written_superblock("
-				       "mirror_num=%d)\n", mirror_num);
+				pr_info("btrfsic_process_written_superblock(mirror_num=%d)\n",
+					mirror_num);
 			ret = btrfsic_map_block(state, next_bytenr,
 						BTRFS_SUPER_INFO_SIZE,
 						&tmp_next_block_ctx,
 						mirror_num);
 			if (ret) {
-				printk(KERN_INFO
-				       "btrfsic: btrfsic_map_block(@%llu,"
-				       " mirror=%d) failed!\n",
-				       (unsigned long long)next_bytenr,
-				       mirror_num);
+				pr_info("btrfsic_map_block(@%llu, mirror=%d) failed!\n",
+					(unsigned long long)next_bytenr,
+					mirror_num);
 				return -1;
 			}
 
@@ -2506,8 +2424,7 @@ static int btrfsic_process_written_superblock(
 					mirror_num,
 					&was_created);
 			if (NULL == next_block) {
-				printk(KERN_INFO
-				       "btrfsic: error, kmalloc failed!\n");
+				pr_info("error, kmalloc failed!\n");
 				btrfsic_release_block_ctx(&tmp_next_block_ctx);
 				return -1;
 			}
@@ -2558,8 +2475,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 		 * by the most recent super block.
 		 */
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "btrfsic: abort cyclic linkage (case 1).\n");
+			pr_info("abort cyclic linkage (case 1)\n");
 
 		return ret;
 	}
@@ -2574,54 +2490,46 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 			       node_ref_to);
 
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "rl=%d, %c @%llu (%s/%llu/%d)"
-			       " %u* refers to %c @%llu (%s/%llu/%d)\n",
-			       recursion_level,
-			       btrfsic_get_block_type(state, block),
-			       (unsigned long long)block->logical_bytenr,
-			       block->dev_state->name,
-			       (unsigned long long)block->dev_bytenr,
-			       block->mirror_num,
-			       l->ref_cnt,
-			       btrfsic_get_block_type(state, l->block_ref_to),
-			       (unsigned long long)
-			       l->block_ref_to->logical_bytenr,
-			       l->block_ref_to->dev_state->name,
-			       (unsigned long long)l->block_ref_to->dev_bytenr,
-			       l->block_ref_to->mirror_num);
+			pr_info("rl=%d, %c @%llu (%s/%llu/%d) %u* refers to %c @%llu (%s/%llu/%d)\n",
+				recursion_level,
+				btrfsic_get_block_type(state, block),
+				(unsigned long long)block->logical_bytenr,
+				block->dev_state->name,
+				(unsigned long long)block->dev_bytenr,
+				block->mirror_num,
+				l->ref_cnt,
+				btrfsic_get_block_type(state, l->block_ref_to),
+				(unsigned long long)
+				l->block_ref_to->logical_bytenr,
+				l->block_ref_to->dev_state->name,
+				(unsigned long long)l->block_ref_to->dev_bytenr,
+				l->block_ref_to->mirror_num);
 		if (l->block_ref_to->never_written) {
-			printk(KERN_INFO "btrfs: attempt to write superblock"
-			       " which references block %c @%llu (%s/%llu/%d)"
-			       " which is never written!\n",
-			       btrfsic_get_block_type(state, l->block_ref_to),
-			       (unsigned long long)
-			       l->block_ref_to->logical_bytenr,
-			       l->block_ref_to->dev_state->name,
-			       (unsigned long long)l->block_ref_to->dev_bytenr,
-			       l->block_ref_to->mirror_num);
+			pr_info("attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is never written!\n",
+				btrfsic_get_block_type(state, l->block_ref_to),
+				(unsigned long long)
+				l->block_ref_to->logical_bytenr,
+				l->block_ref_to->dev_state->name,
+				(unsigned long long)l->block_ref_to->dev_bytenr,
+				l->block_ref_to->mirror_num);
 			ret = -1;
 		} else if (!l->block_ref_to->is_iodone) {
-			printk(KERN_INFO "btrfs: attempt to write superblock"
-			       " which references block %c @%llu (%s/%llu/%d)"
-			       " which is not yet iodone!\n",
-			       btrfsic_get_block_type(state, l->block_ref_to),
-			       (unsigned long long)
-			       l->block_ref_to->logical_bytenr,
-			       l->block_ref_to->dev_state->name,
-			       (unsigned long long)l->block_ref_to->dev_bytenr,
-			       l->block_ref_to->mirror_num);
+				pr_info("attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not yet iodone!\n",
+					btrfsic_get_block_type(state, l->block_ref_to),
+					(unsigned long long)
+					l->block_ref_to->logical_bytenr,
+					l->block_ref_to->dev_state->name,
+					(unsigned long long)l->block_ref_to->dev_bytenr,
+					l->block_ref_to->mirror_num);
 			ret = -1;
 		} else if (l->block_ref_to->iodone_w_error) {
-			printk(KERN_INFO "btrfs: attempt to write superblock"
-			       " which references block %c @%llu (%s/%llu/%d)"
-			       " which has write error!\n",
-			       btrfsic_get_block_type(state, l->block_ref_to),
-			       (unsigned long long)
-			       l->block_ref_to->logical_bytenr,
-			       l->block_ref_to->dev_state->name,
-			       (unsigned long long)l->block_ref_to->dev_bytenr,
-			       l->block_ref_to->mirror_num);
+			pr_info("attempt to write superblock which references block %c @%llu (%s/%llu/%d) which has write error!\n",
+				btrfsic_get_block_type(state, l->block_ref_to),
+				(unsigned long long)
+				l->block_ref_to->logical_bytenr,
+				l->block_ref_to->dev_state->name,
+				(unsigned long long)l->block_ref_to->dev_bytenr,
+				l->block_ref_to->mirror_num);
 			ret = -1;
 		} else if (l->parent_generation !=
 			   l->block_ref_to->generation &&
@@ -2629,35 +2537,28 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 			   l->parent_generation &&
 			   BTRFSIC_GENERATION_UNKNOWN !=
 			   l->block_ref_to->generation) {
-			printk(KERN_INFO "btrfs: attempt to write superblock"
-			       " which references block %c @%llu (%s/%llu/%d)"
-			       " with generation %llu !="
-			       " parent generation %llu!\n",
-			       btrfsic_get_block_type(state, l->block_ref_to),
-			       (unsigned long long)
-			       l->block_ref_to->logical_bytenr,
-			       l->block_ref_to->dev_state->name,
-			       (unsigned long long)l->block_ref_to->dev_bytenr,
-			       l->block_ref_to->mirror_num,
-			       (unsigned long long)l->block_ref_to->generation,
-			       (unsigned long long)l->parent_generation);
+			pr_info("attempt to write superblock which references block %c @%llu (%s/%llu/%d) with generation %llu != parent generation %llu!\n",
+				btrfsic_get_block_type(state, l->block_ref_to),
+				(unsigned long long)
+				l->block_ref_to->logical_bytenr,
+				l->block_ref_to->dev_state->name,
+				(unsigned long long)l->block_ref_to->dev_bytenr,
+				l->block_ref_to->mirror_num,
+				(unsigned long long)l->block_ref_to->generation,
+				(unsigned long long)l->parent_generation);
 			ret = -1;
 		} else if (l->block_ref_to->flush_gen >
 			   l->block_ref_to->dev_state->last_flush_gen) {
-			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",
-			       btrfsic_get_block_type(state, l->block_ref_to),
-			       (unsigned long long)
-			       l->block_ref_to->logical_bytenr,
-			       l->block_ref_to->dev_state->name,
-			       (unsigned long long)l->block_ref_to->dev_bytenr,
-			       l->block_ref_to->mirror_num,
-			       (unsigned long long)block->flush_gen,
-			       (unsigned long long)
-			       l->block_ref_to->dev_state->last_flush_gen);
+			pr_info("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",
+				btrfsic_get_block_type(state, l->block_ref_to),
+				(unsigned long long)
+				l->block_ref_to->logical_bytenr,
+				l->block_ref_to->dev_state->name,
+				(unsigned long long)l->block_ref_to->dev_bytenr,
+				l->block_ref_to->mirror_num,
+				(unsigned long long)block->flush_gen,
+				(unsigned long long)
+				l->block_ref_to->dev_state->last_flush_gen);
 			ret = -1;
 		} else if (-1 == btrfsic_check_all_ref_blocks(state,
 							      l->block_ref_to,
@@ -2680,8 +2581,7 @@ static int btrfsic_is_block_ref_by_superblock(
 	if (recursion_level >= 3 + BTRFS_MAX_LEVEL) {
 		/* refer to comment at "abort cyclic linkage (case 1)" */
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "btrfsic: abort cyclic linkage (case 2).\n");
+			pr_info("abort cyclic linkage (case 2)\n");
 
 		return 0;
 	}
@@ -2696,23 +2596,21 @@ static int btrfsic_is_block_ref_by_superblock(
 			       node_ref_from);
 
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "rl=%d, %c @%llu (%s/%llu/%d)"
-			       " is ref %u* from %c @%llu (%s/%llu/%d)\n",
-			       recursion_level,
-			       btrfsic_get_block_type(state, block),
-			       (unsigned long long)block->logical_bytenr,
-			       block->dev_state->name,
-			       (unsigned long long)block->dev_bytenr,
-			       block->mirror_num,
-			       l->ref_cnt,
-			       btrfsic_get_block_type(state, l->block_ref_from),
-			       (unsigned long long)
-			       l->block_ref_from->logical_bytenr,
-			       l->block_ref_from->dev_state->name,
-			       (unsigned long long)
-			       l->block_ref_from->dev_bytenr,
-			       l->block_ref_from->mirror_num);
+			pr_info("rl=%d, %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
+				recursion_level,
+				btrfsic_get_block_type(state, block),
+				(unsigned long long)block->logical_bytenr,
+				block->dev_state->name,
+				(unsigned long long)block->dev_bytenr,
+				block->mirror_num,
+				l->ref_cnt,
+				btrfsic_get_block_type(state, l->block_ref_from),
+				(unsigned long long)
+				l->block_ref_from->logical_bytenr,
+				l->block_ref_from->dev_state->name,
+				(unsigned long long)
+				l->block_ref_from->dev_bytenr,
+				l->block_ref_from->mirror_num);
 		if (l->block_ref_from->is_superblock &&
 		    state->latest_superblock->dev_bytenr ==
 		    l->block_ref_from->dev_bytenr &&
@@ -2732,39 +2630,35 @@ static int btrfsic_is_block_ref_by_superblock(
 static void btrfsic_print_add_link(const struct btrfsic_state *state,
 				   const struct btrfsic_block_link *l)
 {
-	printk(KERN_INFO
-	       "Add %u* link from %c @%llu (%s/%llu/%d)"
-	       " to %c @%llu (%s/%llu/%d).\n",
-	       l->ref_cnt,
-	       btrfsic_get_block_type(state, l->block_ref_from),
-	       (unsigned long long)l->block_ref_from->logical_bytenr,
-	       l->block_ref_from->dev_state->name,
-	       (unsigned long long)l->block_ref_from->dev_bytenr,
-	       l->block_ref_from->mirror_num,
-	       btrfsic_get_block_type(state, l->block_ref_to),
-	       (unsigned long long)l->block_ref_to->logical_bytenr,
-	       l->block_ref_to->dev_state->name,
-	       (unsigned long long)l->block_ref_to->dev_bytenr,
-	       l->block_ref_to->mirror_num);
+	pr_info("Add %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d)\n",
+		l->ref_cnt,
+		btrfsic_get_block_type(state, l->block_ref_from),
+		(unsigned long long)l->block_ref_from->logical_bytenr,
+		l->block_ref_from->dev_state->name,
+		(unsigned long long)l->block_ref_from->dev_bytenr,
+		l->block_ref_from->mirror_num,
+		btrfsic_get_block_type(state, l->block_ref_to),
+		(unsigned long long)l->block_ref_to->logical_bytenr,
+		l->block_ref_to->dev_state->name,
+		(unsigned long long)l->block_ref_to->dev_bytenr,
+		l->block_ref_to->mirror_num);
 }
 
 static void btrfsic_print_rem_link(const struct btrfsic_state *state,
 				   const struct btrfsic_block_link *l)
 {
-	printk(KERN_INFO
-	       "Rem %u* link from %c @%llu (%s/%llu/%d)"
-	       " to %c @%llu (%s/%llu/%d).\n",
-	       l->ref_cnt,
-	       btrfsic_get_block_type(state, l->block_ref_from),
-	       (unsigned long long)l->block_ref_from->logical_bytenr,
-	       l->block_ref_from->dev_state->name,
-	       (unsigned long long)l->block_ref_from->dev_bytenr,
-	       l->block_ref_from->mirror_num,
-	       btrfsic_get_block_type(state, l->block_ref_to),
-	       (unsigned long long)l->block_ref_to->logical_bytenr,
-	       l->block_ref_to->dev_state->name,
-	       (unsigned long long)l->block_ref_to->dev_bytenr,
-	       l->block_ref_to->mirror_num);
+	pr_info("Rem %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d)\n",
+		l->ref_cnt,
+		btrfsic_get_block_type(state, l->block_ref_from),
+		(unsigned long long)l->block_ref_from->logical_bytenr,
+		l->block_ref_from->dev_state->name,
+		(unsigned long long)l->block_ref_from->dev_bytenr,
+		l->block_ref_from->mirror_num,
+		btrfsic_get_block_type(state, l->block_ref_to),
+		(unsigned long long)l->block_ref_to->logical_bytenr,
+		l->block_ref_to->dev_state->name,
+		(unsigned long long)l->block_ref_to->dev_bytenr,
+		l->block_ref_to->mirror_num);
 }
 
 static char btrfsic_get_block_type(const struct btrfsic_state *state,
@@ -2873,8 +2767,7 @@ static struct btrfsic_block_link *btrfsic_block_link_lookup_or_add(
 	if (NULL == l) {
 		l = btrfsic_block_link_alloc();
 		if (NULL == l) {
-			printk(KERN_INFO
-			       "btrfsic: error, kmalloc" " failed!\n");
+			pr_info("error, kmalloc failed!\n");
 			return NULL;
 		}
 
@@ -2921,13 +2814,12 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
 
 		block = btrfsic_block_alloc();
 		if (NULL == block) {
-			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
+			pr_info("error, kmalloc failed!\n");
 			return NULL;
 		}
 		dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev);
 		if (NULL == dev_state) {
-			printk(KERN_INFO
-			       "btrfsic: error, lookup dev_state failed!\n");
+			pr_info("error, lookup dev_state failed!\n");
 			btrfsic_block_free(block);
 			return NULL;
 		}
@@ -2939,14 +2831,13 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
 		block->never_written = never_written;
 		block->mirror_num = mirror_num;
 		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
-			printk(KERN_INFO
-			       "New %s%c-block @%llu (%s/%llu/%d)\n",
-			       additional_string,
-			       btrfsic_get_block_type(state, block),
-			       (unsigned long long)block->logical_bytenr,
-			       dev_state->name,
-			       (unsigned long long)block->dev_bytenr,
-			       mirror_num);
+			pr_info("New %s%c-block @%llu (%s/%llu/%d)\n",
+				additional_string,
+				btrfsic_get_block_type(state, block),
+				(unsigned long long)block->logical_bytenr,
+				dev_state->name,
+				(unsigned long long)block->dev_bytenr,
+				mirror_num);
 		list_add(&block->all_blocks_node, &state->all_blocks_list);
 		btrfsic_block_hashtable_add(block, &state->block_hashtable);
 		if (NULL != was_created)
@@ -2977,10 +2868,8 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
 		ret = btrfsic_map_block(state, bytenr, state->metablock_size,
 					&block_ctx, mirror_num);
 		if (ret) {
-			printk(KERN_INFO "btrfsic:"
-			       " btrfsic_map_block(logical @%llu,"
-			       " mirror %d) failed!\n",
-			       (unsigned long long)bytenr, mirror_num);
+			pr_info("btrfsic_map_block(logical @%llu, mirror %d) failed!\n",
+				(unsigned long long)bytenr, mirror_num);
 			continue;
 		}
 
@@ -2994,11 +2883,9 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
 	}
 
 	if (!match) {
-		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",
-		       (unsigned long long)bytenr, dev_state->name,
-		       (unsigned long long)dev_bytenr);
+		pr_info("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",
+			(unsigned long long)bytenr, dev_state->name,
+			(unsigned long long)dev_bytenr);
 		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 			ret = btrfsic_map_block(state, bytenr,
 						state->metablock_size,
@@ -3006,12 +2893,11 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
 			if (ret)
 				continue;
 
-			printk(KERN_INFO "Read logical bytenr @%llu maps to"
-			       " (%s/%llu/%d)\n",
-			       (unsigned long long)bytenr,
-			       block_ctx.dev->name,
-			       (unsigned long long)block_ctx.dev_bytenr,
-			       mirror_num);
+			pr_info("Read logical bytenr @%llu maps to (%s/%llu/%d)\n",
+				(unsigned long long)bytenr,
+				block_ctx.dev->name,
+				(unsigned long long)block_ctx.dev_bytenr,
+				mirror_num);
 		}
 		WARN_ON(1);
 	}
@@ -3047,31 +2933,25 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh)
 		dev_bytenr = 4096 * bh->b_blocknr;
 		if (dev_state->state->print_mask &
 		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
-			printk(KERN_INFO
-			       "submit_bh(rw=0x%x, blocknr=%lu (bytenr %llu),"
-			       " size=%lu, data=%p, bdev=%p)\n",
-			       rw, (unsigned long)bh->b_blocknr,
-			       (unsigned long long)dev_bytenr,
-			       (unsigned long)bh->b_size, bh->b_data,
-			       bh->b_bdev);
+			pr_info("submit_bh(rw=0x%x, blocknr=%lu (bytenr %llu), size=%lu, data=%p, bdev=%p)\n",
+				rw, (unsigned long)bh->b_blocknr,
+				(unsigned long long)dev_bytenr,
+				(unsigned long)bh->b_size, bh->b_data,
+				bh->b_bdev);
 		btrfsic_process_written_block(dev_state, dev_bytenr,
 					      &bh->b_data, 1, NULL,
 					      NULL, bh, rw);
 	} else if (NULL != dev_state && (rw & REQ_FLUSH)) {
 		if (dev_state->state->print_mask &
 		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
-			printk(KERN_INFO
-			       "submit_bh(rw=0x%x FLUSH, bdev=%p)\n",
-			       rw, bh->b_bdev);
+			pr_info("submit_bh(rw=0x%x FLUSH, bdev=%p)\n",
+				rw, bh->b_bdev);
 		if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 			if ((dev_state->state->print_mask &
 			     (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
 			      BTRFSIC_PRINT_MASK_VERBOSE)))
-				printk(KERN_INFO
-				       "btrfsic_submit_bh(%s) with FLUSH"
-				       " but dummy block already in use"
-				       " (ignored)!\n",
-				       dev_state->name);
+				pr_info("btrfsic_submit_bh(%s) with FLUSH but dummy block already in use (ignored)!\n",
+					dev_state->name);
 		} else {
 			struct btrfsic_block *const block =
 				&dev_state->dummy_block_for_bio_bh_flush;
@@ -3116,12 +2996,10 @@ void btrfsic_submit_bio(int rw, struct bio *bio)
 		bio_is_patched = 0;
 		if (dev_state->state->print_mask &
 		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
-			printk(KERN_INFO
-			       "submit_bio(rw=0x%x, bi_vcnt=%u,"
-			       " bi_sector=%lu (bytenr %llu), bi_bdev=%p)\n",
-			       rw, bio->bi_vcnt, (unsigned long)bio->bi_sector,
-			       (unsigned long long)dev_bytenr,
-			       bio->bi_bdev);
+			pr_info("submit_bio(rw=0x%x, bi_vcnt=%u, bi_sector=%lu (bytenr %llu), bi_bdev=%p)\n",
+				rw, bio->bi_vcnt, (unsigned long)bio->bi_sector,
+				(unsigned long long)dev_bytenr,
+				bio->bi_bdev);
 
 		mapped_datav = kmalloc(sizeof(*mapped_datav) * bio->bi_vcnt,
 				       GFP_NOFS);
@@ -3143,11 +3021,10 @@ void btrfsic_submit_bio(int rw, struct bio *bio)
 			    (dev_state->state->print_mask &
 			     (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
 			      BTRFSIC_PRINT_MASK_VERBOSE)))
-				printk(KERN_INFO
-				       "#%u: page=%p, len=%u, offset=%u\n",
-				       i, bio->bi_io_vec[i].bv_page,
-				       bio->bi_io_vec[i].bv_len,
-				       bio->bi_io_vec[i].bv_offset);
+				pr_info("#%u: page=%p, len=%u, offset=%u\n",
+					i, bio->bi_io_vec[i].bv_page,
+					bio->bi_io_vec[i].bv_len,
+					bio->bi_io_vec[i].bv_offset);
 		}
 		btrfsic_process_written_block(dev_state, dev_bytenr,
 					      mapped_datav, bio->bi_vcnt,
@@ -3161,18 +3038,14 @@ void btrfsic_submit_bio(int rw, struct bio *bio)
 	} else if (NULL != dev_state && (rw & REQ_FLUSH)) {
 		if (dev_state->state->print_mask &
 		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
-			printk(KERN_INFO
-			       "submit_bio(rw=0x%x FLUSH, bdev=%p)\n",
-			       rw, bio->bi_bdev);
+			pr_info("submit_bio(rw=0x%x FLUSH, bdev=%p)\n",
+				rw, bio->bi_bdev);
 		if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 			if ((dev_state->state->print_mask &
 			     (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
 			      BTRFSIC_PRINT_MASK_VERBOSE)))
-				printk(KERN_INFO
-				       "btrfsic_submit_bio(%s) with FLUSH"
-				       " but dummy block already in use"
-				       " (ignored)!\n",
-				       dev_state->name);
+				pr_info("btrfsic_submit_bio(%s) with FLUSH but dummy block already in use (ignored)!\n",
+					dev_state->name);
 		} else {
 			struct btrfsic_block *const block =
 				&dev_state->dummy_block_for_bio_bh_flush;
@@ -3205,32 +3078,28 @@ int btrfsic_mount(struct btrfs_root *root,
 	struct btrfs_device *device;
 
 	if (root->nodesize != root->leafsize) {
-		printk(KERN_INFO
-		       "btrfsic: cannot handle nodesize %d != leafsize %d!\n",
-		       root->nodesize, root->leafsize);
+		pr_info("cannot handle nodesize %d != leafsize %d!\n",
+			root->nodesize, root->leafsize);
 		return -1;
 	}
 	if (root->nodesize & ((u64)PAGE_CACHE_SIZE - 1)) {
-		printk(KERN_INFO
-		       "btrfsic: cannot handle nodesize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
-		       root->nodesize, (unsigned long)PAGE_CACHE_SIZE);
+		pr_info("cannot handle nodesize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
+			root->nodesize, (unsigned long)PAGE_CACHE_SIZE);
 		return -1;
 	}
 	if (root->leafsize & ((u64)PAGE_CACHE_SIZE - 1)) {
-		printk(KERN_INFO
-		       "btrfsic: cannot handle leafsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
-		       root->leafsize, (unsigned long)PAGE_CACHE_SIZE);
+		pr_info("cannot handle leafsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
+			root->leafsize, (unsigned long)PAGE_CACHE_SIZE);
 		return -1;
 	}
 	if (root->sectorsize & ((u64)PAGE_CACHE_SIZE - 1)) {
-		printk(KERN_INFO
-		       "btrfsic: cannot handle sectorsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
-		       root->sectorsize, (unsigned long)PAGE_CACHE_SIZE);
+		pr_info("cannot handle sectorsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
+			root->sectorsize, (unsigned long)PAGE_CACHE_SIZE);
 		return -1;
 	}
 	state = kzalloc(sizeof(*state), GFP_NOFS);
 	if (NULL == state) {
-		printk(KERN_INFO "btrfs check-integrity: kmalloc() failed!\n");
+		pr_info("kmalloc() failed!\n");
 		return -1;
 	}
 
@@ -3261,8 +3130,7 @@ int btrfsic_mount(struct btrfs_root *root,
 
 		ds = btrfsic_dev_state_alloc();
 		if (NULL == ds) {
-			printk(KERN_INFO
-			       "btrfs check-integrity: kmalloc() failed!\n");
+			pr_info("kmalloc() failed!\n");
 			mutex_unlock(&btrfsic_mutex);
 			return -1;
 		}
@@ -3328,9 +3196,7 @@ void btrfsic_unmount(struct btrfs_root *root,
 	}
 
 	if (NULL == state) {
-		printk(KERN_INFO
-		       "btrfsic: error, cannot find state information"
-		       " on umount!\n");
+		pr_info("error, cannot find state information on umount!\n");
 		mutex_unlock(&btrfsic_mutex);
 		return;
 	}
@@ -3365,14 +3231,12 @@ void btrfsic_unmount(struct btrfs_root *root,
 		if (b_all->is_iodone || b_all->never_written)
 			btrfsic_block_free(b_all);
 		else
-			printk(KERN_INFO "btrfs: attempt to free %c-block"
-			       " @%llu (%s/%llu/%d) on umount which is"
-			       " not yet iodone!\n",
-			       btrfsic_get_block_type(state, b_all),
-			       (unsigned long long)b_all->logical_bytenr,
-			       b_all->dev_state->name,
-			       (unsigned long long)b_all->dev_bytenr,
-			       b_all->mirror_num);
+			pr_info("attempt to free %c-block @%llu (%s/%llu/%d) on umount which is not yet iodone!\n",
+				btrfsic_get_block_type(state, b_all),
+				(unsigned long long)b_all->logical_bytenr,
+				b_all->dev_state->name,
+				(unsigned long long)b_all->dev_bytenr,
+				b_all->mirror_num);
 	}
 
 	mutex_unlock(&btrfsic_mutex);
fs/btrfs/compression.c +6 -6
index b189bd1..a88a252 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/bio.h>
 #include <linux/buffer_head.h>
@@ -129,12 +131,10 @@ static int check_compressed_csum(struct inode *inode,
 		kunmap_atomic(kaddr);
 
 		if (csum != *cb_sum) {
-			printk(KERN_INFO "btrfs csum failed ino %llu "
-			       "extent %llu csum %u "
-			       "wanted %u mirror %d\n",
-			       (unsigned long long)btrfs_ino(inode),
-			       (unsigned long long)disk_start,
-			       csum, *cb_sum, cb->mirror_num);
+			pr_info("csum failed ino %llu extent %llu csum %u wanted %u mirror %d\n",
+				(unsigned long long)btrfs_ino(inode),
+				(unsigned long long)disk_start,
+				csum, *cb_sum, cb->mirror_num);
 			ret = -EIO;
 			goto fail;
 		}
fs/btrfs/ctree.c +11 -11
index 5bf4c39..1f0e79b 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/rbtree.h>
@@ -1324,7 +1326,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq)
 		old = read_tree_block(root, logical, blocksize, 0);
 		if (!old || !extent_buffer_uptodate(old)) {
 			free_extent_buffer(old);
-			pr_warn("btrfs: failed to read tree block %llu from get_old_root\n",
+			pr_warn("failed to read tree block %llu from get_old_root\n",
 				logical);
 			WARN_ON(1);
 		} else {
@@ -3358,10 +3360,9 @@ noinline int btrfs_leaf_free_space(struct btrfs_root *root,
 	int ret;
 	ret = BTRFS_LEAF_DATA_SIZE(root) - leaf_space_used(leaf, 0, nritems);
 	if (ret < 0) {
-		printk(KERN_CRIT "leaf free space ret %d, leaf data size %lu, "
-		       "used %d nritems %d\n",
-		       ret, (unsigned long) BTRFS_LEAF_DATA_SIZE(root),
-		       leaf_space_used(leaf, 0, nritems), nritems);
+		pr_crit("leaf free space ret %d, leaf data size %lu, used %d nritems %d\n",
+			ret, (unsigned long) BTRFS_LEAF_DATA_SIZE(root),
+			leaf_space_used(leaf, 0, nritems), nritems);
 	}
 	return ret;
 }
@@ -4430,8 +4431,7 @@ void btrfs_extend_item(struct btrfs_root *root, struct btrfs_path *path,
 	BUG_ON(slot < 0);
 	if (slot >= nritems) {
 		btrfs_print_leaf(root, leaf);
-		printk(KERN_CRIT "slot %d too large, nritems %d\n",
-		       slot, nritems);
+		pr_crit("slot %d too large, nritems %d\n", slot, nritems);
 		BUG_ON(1);
 	}
 
@@ -4493,8 +4493,8 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
 
 	if (btrfs_leaf_free_space(root, leaf) < total_size) {
 		btrfs_print_leaf(root, leaf);
-		printk(KERN_CRIT "not enough freespace need %u have %d\n",
-		       total_size, btrfs_leaf_free_space(root, leaf));
+		pr_crit("not enough freespace need %u have %d\n",
+			total_size, btrfs_leaf_free_space(root, leaf));
 		BUG();
 	}
 
@@ -4503,8 +4503,8 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
 
 		if (old_data < data_end) {
 			btrfs_print_leaf(root, leaf);
-			printk(KERN_CRIT "slot %d old_data %d data_end %d\n",
-			       slot, old_data, data_end);
+			pr_crit("slot %d old_data %d data_end %d\n",
+				slot, old_data, data_end);
 			BUG_ON(1);
 		}
 		/*
fs/btrfs/ctree.h +1 -2
index e795bf1..2af5726 100644
@@ -3746,8 +3746,7 @@ static inline void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info,
 		if (!(features & flag)) {
 			features |= flag;
 			btrfs_set_super_incompat_flags(disk_super, features);
-			printk(KERN_INFO "btrfs: setting %llu feature flag\n",
-					 flag);
+			pr_info("setting %llu feature flag\n", flag);
 		}
 		spin_unlock(&fs_info->super_lock);
 	}
fs/btrfs/delayed-inode.c +12 -14
index 3755109..f527fdd 100644
@@ -17,6 +17,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include "delayed-inode.h"
 #include "disk-io.h"
@@ -1470,13 +1472,11 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
 	mutex_lock(&delayed_node->mutex);
 	ret = __btrfs_add_delayed_insertion_item(delayed_node, delayed_item);
 	if (unlikely(ret)) {
-		printk(KERN_ERR "err add delayed dir index item(name: %s) into "
-				"the insertion tree of the delayed node"
-				"(root id: %llu, inode id: %llu, errno: %d)\n",
-				name,
-				(unsigned long long)delayed_node->root->objectid,
-				(unsigned long long)delayed_node->inode_id,
-				ret);
+		pr_err("err add delayed dir index item(name: %s) into the insertion tree of the delayed node (root id: %llu, inode id: %llu, errno: %d)\n",
+		       name,
+		       (unsigned long long)delayed_node->root->objectid,
+		       (unsigned long long)delayed_node->inode_id,
+		       ret);
 		BUG();
 	}
 	mutex_unlock(&delayed_node->mutex);
@@ -1544,13 +1544,11 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
 	mutex_lock(&node->mutex);
 	ret = __btrfs_add_delayed_deletion_item(node, item);
 	if (unlikely(ret)) {
-		printk(KERN_ERR "err add delayed dir index item(index: %llu) "
-				"into the deletion tree of the delayed node"
-				"(root id: %llu, inode id: %llu, errno: %d)\n",
-				(unsigned long long)index,
-				(unsigned long long)node->root->objectid,
-				(unsigned long long)node->inode_id,
-				ret);
+		pr_err("err add delayed dir index item(index: %llu) into the deletion tree of the delayed node (root id: %llu, inode id: %llu, errno: %d)\n",
+		       (unsigned long long)index,
+		       (unsigned long long)node->root->objectid,
+		       (unsigned long long)node->inode_id,
+		       ret);
 		BUG();
 	}
 	mutex_unlock(&node->mutex);
fs/btrfs/dev-replace.c +12 -14
index 4253ad5..7aac584 100644
@@ -104,7 +104,7 @@ no_valid_dev_replace_entry_found:
 	ptr = btrfs_item_ptr(eb, slot, struct btrfs_dev_replace_item);
 
 	if (item_size != sizeof(struct btrfs_dev_replace_item)) {
-		pr_warn("btrfs: dev_replace entry found has unexpected size, ignore entry\n");
+		pr_warn("dev_replace entry found has unexpected size, ignore entry\n");
 		goto no_valid_dev_replace_entry_found;
 	}
 
@@ -147,13 +147,13 @@ no_valid_dev_replace_entry_found:
 		if (!dev_replace->srcdev &&
 		    !btrfs_test_opt(dev_root, DEGRADED)) {
 			ret = -EIO;
-			pr_warn("btrfs: cannot mount because device replace operation is ongoing and\n" "srcdev (devid %llu) is missing, need to run 'btrfs dev scan'?\n",
+			pr_warn("cannot mount because device replace operation is ongoing and srcdev (devid %llu) is missing, need to run 'btrfs dev scan'?\n",
 				(unsigned long long)src_devid);
 		}
 		if (!dev_replace->tgtdev &&
 		    !btrfs_test_opt(dev_root, DEGRADED)) {
 			ret = -EIO;
-			pr_warn("btrfs: cannot mount because device replace operation is ongoing and\n" "tgtdev (devid %llu) is missing, need to run btrfs dev scan?\n",
+			pr_warn("cannot mount because device replace operation is ongoing and tgtdev (devid %llu) is missing, need to run 'btrfs dev scan'?\n",
 				(unsigned long long)BTRFS_DEV_REPLACE_DEVID);
 		}
 		if (dev_replace->tgtdev) {
@@ -212,8 +212,7 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
 	}
 	ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1);
 	if (ret < 0) {
-		pr_warn("btrfs: error %d while searching for dev_replace item!\n",
-			ret);
+		pr_warn("error %d while searching for dev_replace item!\n", ret);
 		goto out;
 	}
 
@@ -232,7 +231,7 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
 		 */
 		ret = btrfs_del_item(trans, dev_root, path);
 		if (ret != 0) {
-			pr_warn("btrfs: delete too small dev_replace item failed %d!\n",
+			pr_warn("delete too small dev_replace item failed %d!\n",
 				ret);
 			goto out;
 		}
@@ -245,8 +244,7 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans,
 		ret = btrfs_insert_empty_item(trans, dev_root, path,
 					      &key, sizeof(*ptr));
 		if (ret < 0) {
-			pr_warn("btrfs: insert dev_replace item failed %d!\n",
-				ret);
+			pr_warn("insert dev_replace item failed %d!\n", ret);
 			goto out;
 		}
 	}
@@ -314,7 +312,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
 	struct btrfs_device *src_device = NULL;
 
 	if (btrfs_fs_incompat(fs_info, RAID56)) {
-		pr_warn("btrfs: dev_replace cannot yet handle RAID5/RAID6\n");
+		pr_warn("dev_replace cannot yet handle RAID5/RAID6\n");
 		return -EINVAL;
 	}
 
@@ -334,7 +332,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
 	ret = btrfs_init_dev_replace_tgtdev(root, args->start.tgtdev_name,
 					    &tgt_device);
 	if (ret) {
-		pr_err("btrfs: target device %s is invalid!\n",
+		pr_err("target device %s is invalid!\n",
 		       args->start.tgtdev_name);
 		mutex_unlock(&fs_info->volume_mutex);
 		return -EINVAL;
@@ -350,7 +348,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
 	}
 
 	if (tgt_device->total_bytes < src_device->total_bytes) {
-		pr_err("btrfs: target device is smaller than source device!\n");
+		pr_err("target device is smaller than source device!\n");
 		ret = -EINVAL;
 		goto leave_no_lock;
 	}
@@ -708,7 +706,7 @@ void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info)
 			BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED;
 		dev_replace->time_stopped = btrfs_get_seconds_since_1970();
 		dev_replace->item_needs_writeback = 1;
-		pr_info("btrfs: suspending dev_replace for unmount\n");
+		pr_info("suspending dev_replace for unmount\n");
 		break;
 	}
 
@@ -737,8 +735,8 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info)
 		break;
 	}
 	if (!dev_replace->tgtdev || !dev_replace->tgtdev->bdev) {
-		pr_info("btrfs: cannot continue dev_replace, tgtdev is missing\n"
-			"btrfs: you may cancel the operation after 'mount -o degraded'\n");
+		pr_info("cannot continue dev_replace, tgtdev is missing\n");
+		pr_info("you may cancel the operation after 'mount -o degraded'\n");
 		btrfs_dev_replace_unlock(dev_replace);
 		return 0;
 	}
fs/btrfs/dir-item.c +7 -6
index 79e594e..e8e3456 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "ctree.h"
 #include "disk-io.h"
 #include "hash.h"
@@ -459,8 +461,7 @@ int verify_dir_item(struct btrfs_root *root,
 	u8 type = btrfs_dir_type(leaf, dir_item);
 
 	if (type >= BTRFS_FT_MAX) {
-		printk(KERN_CRIT "btrfs: invalid dir item type: %d\n",
-		       (int)type);
+		pr_crit("invalid dir item type: %d\n", (int)type);
 		return 1;
 	}
 
@@ -468,15 +469,15 @@ int verify_dir_item(struct btrfs_root *root,
 		namelen = XATTR_NAME_MAX;
 
 	if (btrfs_dir_name_len(leaf, dir_item) > namelen) {
-		printk(KERN_CRIT "btrfs: invalid dir item name len: %u\n",
-		       (unsigned)btrfs_dir_data_len(leaf, dir_item));
+		pr_crit("invalid dir item name len: %u\n",
+			(unsigned)btrfs_dir_data_len(leaf, dir_item));
 		return 1;
 	}
 
 	/* BTRFS_MAX_XATTR_SIZE is the same for all dir items */
 	if (btrfs_dir_data_len(leaf, dir_item) > BTRFS_MAX_XATTR_SIZE(root)) {
-		printk(KERN_CRIT "btrfs: invalid dir item data len: %u\n",
-		       (unsigned)btrfs_dir_data_len(leaf, dir_item));
+		pr_crit("invalid dir item data len: %u\n",
+			(unsigned)btrfs_dir_data_len(leaf, dir_item));
 		return 1;
 	}
 
fs/btrfs/disk-io.c +60 -77

381 lines not on this page · raw message

fs/btrfs/extent-tree.c +24 -22

70 lines not on this page · raw message

fs/btrfs/extent_io.c +16 -16
index 583d98b..e133b2f 100644
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/bitops.h>
 #include <linux/slab.h>
 #include <linux/bio.h>
@@ -59,8 +61,7 @@ void btrfs_leak_debug_check(void)
 
 	while (!list_empty(&states)) {
 		state = list_entry(states.next, struct extent_state, leak_list);
-		printk(KERN_ERR "btrfs state leak: start %llu end %llu "
-		       "state %lu in tree %p refs %d\n",
+		pr_err("state leak: start %llu end %llu state %lu in tree %p refs %d\n",
 		       (unsigned long long)state->start,
 		       (unsigned long long)state->end,
 		       state->state, state->tree, atomic_read(&state->refs));
@@ -70,8 +71,8 @@ void btrfs_leak_debug_check(void)
 
 	while (!list_empty(&buffers)) {
 		eb = list_entry(buffers.next, struct extent_buffer, leak_list);
-		printk(KERN_ERR "btrfs buffer leak start %llu len %lu "
-		       "refs %d\n", (unsigned long long)eb->start,
+		pr_err("buffer leak start %llu len %lu refs %d\n",
+		       (unsigned long long)eb->start,
 		       eb->len, atomic_read(&eb->refs));
 		list_del(&eb->leak_list);
 		kmem_cache_free(extent_buffer_cache, eb);
@@ -399,8 +400,8 @@ static int insert_state(struct extent_io_tree *tree,
 	if (node) {
 		struct extent_state *found;
 		found = rb_entry(node, struct extent_state, rb_node);
-		printk(KERN_ERR "btrfs found node %llu %llu on insert of "
-		       "%llu %llu\n", (unsigned long long)found->start,
+		pr_err("found node %llu %llu on insert of %llu %llu\n",
+		       (unsigned long long)found->start,
 		       (unsigned long long)found->end,
 		       (unsigned long long)start, (unsigned long long)end);
 		return -EEXIST;
@@ -3187,8 +3188,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
 
 			set_range_writeback(tree, cur, cur + iosize - 1);
 			if (!PageWriteback(page)) {
-				printk(KERN_ERR "btrfs warning page %lu not "
-				       "writeback, cur %llu end %llu\n",
+				pr_err("warning page %lu not writeback, cur %llu end %llu\n",
 				       page->index, (unsigned long long)cur,
 				       (unsigned long long)end);
 			}
@@ -5007,13 +5007,13 @@ void memcpy_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset,
 	unsigned long src_i;
 
 	if (src_offset + len > dst->len) {
-		printk(KERN_ERR "btrfs memmove bogus src_offset %lu move "
-		       "len %lu dst len %lu\n", src_offset, len, dst->len);
+		pr_err("memmove bogus src_offset %lu move len %lu dst len %lu\n",
+		       src_offset, len, dst->len);
 		BUG_ON(1);
 	}
 	if (dst_offset + len > dst->len) {
-		printk(KERN_ERR "btrfs memmove bogus dst_offset %lu move "
-		       "len %lu dst len %lu\n", dst_offset, len, dst->len);
+		pr_err("memmove bogus dst_offset %lu move len %lu dst len %lu\n",
+		       dst_offset, len, dst->len);
 		BUG_ON(1);
 	}
 
@@ -5054,13 +5054,13 @@ void memmove_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset,
 	unsigned long src_i;
 
 	if (src_offset + len > dst->len) {
-		printk(KERN_ERR "btrfs memmove bogus src_offset %lu move "
-		       "len %lu len %lu\n", src_offset, len, dst->len);
+		pr_err("memmove bogus src_offset %lu move len %lu len %lu\n",
+		       src_offset, len, dst->len);
 		BUG_ON(1);
 	}
 	if (dst_offset + len > dst->len) {
-		printk(KERN_ERR "btrfs memmove bogus dst_offset %lu move "
-		       "len %lu len %lu\n", dst_offset, len, dst->len);
+		pr_err("memmove bogus dst_offset %lu move len %lu len %lu\n",
+		       dst_offset, len, dst->len);
 		BUG_ON(1);
 	}
 	if (dst_offset < src_offset) {
fs/btrfs/file-item.c +6 -5
index a7bfc95..28bf52e 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/bio.h>
 #include <linux/slab.h>
 #include <linux/pagemap.h>
@@ -220,11 +222,10 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
 						offset + bvec->bv_len - 1,
 						EXTENT_NODATASUM, GFP_NOFS);
 				} else {
-					printk(KERN_INFO "btrfs no csum found "
-					       "for inode %llu start %llu\n",
-					       (unsigned long long)
-					       btrfs_ino(inode),
-					       (unsigned long long)offset);
+					pr_info("no csum found for inode %llu start %llu\n",
+						(unsigned long long)
+						btrfs_ino(inode),
+						(unsigned long long)offset);
 				}
 				item = NULL;
 				btrfs_release_path(path);
fs/btrfs/free-space-cache.c +15 -17
index b21a3cd..1b33bd9 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/pagemap.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -350,8 +352,7 @@ static int io_ctl_prepare_pages(struct io_ctl *io_ctl, struct inode *inode,
 			btrfs_readpage(NULL, page);
 			lock_page(page);
 			if (!PageUptodate(page)) {
-				printk(KERN_ERR "btrfs: error reading free "
-				       "space cache\n");
+				pr_err("error reading free space cache\n");
 				io_ctl_drop_pages(io_ctl);
 				return -EIO;
 			}
@@ -408,9 +409,8 @@ static int io_ctl_check_generation(struct io_ctl *io_ctl, u64 generation)
 
 	gen = io_ctl->cur;
 	if (le64_to_cpu(*gen) != generation) {
-		printk_ratelimited(KERN_ERR "btrfs: space cache generation "
-				   "(%Lu) does not match inode (%Lu)\n", *gen,
-				   generation);
+		pr_err_ratelimited("space cache generation (%llu) does not match inode (%llu)\n",
+				   *gen, generation);
 		io_ctl_unmap_page(io_ctl);
 		return -EIO;
 	}
@@ -466,8 +466,7 @@ static int io_ctl_check_crc(struct io_ctl *io_ctl, int index)
 			      PAGE_CACHE_SIZE - offset);
 	btrfs_csum_final(crc, (char *)&crc);
 	if (val != crc) {
-		printk_ratelimited(KERN_ERR "btrfs: csum mismatch on free "
-				   "space cache\n");
+		pr_err_ratelimited("csum mismatch on free space cache\n");
 		io_ctl_unmap_page(io_ctl);
 		return -EIO;
 	}
@@ -1881,7 +1880,7 @@ out:
 	spin_unlock(&ctl->tree_lock);
 
 	if (ret) {
-		printk(KERN_CRIT "btrfs: unable to add free space :%d\n", ret);
+		pr_crit("unable to add free space :%d\n", ret);
 		BUG_ON(ret == -EEXIST);
 	}
 
@@ -1990,15 +1989,14 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,
 		info = rb_entry(n, struct btrfs_free_space, offset_index);
 		if (info->bytes >= bytes && !block_group->ro)
 			count++;
-		printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n",
-		       (unsigned long long)info->offset,
-		       (unsigned long long)info->bytes,
-		       (info->bitmap) ? "yes" : "no");
+		pr_crit("entry offset %llu, bytes %llu, bitmap %s\n",
+			(unsigned long long)info->offset,
+			(unsigned long long)info->bytes,
+			(info->bitmap) ? "yes" : "no");
 	}
-	printk(KERN_INFO "block group has cluster?: %s\n",
-	       list_empty(&block_group->cluster_list) ? "no" : "yes");
-	printk(KERN_INFO "%d blocks of free space at or bigger than bytes is"
-	       "\n", count);
+	pr_info("block group has cluster?: %s\n",
+		list_empty(&block_group->cluster_list) ? "no" : "yes");
+	pr_info("%d blocks of free space at or bigger than bytes is\n", count);
 }
 
 void btrfs_init_free_space_ctl(struct btrfs_block_group_cache *block_group)
@@ -3150,7 +3148,7 @@ again:
 	return 0;
 }
 
-#define test_msg(fmt, ...) printk(KERN_INFO "btrfs: selftest: " fmt, ##__VA_ARGS__)
+#define test_msg(fmt, ...) pr_info("selftest: " fmt, ##__VA_ARGS__)
 
 /*
  * This test just does basic sanity checking, making sure we can add an exten
fs/btrfs/inode.c +5 -4
index 6d1b93c..b5e6a49 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/bio.h>
 #include <linux/buffer_head.h>
@@ -6932,10 +6934,9 @@ static void btrfs_end_dio_bio(struct bio *bio, int err)
 	struct btrfs_dio_private *dip = bio->bi_private;
 
 	if (err) {
-		printk(KERN_ERR "btrfs direct IO failed ino %llu rw %lu "
-		      "sector %#Lx len %u err no %d\n",
-		      (unsigned long long)btrfs_ino(dip->inode), bio->bi_rw,
-		      (unsigned long long)bio->bi_sector, bio->bi_size, err);
+		pr_err("direct IO failed ino %llu rw %lu sector %#Lx len %u err no %d\n",
+		       (unsigned long long)btrfs_ino(dip->inode), bio->bi_rw,
+		       (unsigned long long)bio->bi_sector, bio->bi_size, err);
 		dip->errors = 1;
 
 		/*
fs/btrfs/ioctl.c +17 -20
index 238a055..0d07134 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/bio.h>
 #include <linux/buffer_head.h>
@@ -1377,7 +1379,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
 
 	if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
 			1)) {
-		pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
+		pr_info("dev add/delete/balance/replace/resize operation in progress\n");
 		mnt_drop_write_file(file);
 		return -EINVAL;
 	}
@@ -1403,22 +1405,20 @@ static noinline int btrfs_ioctl_resize(struct file *file,
 			ret = -EINVAL;
 			goto out_free;
 		}
-		printk(KERN_INFO "btrfs: resizing devid %llu\n",
-		       (unsigned long long)devid);
+		pr_info("resizing devid %llu\n", (unsigned long long)devid);
 	}
 
 	device = btrfs_find_device(root->fs_info, devid, NULL, NULL);
 	if (!device) {
-		printk(KERN_INFO "btrfs: resizer unable to find device %llu\n",
-		       (unsigned long long)devid);
+		pr_info("resizer unable to find device %llu\n",
+			(unsigned long long)devid);
 		ret = -ENODEV;
 		goto out_free;
 	}
 
 	if (!device->writeable) {
-		printk(KERN_INFO "btrfs: resizer unable to apply on "
-		       "readonly device %llu\n",
-		       (unsigned long long)devid);
+		pr_info("resizer unable to apply on readonly device %llu\n",
+			(unsigned long long)devid);
 		ret = -EPERM;
 		goto out_free;
 	}
@@ -1531,8 +1531,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
 
 		src_inode = file_inode(src.file);
 		if (src_inode->i_sb != file_inode(file)->i_sb) {
-			printk(KERN_INFO "btrfs: Snapshot src from "
-			       "another FS\n");
+			pr_info("Snapshot src from another FS\n");
 			ret = -EINVAL;
 		} else {
 			ret = btrfs_mksubvol(&file->f_path, name, namelen,
@@ -1885,8 +1884,7 @@ static noinline int search_ioctl(struct inode *inode,
 		key.offset = (u64)-1;
 		root = btrfs_read_fs_root_no_name(info, &key);
 		if (IS_ERR(root)) {
-			printk(KERN_ERR "could not find root %llu\n",
-			       sk->tree_id);
+			pr_err("could not find root %llu\n", sk->tree_id);
 			btrfs_free_path(path);
 			return -ENOENT;
 		}
@@ -1980,7 +1978,7 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
 	key.offset = (u64)-1;
 	root = btrfs_read_fs_root_no_name(info, &key);
 	if (IS_ERR(root)) {
-		printk(KERN_ERR "could not find root %llu\n", tree_id);
+		pr_err("could not find root %llu\n", tree_id);
 		ret = -ENOENT;
 		goto out;
 	}
@@ -2326,7 +2324,7 @@ static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg)
 
 	if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
 			1)) {
-		pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
+		pr_info("dev add/delete/balance/replace/resize operation in progress\n");
 		return -EINVAL;
 	}
 
@@ -2989,8 +2987,7 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
 	if (IS_ERR_OR_NULL(di)) {
 		btrfs_free_path(path);
 		btrfs_end_transaction(trans, root);
-		printk(KERN_ERR "Umm, you don't have the default dir item, "
-		       "this isn't going to work\n");
+		pr_err("Umm, you don't have the default dir item, this isn't going to work\n");
 		ret = -ENOENT;
 		goto out;
 	}
@@ -3315,7 +3312,7 @@ static long btrfs_ioctl_dev_replace(struct btrfs_root *root, void __user *arg)
 		if (atomic_xchg(
 			&root->fs_info->mutually_exclusive_operation_running,
 			1)) {
-			pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
+			pr_info("dev add/delete/balance/replace/resize operation in progress\n");
 			ret = -EINPROGRESS;
 		} else {
 			ret = btrfs_dev_replace_start(root, p);
@@ -3560,7 +3557,7 @@ again:
 	} else {
 		/* this is (1) */
 		mutex_unlock(&fs_info->balance_mutex);
-		pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
+		pr_info("dev add/delete/balance/replace/resize operation in progress\n");
 		ret = -EINVAL;
 		goto out;
 	}
@@ -4046,7 +4043,7 @@ static int btrfs_ioctl_get_fslabel(struct file *file, void __user *arg)
 	int ret;
 
 	if (len == BTRFS_LABEL_SIZE) {
-		pr_warn("btrfs: label is too long, return the first %zu bytes\n",
+		pr_warn("label is too long, return the first %zu bytes\n",
 			--len);
 	}
 
@@ -4072,7 +4069,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
 		return -EFAULT;
 
 	if (strnlen(label, BTRFS_LABEL_SIZE) == BTRFS_LABEL_SIZE) {
-		pr_err("btrfs: unable to set label with more than %d bytes\n",
+		pr_err("unable to set label with more than %d bytes\n",
 		       BTRFS_LABEL_SIZE - 1);
 		return -EINVAL;
 	}
fs/btrfs/lzo.c +5 -3
index f93151a..9e49778 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
@@ -141,7 +143,7 @@ static int lzo_compress_pages(struct list_head *ws,
 		ret = lzo1x_1_compress(data_in, in_len, workspace->cbuf,
 				       &out_len, workspace->mem);
 		if (ret != LZO_E_OK) {
-			printk(KERN_DEBUG "btrfs deflate in loop returned %d\n",
+			printk(KERN_DEBUG "btrfs: deflate in loop returned %d\n",
 			       ret);
 			ret = -1;
 			goto out;
@@ -355,7 +357,7 @@ cont:
 		if (need_unmap)
 			kunmap(pages_in[page_in_index - 1]);
 		if (ret != LZO_E_OK) {
-			printk(KERN_WARNING "btrfs decompress failed\n");
+			pr_warn("decompress failed\n");
 			ret = -1;
 			break;
 		}
@@ -399,7 +401,7 @@ static int lzo_decompress(struct list_head *ws, unsigned char *data_in,
 	out_len = PAGE_CACHE_SIZE;
 	ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len);
 	if (ret != LZO_E_OK) {
-		printk(KERN_WARNING "btrfs decompress failed!\n");
+		pr_warn("decompress failed!\n");
 		ret = -1;
 		goto out;
 	}
fs/btrfs/ordered-data.c +11 -9
index 8136982..df6558c 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include <linux/blkdev.h>
 #include <linux/writeback.h>
@@ -335,15 +337,15 @@ int btrfs_dec_test_first_ordered_pending(struct inode *inode,
 		      entry->len);
 	*file_offset = dec_end;
 	if (dec_start > dec_end) {
-		printk(KERN_CRIT "bad ordering dec_start %llu end %llu\n",
-		       (unsigned long long)dec_start,
-		       (unsigned long long)dec_end);
+		pr_crit("bad ordering dec_start %llu end %llu\n",
+			(unsigned long long)dec_start,
+			(unsigned long long)dec_end);
 	}
 	to_dec = dec_end - dec_start;
 	if (to_dec > entry->bytes_left) {
-		printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n",
-		       (unsigned long long)entry->bytes_left,
-		       (unsigned long long)to_dec);
+		pr_crit("bad ordered accounting left %llu size %llu\n",
+			(unsigned long long)entry->bytes_left,
+			(unsigned long long)to_dec);
 	}
 	entry->bytes_left -= to_dec;
 	if (!uptodate)
@@ -402,9 +404,9 @@ have_entry:
 	}
 
 	if (io_size > entry->bytes_left) {
-		printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n",
-		       (unsigned long long)entry->bytes_left,
-		       (unsigned long long)io_size);
+		pr_crit("bad ordered accounting left %llu size %llu\n",
+			(unsigned long long)entry->bytes_left,
+			(unsigned long long)io_size);
 	}
 	entry->bytes_left -= io_size;
 	if (!uptodate)
fs/btrfs/print-tree.c +85 -93

296 lines not on this page · raw message

fs/btrfs/qgroup.c +15 -17
index 1280eff..1865b42 100644
@@ -16,6 +16,8 @@
  * Boston, MA 021110-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/sched.h>
 #include <linux/pagemap.h>
 #include <linux/writeback.h>
@@ -297,16 +299,13 @@ int btrfs_read_qgroup_config(struct btrfs_fs_info *fs_info)
 
 			if (btrfs_qgroup_status_version(l, ptr) !=
 			    BTRFS_QGROUP_STATUS_VERSION) {
-				printk(KERN_ERR
-				 "btrfs: old qgroup version, quota disabled\n");
+				pr_err("old qgroup version, quota disabled\n");
 				goto out;
 			}
 			if (btrfs_qgroup_status_generation(l, ptr) !=
 			    fs_info->generation) {
 				flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

fs/btrfs/reada.c +14 -12
index 1031b69..61da78b 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/relocation.c +6 -4
index 1209649..ca2d62a 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/root-tree.c +6 -9
index ffb1036..0465268 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/scrub.c +10 -16
index 4ba2a69..57e9dec 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/send.c +5 -6
index d3f3b43..922bd28 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/super.c +42 -52

94 lines not on this page · raw message

fs/btrfs/transaction.c +3 -2
index d58cce7..01e25bf 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/volumes.c +24 -32

56 lines not on this page · raw message

fs/btrfs/zlib.c +5 -3
index 9acb846..b14486f 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.