mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	btrfs: convert printk(KERN_* to use pr_* calls
This patch converts printk(KERN_* style messages to use the pr_* versions. One side effect is that anything that was KERN_DEBUG is now automatically a dynamic debug message. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									5d163e0e68
								
							
						
					
					
						commit
						62e855771d
					
				
					 16 changed files with 205 additions and 275 deletions
				
			
		| 
						 | 
					@ -656,7 +656,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 | 
				
			||||||
	BUG_ON(NULL == state);
 | 
						BUG_ON(NULL == state);
 | 
				
			||||||
	selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS);
 | 
						selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS);
 | 
				
			||||||
	if (NULL == selected_super) {
 | 
						if (NULL == selected_super) {
 | 
				
			||||||
		printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
 | 
							pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
		return -ENOMEM;
 | 
							return -ENOMEM;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -681,7 +681,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (NULL == state->latest_superblock) {
 | 
						if (NULL == state->latest_superblock) {
 | 
				
			||||||
		printk(KERN_INFO "btrfsic: no superblock found!\n");
 | 
							pr_info("btrfsic: no superblock found!\n");
 | 
				
			||||||
		kfree(selected_super);
 | 
							kfree(selected_super);
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -698,13 +698,13 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 | 
				
			||||||
			next_bytenr = btrfs_super_root(selected_super);
 | 
								next_bytenr = btrfs_super_root(selected_super);
 | 
				
			||||||
			if (state->print_mask &
 | 
								if (state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
								    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
				
			||||||
				printk(KERN_INFO "root@%llu\n", next_bytenr);
 | 
									pr_info("root@%llu\n", next_bytenr);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 1:
 | 
							case 1:
 | 
				
			||||||
			next_bytenr = btrfs_super_chunk_root(selected_super);
 | 
								next_bytenr = btrfs_super_chunk_root(selected_super);
 | 
				
			||||||
			if (state->print_mask &
 | 
								if (state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
								    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
				
			||||||
				printk(KERN_INFO "chunk@%llu\n", next_bytenr);
 | 
									pr_info("chunk@%llu\n", next_bytenr);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 2:
 | 
							case 2:
 | 
				
			||||||
			next_bytenr = btrfs_super_log_root(selected_super);
 | 
								next_bytenr = btrfs_super_log_root(selected_super);
 | 
				
			||||||
| 
						 | 
					@ -712,7 +712,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			if (state->print_mask &
 | 
								if (state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
								    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
				
			||||||
				printk(KERN_INFO "log@%llu\n", next_bytenr);
 | 
									pr_info("log@%llu\n", next_bytenr);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -720,7 +720,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 | 
				
			||||||
		    btrfs_num_copies(state->root->fs_info,
 | 
							    btrfs_num_copies(state->root->fs_info,
 | 
				
			||||||
				     next_bytenr, state->metablock_size);
 | 
									     next_bytenr, state->metablock_size);
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
				
			||||||
			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
 | 
								pr_info("num_copies(log_bytenr=%llu) = %d\n",
 | 
				
			||||||
			       next_bytenr, num_copies);
 | 
								       next_bytenr, num_copies);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
							for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
				
			||||||
| 
						 | 
					@ -733,7 +733,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 | 
				
			||||||
						&tmp_next_block_ctx,
 | 
											&tmp_next_block_ctx,
 | 
				
			||||||
						mirror_num);
 | 
											mirror_num);
 | 
				
			||||||
			if (ret) {
 | 
								if (ret) {
 | 
				
			||||||
				printk(KERN_INFO "btrfsic: btrfsic_map_block(root @%llu, mirror %d) failed!\n",
 | 
									pr_info("btrfsic: btrfsic_map_block(root @%llu, mirror %d) failed!\n",
 | 
				
			||||||
				       next_bytenr, mirror_num);
 | 
									       next_bytenr, mirror_num);
 | 
				
			||||||
				kfree(selected_super);
 | 
									kfree(selected_super);
 | 
				
			||||||
				return -1;
 | 
									return -1;
 | 
				
			||||||
| 
						 | 
					@ -756,8 +756,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ret = btrfsic_read_block(state, &tmp_next_block_ctx);
 | 
								ret = btrfsic_read_block(state, &tmp_next_block_ctx);
 | 
				
			||||||
			if (ret < (int)PAGE_SIZE) {
 | 
								if (ret < (int)PAGE_SIZE) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: read @logical %llu failed!\n",
 | 
				
			||||||
				       "btrfsic: read @logical %llu failed!\n",
 | 
					 | 
				
			||||||
				       tmp_next_block_ctx.start);
 | 
									       tmp_next_block_ctx.start);
 | 
				
			||||||
				btrfsic_release_block_ctx(&tmp_next_block_ctx);
 | 
									btrfsic_release_block_ctx(&tmp_next_block_ctx);
 | 
				
			||||||
				kfree(selected_super);
 | 
									kfree(selected_super);
 | 
				
			||||||
| 
						 | 
					@ -818,7 +817,7 @@ static int btrfsic_process_superblock_dev_mirror(
 | 
				
			||||||
	if (NULL == superblock_tmp) {
 | 
						if (NULL == superblock_tmp) {
 | 
				
			||||||
		superblock_tmp = btrfsic_block_alloc();
 | 
							superblock_tmp = btrfsic_block_alloc();
 | 
				
			||||||
		if (NULL == superblock_tmp) {
 | 
							if (NULL == superblock_tmp) {
 | 
				
			||||||
			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
 | 
								pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
			brelse(bh);
 | 
								brelse(bh);
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -892,7 +891,7 @@ static int btrfsic_process_superblock_dev_mirror(
 | 
				
			||||||
		    btrfs_num_copies(state->root->fs_info,
 | 
							    btrfs_num_copies(state->root->fs_info,
 | 
				
			||||||
				     next_bytenr, state->metablock_size);
 | 
									     next_bytenr, state->metablock_size);
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
				
			||||||
			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
 | 
								pr_info("num_copies(log_bytenr=%llu) = %d\n",
 | 
				
			||||||
			       next_bytenr, num_copies);
 | 
								       next_bytenr, num_copies);
 | 
				
			||||||
		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
							for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
				
			||||||
			struct btrfsic_block *next_block;
 | 
								struct btrfsic_block *next_block;
 | 
				
			||||||
| 
						 | 
					@ -903,7 +902,7 @@ static int btrfsic_process_superblock_dev_mirror(
 | 
				
			||||||
					      state->metablock_size,
 | 
										      state->metablock_size,
 | 
				
			||||||
					      &tmp_next_block_ctx,
 | 
										      &tmp_next_block_ctx,
 | 
				
			||||||
					      mirror_num)) {
 | 
										      mirror_num)) {
 | 
				
			||||||
				printk(KERN_INFO "btrfsic: btrfsic_map_block(bytenr @%llu, mirror %d) failed!\n",
 | 
									pr_info("btrfsic: btrfsic_map_block(bytenr @%llu, mirror %d) failed!\n",
 | 
				
			||||||
				       next_bytenr, mirror_num);
 | 
									       next_bytenr, mirror_num);
 | 
				
			||||||
				brelse(bh);
 | 
									brelse(bh);
 | 
				
			||||||
				return -1;
 | 
									return -1;
 | 
				
			||||||
| 
						 | 
					@ -945,7 +944,7 @@ static struct btrfsic_stack_frame *btrfsic_stack_frame_alloc(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sf = kzalloc(sizeof(*sf), GFP_NOFS);
 | 
						sf = kzalloc(sizeof(*sf), GFP_NOFS);
 | 
				
			||||||
	if (NULL == sf)
 | 
						if (NULL == sf)
 | 
				
			||||||
		printk(KERN_INFO "btrfsic: alloc memory failed!\n");
 | 
							pr_info("btrfsic: alloc memory failed!\n");
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER;
 | 
							sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER;
 | 
				
			||||||
	return sf;
 | 
						return sf;
 | 
				
			||||||
| 
						 | 
					@ -991,8 +990,7 @@ static int btrfsic_process_metablock(
 | 
				
			||||||
			sf->nr = btrfs_stack_header_nritems(&leafhdr->header);
 | 
								sf->nr = btrfs_stack_header_nritems(&leafhdr->header);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("leaf %llu items %d generation %llu owner %llu\n",
 | 
				
			||||||
				       "leaf %llu items %d generation %llu owner %llu\n",
 | 
					 | 
				
			||||||
				       sf->block_ctx->start, sf->nr,
 | 
									       sf->block_ctx->start, sf->nr,
 | 
				
			||||||
				       btrfs_stack_header_generation(
 | 
									       btrfs_stack_header_generation(
 | 
				
			||||||
					       &leafhdr->header),
 | 
										       &leafhdr->header),
 | 
				
			||||||
| 
						 | 
					@ -1019,8 +1017,7 @@ static int btrfsic_process_metablock(
 | 
				
			||||||
			if (disk_item_offset + sizeof(struct btrfs_item) >
 | 
								if (disk_item_offset + sizeof(struct btrfs_item) >
 | 
				
			||||||
			    sf->block_ctx->len) {
 | 
								    sf->block_ctx->len) {
 | 
				
			||||||
leaf_item_out_of_bounce_error:
 | 
					leaf_item_out_of_bounce_error:
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: leaf item out of bounce at logical %llu, dev %s\n",
 | 
				
			||||||
				       "btrfsic: leaf item out of bounce at logical %llu, dev %s\n",
 | 
					 | 
				
			||||||
				       sf->block_ctx->start,
 | 
									       sf->block_ctx->start,
 | 
				
			||||||
				       sf->block_ctx->dev->name);
 | 
									       sf->block_ctx->dev->name);
 | 
				
			||||||
				goto one_stack_frame_backwards;
 | 
									goto one_stack_frame_backwards;
 | 
				
			||||||
| 
						 | 
					@ -1116,7 +1113,7 @@ static int btrfsic_process_metablock(
 | 
				
			||||||
			sf->nr = btrfs_stack_header_nritems(&nodehdr->header);
 | 
								sf->nr = btrfs_stack_header_nritems(&nodehdr->header);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO "node %llu level %d items %d generation %llu owner %llu\n",
 | 
									pr_info("node %llu level %d items %d generation %llu owner %llu\n",
 | 
				
			||||||
				       sf->block_ctx->start,
 | 
									       sf->block_ctx->start,
 | 
				
			||||||
				       nodehdr->header.level, sf->nr,
 | 
									       nodehdr->header.level, sf->nr,
 | 
				
			||||||
				       btrfs_stack_header_generation(
 | 
									       btrfs_stack_header_generation(
 | 
				
			||||||
| 
						 | 
					@ -1140,8 +1137,7 @@ static int btrfsic_process_metablock(
 | 
				
			||||||
					  (uintptr_t)nodehdr;
 | 
										  (uintptr_t)nodehdr;
 | 
				
			||||||
			if (key_ptr_offset + sizeof(struct btrfs_key_ptr) >
 | 
								if (key_ptr_offset + sizeof(struct btrfs_key_ptr) >
 | 
				
			||||||
			    sf->block_ctx->len) {
 | 
								    sf->block_ctx->len) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: node item out of bounce at logical %llu, dev %s\n",
 | 
				
			||||||
				       "btrfsic: node item out of bounce at logical %llu, dev %s\n",
 | 
					 | 
				
			||||||
				       sf->block_ctx->start,
 | 
									       sf->block_ctx->start,
 | 
				
			||||||
				       sf->block_ctx->dev->name);
 | 
									       sf->block_ctx->dev->name);
 | 
				
			||||||
				goto one_stack_frame_backwards;
 | 
									goto one_stack_frame_backwards;
 | 
				
			||||||
| 
						 | 
					@ -1270,7 +1266,7 @@ static int btrfsic_create_link_to_next_block(
 | 
				
			||||||
		    btrfs_num_copies(state->root->fs_info,
 | 
							    btrfs_num_copies(state->root->fs_info,
 | 
				
			||||||
				     next_bytenr, state->metablock_size);
 | 
									     next_bytenr, state->metablock_size);
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
				
			||||||
			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
 | 
								pr_info("num_copies(log_bytenr=%llu) = %d\n",
 | 
				
			||||||
			       next_bytenr, *num_copiesp);
 | 
								       next_bytenr, *num_copiesp);
 | 
				
			||||||
		*mirror_nump = 1;
 | 
							*mirror_nump = 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1279,15 +1275,13 @@ static int btrfsic_create_link_to_next_block(
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
						if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic_create_link_to_next_block(mirror_num=%d)\n",
 | 
				
			||||||
		       "btrfsic_create_link_to_next_block(mirror_num=%d)\n",
 | 
					 | 
				
			||||||
		       *mirror_nump);
 | 
							       *mirror_nump);
 | 
				
			||||||
	ret = btrfsic_map_block(state, next_bytenr,
 | 
						ret = btrfsic_map_block(state, next_bytenr,
 | 
				
			||||||
				state->metablock_size,
 | 
									state->metablock_size,
 | 
				
			||||||
				next_block_ctx, *mirror_nump);
 | 
									next_block_ctx, *mirror_nump);
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
 | 
				
			||||||
		       "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
 | 
					 | 
				
			||||||
		       next_bytenr, *mirror_nump);
 | 
							       next_bytenr, *mirror_nump);
 | 
				
			||||||
		btrfsic_release_block_ctx(next_block_ctx);
 | 
							btrfsic_release_block_ctx(next_block_ctx);
 | 
				
			||||||
		*next_blockp = NULL;
 | 
							*next_blockp = NULL;
 | 
				
			||||||
| 
						 | 
					@ -1313,16 +1307,14 @@ static int btrfsic_create_link_to_next_block(
 | 
				
			||||||
			if (next_block->logical_bytenr != next_bytenr &&
 | 
								if (next_block->logical_bytenr != next_bytenr &&
 | 
				
			||||||
			    !(!next_block->is_metadata &&
 | 
								    !(!next_block->is_metadata &&
 | 
				
			||||||
			      0 == next_block->logical_bytenr))
 | 
								      0 == next_block->logical_bytenr))
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
 | 
				
			||||||
				       "Referenced block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
 | 
					 | 
				
			||||||
				       next_bytenr, next_block_ctx->dev->name,
 | 
									       next_bytenr, next_block_ctx->dev->name,
 | 
				
			||||||
				       next_block_ctx->dev_bytenr, *mirror_nump,
 | 
									       next_block_ctx->dev_bytenr, *mirror_nump,
 | 
				
			||||||
				       btrfsic_get_block_type(state,
 | 
									       btrfsic_get_block_type(state,
 | 
				
			||||||
							      next_block),
 | 
												      next_block),
 | 
				
			||||||
				       next_block->logical_bytenr);
 | 
									       next_block->logical_bytenr);
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, %c.\n",
 | 
				
			||||||
				       "Referenced block @%llu (%s/%llu/%d) found in hash table, %c.\n",
 | 
					 | 
				
			||||||
				       next_bytenr, next_block_ctx->dev->name,
 | 
									       next_bytenr, next_block_ctx->dev->name,
 | 
				
			||||||
				       next_block_ctx->dev_bytenr, *mirror_nump,
 | 
									       next_block_ctx->dev_bytenr, *mirror_nump,
 | 
				
			||||||
				       btrfsic_get_block_type(state,
 | 
									       btrfsic_get_block_type(state,
 | 
				
			||||||
| 
						 | 
					@ -1343,7 +1335,7 @@ static int btrfsic_create_link_to_next_block(
 | 
				
			||||||
	if (NULL == l) {
 | 
						if (NULL == l) {
 | 
				
			||||||
		l = btrfsic_block_link_alloc();
 | 
							l = btrfsic_block_link_alloc();
 | 
				
			||||||
		if (NULL == l) {
 | 
							if (NULL == l) {
 | 
				
			||||||
			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
 | 
								pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
			btrfsic_release_block_ctx(next_block_ctx);
 | 
								btrfsic_release_block_ctx(next_block_ctx);
 | 
				
			||||||
			*next_blockp = NULL;
 | 
								*next_blockp = NULL;
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
| 
						 | 
					@ -1376,8 +1368,7 @@ static int btrfsic_create_link_to_next_block(
 | 
				
			||||||
	if (limit_nesting > 0 && did_alloc_block_link) {
 | 
						if (limit_nesting > 0 && did_alloc_block_link) {
 | 
				
			||||||
		ret = btrfsic_read_block(state, next_block_ctx);
 | 
							ret = btrfsic_read_block(state, next_block_ctx);
 | 
				
			||||||
		if (ret < (int)next_block_ctx->len) {
 | 
							if (ret < (int)next_block_ctx->len) {
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: read block @logical %llu failed!\n",
 | 
				
			||||||
			       "btrfsic: read block @logical %llu failed!\n",
 | 
					 | 
				
			||||||
			       next_bytenr);
 | 
								       next_bytenr);
 | 
				
			||||||
			btrfsic_release_block_ctx(next_block_ctx);
 | 
								btrfsic_release_block_ctx(next_block_ctx);
 | 
				
			||||||
			*next_blockp = NULL;
 | 
								*next_blockp = NULL;
 | 
				
			||||||
| 
						 | 
					@ -1412,8 +1403,7 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
	if (file_extent_item_offset +
 | 
						if (file_extent_item_offset +
 | 
				
			||||||
	    offsetof(struct btrfs_file_extent_item, disk_num_bytes) >
 | 
						    offsetof(struct btrfs_file_extent_item, disk_num_bytes) >
 | 
				
			||||||
	    block_ctx->len) {
 | 
						    block_ctx->len) {
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic: file item out of bounce at logical %llu, dev %s\n",
 | 
				
			||||||
		       "btrfsic: file item out of bounce at logical %llu, dev %s\n",
 | 
					 | 
				
			||||||
		       block_ctx->start, block_ctx->dev->name);
 | 
							       block_ctx->start, block_ctx->dev->name);
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1424,7 +1414,7 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
	if (BTRFS_FILE_EXTENT_REG != file_extent_item.type ||
 | 
						if (BTRFS_FILE_EXTENT_REG != file_extent_item.type ||
 | 
				
			||||||
	    btrfs_stack_file_extent_disk_bytenr(&file_extent_item) == 0) {
 | 
						    btrfs_stack_file_extent_disk_bytenr(&file_extent_item) == 0) {
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu\n",
 | 
								pr_info("extent_data: type %u, disk_bytenr = %llu\n",
 | 
				
			||||||
			       file_extent_item.type,
 | 
								       file_extent_item.type,
 | 
				
			||||||
			       btrfs_stack_file_extent_disk_bytenr(
 | 
								       btrfs_stack_file_extent_disk_bytenr(
 | 
				
			||||||
			       &file_extent_item));
 | 
								       &file_extent_item));
 | 
				
			||||||
| 
						 | 
					@ -1433,8 +1423,7 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (file_extent_item_offset + sizeof(struct btrfs_file_extent_item) >
 | 
						if (file_extent_item_offset + sizeof(struct btrfs_file_extent_item) >
 | 
				
			||||||
	    block_ctx->len) {
 | 
						    block_ctx->len) {
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic: file item out of bounce at logical %llu, dev %s\n",
 | 
				
			||||||
		       "btrfsic: file item out of bounce at logical %llu, dev %s\n",
 | 
					 | 
				
			||||||
		       block_ctx->start, block_ctx->dev->name);
 | 
							       block_ctx->start, block_ctx->dev->name);
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1452,7 +1441,7 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
	generation = btrfs_stack_file_extent_generation(&file_extent_item);
 | 
						generation = btrfs_stack_file_extent_generation(&file_extent_item);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
 | 
						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",
 | 
							pr_info("extent_data: type %u, disk_bytenr = %llu, offset = %llu, num_bytes = %llu\n",
 | 
				
			||||||
		       file_extent_item.type,
 | 
							       file_extent_item.type,
 | 
				
			||||||
		       btrfs_stack_file_extent_disk_bytenr(&file_extent_item),
 | 
							       btrfs_stack_file_extent_disk_bytenr(&file_extent_item),
 | 
				
			||||||
		       btrfs_stack_file_extent_offset(&file_extent_item),
 | 
							       btrfs_stack_file_extent_offset(&file_extent_item),
 | 
				
			||||||
| 
						 | 
					@ -1471,7 +1460,7 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
		    btrfs_num_copies(state->root->fs_info,
 | 
							    btrfs_num_copies(state->root->fs_info,
 | 
				
			||||||
				     next_bytenr, state->datablock_size);
 | 
									     next_bytenr, state->datablock_size);
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
				
			||||||
			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
 | 
								pr_info("num_copies(log_bytenr=%llu) = %d\n",
 | 
				
			||||||
			       next_bytenr, num_copies);
 | 
								       next_bytenr, num_copies);
 | 
				
			||||||
		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
							for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
				
			||||||
			struct btrfsic_block_data_ctx next_block_ctx;
 | 
								struct btrfsic_block_data_ctx next_block_ctx;
 | 
				
			||||||
| 
						 | 
					@ -1479,17 +1468,16 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
			int block_was_created;
 | 
								int block_was_created;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO "btrfsic_handle_extent_data(mirror_num=%d)\n", mirror_num);
 | 
									pr_info("btrfsic_handle_extent_data(mirror_num=%d)\n",
 | 
				
			||||||
 | 
										mirror_num);
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("\tdisk_bytenr = %llu, num_bytes %u\n",
 | 
				
			||||||
				       "\tdisk_bytenr = %llu, num_bytes %u\n",
 | 
					 | 
				
			||||||
				       next_bytenr, chunk_len);
 | 
									       next_bytenr, chunk_len);
 | 
				
			||||||
			ret = btrfsic_map_block(state, next_bytenr,
 | 
								ret = btrfsic_map_block(state, next_bytenr,
 | 
				
			||||||
						chunk_len, &next_block_ctx,
 | 
											chunk_len, &next_block_ctx,
 | 
				
			||||||
						mirror_num);
 | 
											mirror_num);
 | 
				
			||||||
			if (ret) {
 | 
								if (ret) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
 | 
				
			||||||
				       "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
 | 
					 | 
				
			||||||
				       next_bytenr, mirror_num);
 | 
									       next_bytenr, mirror_num);
 | 
				
			||||||
				return -1;
 | 
									return -1;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -1504,8 +1492,7 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
					mirror_num,
 | 
										mirror_num,
 | 
				
			||||||
					&block_was_created);
 | 
										&block_was_created);
 | 
				
			||||||
			if (NULL == next_block) {
 | 
								if (NULL == next_block) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
				       "btrfsic: error, kmalloc failed!\n");
 | 
					 | 
				
			||||||
				btrfsic_release_block_ctx(&next_block_ctx);
 | 
									btrfsic_release_block_ctx(&next_block_ctx);
 | 
				
			||||||
				return -1;
 | 
									return -1;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -1515,8 +1502,7 @@ static int btrfsic_handle_extent_data(
 | 
				
			||||||
				    next_block->logical_bytenr != next_bytenr &&
 | 
									    next_block->logical_bytenr != next_bytenr &&
 | 
				
			||||||
				    !(!next_block->is_metadata &&
 | 
									    !(!next_block->is_metadata &&
 | 
				
			||||||
				      0 == next_block->logical_bytenr)) {
 | 
									      0 == next_block->logical_bytenr)) {
 | 
				
			||||||
					printk(KERN_INFO
 | 
										pr_info("Referenced block @%llu (%s/%llu/%d) found in hash table, D, bytenr mismatch (!= stored %llu).\n",
 | 
				
			||||||
					       "Referenced block @%llu (%s/%llu/%d) found in hash table, D, bytenr mismatch (!= stored %llu).\n",
 | 
					 | 
				
			||||||
					       next_bytenr,
 | 
										       next_bytenr,
 | 
				
			||||||
					       next_block_ctx.dev->name,
 | 
										       next_block_ctx.dev->name,
 | 
				
			||||||
					       next_block_ctx.dev_bytenr,
 | 
										       next_block_ctx.dev_bytenr,
 | 
				
			||||||
| 
						 | 
					@ -1580,7 +1566,7 @@ static int btrfsic_map_block(struct btrfsic_state *state, u64 bytenr, u32 len,
 | 
				
			||||||
	kfree(multi);
 | 
						kfree(multi);
 | 
				
			||||||
	if (NULL == block_ctx_out->dev) {
 | 
						if (NULL == block_ctx_out->dev) {
 | 
				
			||||||
		ret = -ENXIO;
 | 
							ret = -ENXIO;
 | 
				
			||||||
		printk(KERN_INFO "btrfsic: error, cannot lookup dev (#1)!\n");
 | 
							pr_info("btrfsic: error, cannot lookup dev (#1)!\n");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
| 
						 | 
					@ -1626,8 +1612,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 | 
				
			||||||
	BUG_ON(block_ctx->pagev);
 | 
						BUG_ON(block_ctx->pagev);
 | 
				
			||||||
	BUG_ON(block_ctx->mem_to_free);
 | 
						BUG_ON(block_ctx->mem_to_free);
 | 
				
			||||||
	if (block_ctx->dev_bytenr & ((u64)PAGE_SIZE - 1)) {
 | 
						if (block_ctx->dev_bytenr & ((u64)PAGE_SIZE - 1)) {
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic: read_block() with unaligned bytenr %llu\n",
 | 
				
			||||||
		       "btrfsic: read_block() with unaligned bytenr %llu\n",
 | 
					 | 
				
			||||||
		       block_ctx->dev_bytenr);
 | 
							       block_ctx->dev_bytenr);
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1654,8 +1639,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i);
 | 
							bio = btrfs_io_bio_alloc(GFP_NOFS, num_pages - i);
 | 
				
			||||||
		if (!bio) {
 | 
							if (!bio) {
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: bio_alloc() for %u pages failed!\n",
 | 
				
			||||||
			       "btrfsic: bio_alloc() for %u pages failed!\n",
 | 
					 | 
				
			||||||
			       num_pages - i);
 | 
								       num_pages - i);
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -1670,13 +1654,11 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (j == i) {
 | 
							if (j == i) {
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: error, failed to add a single page!\n");
 | 
				
			||||||
			       "btrfsic: error, failed to add a single page!\n");
 | 
					 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (submit_bio_wait(bio)) {
 | 
							if (submit_bio_wait(bio)) {
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: read error at logical %llu dev %s!\n",
 | 
				
			||||||
			       "btrfsic: read error at logical %llu dev %s!\n",
 | 
					 | 
				
			||||||
			       block_ctx->start, block_ctx->dev->name);
 | 
								       block_ctx->start, block_ctx->dev->name);
 | 
				
			||||||
			bio_put(bio);
 | 
								bio_put(bio);
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
| 
						 | 
					@ -1688,7 +1670,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
 | 
				
			||||||
	for (i = 0; i < num_pages; i++) {
 | 
						for (i = 0; i < num_pages; i++) {
 | 
				
			||||||
		block_ctx->datav[i] = kmap(block_ctx->pagev[i]);
 | 
							block_ctx->datav[i] = kmap(block_ctx->pagev[i]);
 | 
				
			||||||
		if (!block_ctx->datav[i]) {
 | 
							if (!block_ctx->datav[i]) {
 | 
				
			||||||
			printk(KERN_INFO "btrfsic: kmap() failed (dev %s)!\n",
 | 
								pr_info("btrfsic: kmap() failed (dev %s)!\n",
 | 
				
			||||||
			       block_ctx->dev->name);
 | 
								       block_ctx->dev->name);
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -1703,17 +1685,17 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	BUG_ON(NULL == state);
 | 
						BUG_ON(NULL == state);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printk(KERN_INFO "all_blocks_list:\n");
 | 
						pr_info("all_blocks_list:\n");
 | 
				
			||||||
	list_for_each_entry(b_all, &state->all_blocks_list, all_blocks_node) {
 | 
						list_for_each_entry(b_all, &state->all_blocks_list, all_blocks_node) {
 | 
				
			||||||
		const struct btrfsic_block_link *l;
 | 
							const struct btrfsic_block_link *l;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		printk(KERN_INFO "%c-block @%llu (%s/%llu/%d)\n",
 | 
							pr_info("%c-block @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
		       btrfsic_get_block_type(state, b_all),
 | 
							       btrfsic_get_block_type(state, b_all),
 | 
				
			||||||
		       b_all->logical_bytenr, b_all->dev_state->name,
 | 
							       b_all->logical_bytenr, b_all->dev_state->name,
 | 
				
			||||||
		       b_all->dev_bytenr, b_all->mirror_num);
 | 
							       b_all->dev_bytenr, b_all->mirror_num);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		list_for_each_entry(l, &b_all->ref_to_list, node_ref_to) {
 | 
							list_for_each_entry(l, &b_all->ref_to_list, node_ref_to) {
 | 
				
			||||||
			printk(KERN_INFO " %c @%llu (%s/%llu/%d) refers %u* to %c @%llu (%s/%llu/%d)\n",
 | 
								pr_info(" %c @%llu (%s/%llu/%d) refers %u* to %c @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
			       btrfsic_get_block_type(state, b_all),
 | 
								       btrfsic_get_block_type(state, b_all),
 | 
				
			||||||
			       b_all->logical_bytenr, b_all->dev_state->name,
 | 
								       b_all->logical_bytenr, b_all->dev_state->name,
 | 
				
			||||||
			       b_all->dev_bytenr, b_all->mirror_num,
 | 
								       b_all->dev_bytenr, b_all->mirror_num,
 | 
				
			||||||
| 
						 | 
					@ -1726,7 +1708,7 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		list_for_each_entry(l, &b_all->ref_from_list, node_ref_from) {
 | 
							list_for_each_entry(l, &b_all->ref_from_list, node_ref_from) {
 | 
				
			||||||
			printk(KERN_INFO " %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
 | 
								pr_info(" %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
			       btrfsic_get_block_type(state, b_all),
 | 
								       btrfsic_get_block_type(state, b_all),
 | 
				
			||||||
			       b_all->logical_bytenr, b_all->dev_state->name,
 | 
								       b_all->logical_bytenr, b_all->dev_state->name,
 | 
				
			||||||
			       b_all->dev_bytenr, b_all->mirror_num,
 | 
								       b_all->dev_bytenr, b_all->mirror_num,
 | 
				
			||||||
| 
						 | 
					@ -1738,7 +1720,7 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
 | 
				
			||||||
			       l->block_ref_from->mirror_num);
 | 
								       l->block_ref_from->mirror_num);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		printk(KERN_INFO "\n");
 | 
							pr_info("\n");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1813,8 +1795,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
						    mapped_datav[0]);
 | 
											    mapped_datav[0]);
 | 
				
			||||||
			if (num_pages * PAGE_SIZE <
 | 
								if (num_pages * PAGE_SIZE <
 | 
				
			||||||
			    BTRFS_SUPER_INFO_SIZE) {
 | 
								    BTRFS_SUPER_INFO_SIZE) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: cannot work with too short bios!\n");
 | 
				
			||||||
				       "btrfsic: cannot work with too short bios!\n");
 | 
					 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			is_metadata = 1;
 | 
								is_metadata = 1;
 | 
				
			||||||
| 
						 | 
					@ -1822,8 +1803,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
			processed_len = BTRFS_SUPER_INFO_SIZE;
 | 
								processed_len = BTRFS_SUPER_INFO_SIZE;
 | 
				
			||||||
			if (state->print_mask &
 | 
								if (state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_TREE_BEFORE_SB_WRITE) {
 | 
								    BTRFSIC_PRINT_MASK_TREE_BEFORE_SB_WRITE) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("[before new superblock is written]:\n");
 | 
				
			||||||
				       "[before new superblock is written]:\n");
 | 
					 | 
				
			||||||
				btrfsic_dump_tree_sub(state, block, 0);
 | 
									btrfsic_dump_tree_sub(state, block, 0);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -1831,8 +1811,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
			if (!block->is_superblock) {
 | 
								if (!block->is_superblock) {
 | 
				
			||||||
				if (num_pages * PAGE_SIZE <
 | 
									if (num_pages * PAGE_SIZE <
 | 
				
			||||||
				    state->metablock_size) {
 | 
									    state->metablock_size) {
 | 
				
			||||||
					printk(KERN_INFO
 | 
										pr_info("btrfsic: cannot work with too short bios!\n");
 | 
				
			||||||
					       "btrfsic: cannot work with too short bios!\n");
 | 
					 | 
				
			||||||
					return;
 | 
										return;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				processed_len = state->metablock_size;
 | 
									processed_len = state->metablock_size;
 | 
				
			||||||
| 
						 | 
					@ -1847,8 +1826,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
				if (block->logical_bytenr != bytenr &&
 | 
									if (block->logical_bytenr != bytenr &&
 | 
				
			||||||
				    !(!block->is_metadata &&
 | 
									    !(!block->is_metadata &&
 | 
				
			||||||
				      block->logical_bytenr == 0))
 | 
									      block->logical_bytenr == 0))
 | 
				
			||||||
					printk(KERN_INFO
 | 
										pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
 | 
				
			||||||
					       "Written block @%llu (%s/%llu/%d) found in hash table, %c, bytenr mismatch (!= stored %llu).\n",
 | 
					 | 
				
			||||||
					       bytenr, dev_state->name,
 | 
										       bytenr, dev_state->name,
 | 
				
			||||||
					       dev_bytenr,
 | 
										       dev_bytenr,
 | 
				
			||||||
					       block->mirror_num,
 | 
										       block->mirror_num,
 | 
				
			||||||
| 
						 | 
					@ -1856,8 +1834,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
								      block),
 | 
													      block),
 | 
				
			||||||
					       block->logical_bytenr);
 | 
										       block->logical_bytenr);
 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					printk(KERN_INFO
 | 
										pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
 | 
				
			||||||
					       "Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
 | 
					 | 
				
			||||||
					       bytenr, dev_state->name,
 | 
										       bytenr, dev_state->name,
 | 
				
			||||||
					       dev_bytenr, block->mirror_num,
 | 
										       dev_bytenr, block->mirror_num,
 | 
				
			||||||
					       btrfsic_get_block_type(state,
 | 
										       btrfsic_get_block_type(state,
 | 
				
			||||||
| 
						 | 
					@ -1867,27 +1844,24 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			if (num_pages * PAGE_SIZE <
 | 
								if (num_pages * PAGE_SIZE <
 | 
				
			||||||
			    state->datablock_size) {
 | 
								    state->datablock_size) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: cannot work with too short bios!\n");
 | 
				
			||||||
				       "btrfsic: cannot work with too short bios!\n");
 | 
					 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			processed_len = state->datablock_size;
 | 
								processed_len = state->datablock_size;
 | 
				
			||||||
			bytenr = block->logical_bytenr;
 | 
								bytenr = block->logical_bytenr;
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
 | 
				
			||||||
				       "Written block @%llu (%s/%llu/%d) found in hash table, %c.\n",
 | 
					 | 
				
			||||||
				       bytenr, dev_state->name, dev_bytenr,
 | 
									       bytenr, dev_state->name, dev_bytenr,
 | 
				
			||||||
				       block->mirror_num,
 | 
									       block->mirror_num,
 | 
				
			||||||
				       btrfsic_get_block_type(state, block));
 | 
									       btrfsic_get_block_type(state, block));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("ref_to_list: %cE, ref_from_list: %cE\n",
 | 
				
			||||||
			       "ref_to_list: %cE, ref_from_list: %cE\n",
 | 
					 | 
				
			||||||
			       list_empty(&block->ref_to_list) ? ' ' : '!',
 | 
								       list_empty(&block->ref_to_list) ? ' ' : '!',
 | 
				
			||||||
			       list_empty(&block->ref_from_list) ? ' ' : '!');
 | 
								       list_empty(&block->ref_from_list) ? ' ' : '!');
 | 
				
			||||||
		if (btrfsic_is_block_ref_by_superblock(state, block, 0)) {
 | 
							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",
 | 
								pr_info("btrfs: attempt to overwrite %c-block @%llu (%s/%llu/%d), old(gen=%llu, objectid=%llu, type=%d, offset=%llu), new(gen=%llu), which is referenced by most recent superblock (superblockgen=%llu)!\n",
 | 
				
			||||||
			       btrfsic_get_block_type(state, block), bytenr,
 | 
								       btrfsic_get_block_type(state, block), bytenr,
 | 
				
			||||||
			       dev_state->name, dev_bytenr, block->mirror_num,
 | 
								       dev_state->name, dev_bytenr, block->mirror_num,
 | 
				
			||||||
			       block->generation,
 | 
								       block->generation,
 | 
				
			||||||
| 
						 | 
					@ -1901,7 +1875,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!block->is_iodone && !block->never_written) {
 | 
							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",
 | 
								pr_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), bytenr,
 | 
								       btrfsic_get_block_type(state, block), bytenr,
 | 
				
			||||||
			       dev_state->name, dev_bytenr, block->mirror_num,
 | 
								       dev_state->name, dev_bytenr, block->mirror_num,
 | 
				
			||||||
			       block->generation,
 | 
								       block->generation,
 | 
				
			||||||
| 
						 | 
					@ -1999,8 +1973,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
						mapped_datav[0]);
 | 
											mapped_datav[0]);
 | 
				
			||||||
				if (state->print_mask &
 | 
									if (state->print_mask &
 | 
				
			||||||
				    BTRFSIC_PRINT_MASK_TREE_AFTER_SB_WRITE) {
 | 
									    BTRFSIC_PRINT_MASK_TREE_AFTER_SB_WRITE) {
 | 
				
			||||||
					printk(KERN_INFO
 | 
										pr_info("[after new superblock is written]:\n");
 | 
				
			||||||
					"[after new superblock is written]:\n");
 | 
					 | 
				
			||||||
					btrfsic_dump_tree_sub(state, block, 0);
 | 
										btrfsic_dump_tree_sub(state, block, 0);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
| 
						 | 
					@ -2012,8 +1985,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
						0, 0);
 | 
											0, 0);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (ret)
 | 
								if (ret)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: btrfsic_process_metablock(root @%llu) failed!\n",
 | 
				
			||||||
				       "btrfsic: btrfsic_process_metablock(root @%llu) failed!\n",
 | 
					 | 
				
			||||||
				       dev_bytenr);
 | 
									       dev_bytenr);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			block->is_metadata = 0;
 | 
								block->is_metadata = 0;
 | 
				
			||||||
| 
						 | 
					@ -2040,7 +2012,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
		if (!is_metadata) {
 | 
							if (!is_metadata) {
 | 
				
			||||||
			processed_len = state->datablock_size;
 | 
								processed_len = state->datablock_size;
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO "Written block (%s/%llu/?) !found in hash table, D.\n",
 | 
									pr_info("Written block (%s/%llu/?) !found in hash table, D.\n",
 | 
				
			||||||
				       dev_state->name, dev_bytenr);
 | 
									       dev_state->name, dev_bytenr);
 | 
				
			||||||
			if (!state->include_extent_data) {
 | 
								if (!state->include_extent_data) {
 | 
				
			||||||
				/* ignore that written D block */
 | 
									/* ignore that written D block */
 | 
				
			||||||
| 
						 | 
					@ -2058,8 +2030,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
			btrfsic_cmp_log_and_dev_bytenr(state, bytenr, dev_state,
 | 
								btrfsic_cmp_log_and_dev_bytenr(state, bytenr, dev_state,
 | 
				
			||||||
						       dev_bytenr);
 | 
											       dev_bytenr);
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("Written block @%llu (%s/%llu/?) !found in hash table, M.\n",
 | 
				
			||||||
				       "Written block @%llu (%s/%llu/?) !found in hash table, M.\n",
 | 
					 | 
				
			||||||
				       bytenr, dev_state->name, dev_bytenr);
 | 
									       bytenr, dev_state->name, dev_bytenr);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2073,7 +2044,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		block = btrfsic_block_alloc();
 | 
							block = btrfsic_block_alloc();
 | 
				
			||||||
		if (NULL == block) {
 | 
							if (NULL == block) {
 | 
				
			||||||
			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
 | 
								pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
			btrfsic_release_block_ctx(&block_ctx);
 | 
								btrfsic_release_block_ctx(&block_ctx);
 | 
				
			||||||
			goto continue_loop;
 | 
								goto continue_loop;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -2123,8 +2094,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
			block->next_in_same_bio = NULL;
 | 
								block->next_in_same_bio = NULL;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("New written %c-block @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
			       "New written %c-block @%llu (%s/%llu/%d)\n",
 | 
					 | 
				
			||||||
			       is_metadata ? 'M' : 'D',
 | 
								       is_metadata ? 'M' : 'D',
 | 
				
			||||||
			       block->logical_bytenr, block->dev_state->name,
 | 
								       block->logical_bytenr, block->dev_state->name,
 | 
				
			||||||
			       block->dev_bytenr, block->mirror_num);
 | 
								       block->dev_bytenr, block->mirror_num);
 | 
				
			||||||
| 
						 | 
					@ -2135,8 +2105,7 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
 | 
				
			||||||
			ret = btrfsic_process_metablock(state, block,
 | 
								ret = btrfsic_process_metablock(state, block,
 | 
				
			||||||
							&block_ctx, 0, 0);
 | 
												&block_ctx, 0, 0);
 | 
				
			||||||
			if (ret)
 | 
								if (ret)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: process_metablock(root @%llu) failed!\n",
 | 
				
			||||||
				       "btrfsic: process_metablock(root @%llu) failed!\n",
 | 
					 | 
				
			||||||
				       dev_bytenr);
 | 
									       dev_bytenr);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		btrfsic_release_block_ctx(&block_ctx);
 | 
							btrfsic_release_block_ctx(&block_ctx);
 | 
				
			||||||
| 
						 | 
					@ -2171,8 +2140,7 @@ static void btrfsic_bio_end_io(struct bio *bp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ((dev_state->state->print_mask &
 | 
							if ((dev_state->state->print_mask &
 | 
				
			||||||
		     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
							     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
			       "bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n",
 | 
					 | 
				
			||||||
			       bp->bi_error,
 | 
								       bp->bi_error,
 | 
				
			||||||
			       btrfsic_get_block_type(dev_state->state, block),
 | 
								       btrfsic_get_block_type(dev_state->state, block),
 | 
				
			||||||
			       block->logical_bytenr, dev_state->name,
 | 
								       block->logical_bytenr, dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2183,8 +2151,7 @@ static void btrfsic_bio_end_io(struct bio *bp)
 | 
				
			||||||
			dev_state->last_flush_gen++;
 | 
								dev_state->last_flush_gen++;
 | 
				
			||||||
			if ((dev_state->state->print_mask &
 | 
								if ((dev_state->state->print_mask &
 | 
				
			||||||
			     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
								     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("bio_end_io() new %s flush_gen=%llu\n",
 | 
				
			||||||
				       "bio_end_io() new %s flush_gen=%llu\n",
 | 
					 | 
				
			||||||
				       dev_state->name,
 | 
									       dev_state->name,
 | 
				
			||||||
				       dev_state->last_flush_gen);
 | 
									       dev_state->last_flush_gen);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -2207,8 +2174,7 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
 | 
				
			||||||
	BUG_ON(NULL == block);
 | 
						BUG_ON(NULL == block);
 | 
				
			||||||
	dev_state = block->dev_state;
 | 
						dev_state = block->dev_state;
 | 
				
			||||||
	if ((dev_state->state->print_mask & BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
						if ((dev_state->state->print_mask & BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("bh_end_io(error=%d) for %c @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
		       "bh_end_io(error=%d) for %c @%llu (%s/%llu/%d)\n",
 | 
					 | 
				
			||||||
		       iodone_w_error,
 | 
							       iodone_w_error,
 | 
				
			||||||
		       btrfsic_get_block_type(dev_state->state, block),
 | 
							       btrfsic_get_block_type(dev_state->state, block),
 | 
				
			||||||
		       block->logical_bytenr, block->dev_state->name,
 | 
							       block->logical_bytenr, block->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2219,8 +2185,7 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
 | 
				
			||||||
		dev_state->last_flush_gen++;
 | 
							dev_state->last_flush_gen++;
 | 
				
			||||||
		if ((dev_state->state->print_mask &
 | 
							if ((dev_state->state->print_mask &
 | 
				
			||||||
		     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
							     BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("bh_end_io() new %s flush_gen=%llu\n",
 | 
				
			||||||
			       "bh_end_io() new %s flush_gen=%llu\n",
 | 
					 | 
				
			||||||
			       dev_state->name, dev_state->last_flush_gen);
 | 
								       dev_state->name, dev_state->last_flush_gen);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (block->submit_bio_bh_rw & REQ_FUA)
 | 
						if (block->submit_bio_bh_rw & REQ_FUA)
 | 
				
			||||||
| 
						 | 
					@ -2243,8 +2208,7 @@ static int btrfsic_process_written_superblock(
 | 
				
			||||||
	if (!(superblock->generation > state->max_superblock_generation ||
 | 
						if (!(superblock->generation > state->max_superblock_generation ||
 | 
				
			||||||
	      0 == state->max_superblock_generation)) {
 | 
						      0 == state->max_superblock_generation)) {
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: superblock @%llu (%s/%llu/%d) with old gen %llu <= %llu\n",
 | 
				
			||||||
			       "btrfsic: superblock @%llu (%s/%llu/%d) with old gen %llu <= %llu\n",
 | 
					 | 
				
			||||||
			       superblock->logical_bytenr,
 | 
								       superblock->logical_bytenr,
 | 
				
			||||||
			       superblock->dev_state->name,
 | 
								       superblock->dev_state->name,
 | 
				
			||||||
			       superblock->dev_bytenr, superblock->mirror_num,
 | 
								       superblock->dev_bytenr, superblock->mirror_num,
 | 
				
			||||||
| 
						 | 
					@ -2252,8 +2216,7 @@ static int btrfsic_process_written_superblock(
 | 
				
			||||||
			       state->max_superblock_generation);
 | 
								       state->max_superblock_generation);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_SUPERBLOCK_WRITE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: got new superblock @%llu (%s/%llu/%d) with new gen %llu > %llu\n",
 | 
				
			||||||
			       "btrfsic: got new superblock @%llu (%s/%llu/%d) with new gen %llu > %llu\n",
 | 
					 | 
				
			||||||
			       superblock->logical_bytenr,
 | 
								       superblock->logical_bytenr,
 | 
				
			||||||
			       superblock->dev_state->name,
 | 
								       superblock->dev_state->name,
 | 
				
			||||||
			       superblock->dev_bytenr, superblock->mirror_num,
 | 
								       superblock->dev_bytenr, superblock->mirror_num,
 | 
				
			||||||
| 
						 | 
					@ -2288,7 +2251,7 @@ static int btrfsic_process_written_superblock(
 | 
				
			||||||
			next_bytenr = btrfs_super_root(super_hdr);
 | 
								next_bytenr = btrfs_super_root(super_hdr);
 | 
				
			||||||
			if (state->print_mask &
 | 
								if (state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
								    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
				
			||||||
				printk(KERN_INFO "root@%llu\n", next_bytenr);
 | 
									pr_info("root@%llu\n", next_bytenr);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 1:
 | 
							case 1:
 | 
				
			||||||
			btrfs_set_disk_key_objectid(&tmp_disk_key,
 | 
								btrfs_set_disk_key_objectid(&tmp_disk_key,
 | 
				
			||||||
| 
						 | 
					@ -2297,7 +2260,7 @@ static int btrfsic_process_written_superblock(
 | 
				
			||||||
			next_bytenr = btrfs_super_chunk_root(super_hdr);
 | 
								next_bytenr = btrfs_super_chunk_root(super_hdr);
 | 
				
			||||||
			if (state->print_mask &
 | 
								if (state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
								    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
				
			||||||
				printk(KERN_INFO "chunk@%llu\n", next_bytenr);
 | 
									pr_info("chunk@%llu\n", next_bytenr);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 2:
 | 
							case 2:
 | 
				
			||||||
			btrfs_set_disk_key_objectid(&tmp_disk_key,
 | 
								btrfs_set_disk_key_objectid(&tmp_disk_key,
 | 
				
			||||||
| 
						 | 
					@ -2308,7 +2271,7 @@ static int btrfsic_process_written_superblock(
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			if (state->print_mask &
 | 
								if (state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
								    BTRFSIC_PRINT_MASK_ROOT_CHUNK_LOG_TREE_LOCATION)
 | 
				
			||||||
				printk(KERN_INFO "log@%llu\n", next_bytenr);
 | 
									pr_info("log@%llu\n", next_bytenr);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2316,21 +2279,19 @@ static int btrfsic_process_written_superblock(
 | 
				
			||||||
		    btrfs_num_copies(state->root->fs_info,
 | 
							    btrfs_num_copies(state->root->fs_info,
 | 
				
			||||||
				     next_bytenr, BTRFS_SUPER_INFO_SIZE);
 | 
									     next_bytenr, BTRFS_SUPER_INFO_SIZE);
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_NUM_COPIES)
 | 
				
			||||||
			printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
 | 
								pr_info("num_copies(log_bytenr=%llu) = %d\n",
 | 
				
			||||||
			       next_bytenr, num_copies);
 | 
								       next_bytenr, num_copies);
 | 
				
			||||||
		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
							for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
				
			||||||
			int was_created;
 | 
								int was_created;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
								if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic_process_written_superblock(mirror_num=%d)\n", mirror_num);
 | 
				
			||||||
				       "btrfsic_process_written_superblock(mirror_num=%d)\n", mirror_num);
 | 
					 | 
				
			||||||
			ret = btrfsic_map_block(state, next_bytenr,
 | 
								ret = btrfsic_map_block(state, next_bytenr,
 | 
				
			||||||
						BTRFS_SUPER_INFO_SIZE,
 | 
											BTRFS_SUPER_INFO_SIZE,
 | 
				
			||||||
						&tmp_next_block_ctx,
 | 
											&tmp_next_block_ctx,
 | 
				
			||||||
						mirror_num);
 | 
											mirror_num);
 | 
				
			||||||
			if (ret) {
 | 
								if (ret) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
 | 
				
			||||||
				       "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
 | 
					 | 
				
			||||||
				       next_bytenr, mirror_num);
 | 
									       next_bytenr, mirror_num);
 | 
				
			||||||
				return -1;
 | 
									return -1;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -2343,8 +2304,7 @@ static int btrfsic_process_written_superblock(
 | 
				
			||||||
					mirror_num,
 | 
										mirror_num,
 | 
				
			||||||
					&was_created);
 | 
										&was_created);
 | 
				
			||||||
			if (NULL == next_block) {
 | 
								if (NULL == next_block) {
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
				       "btrfsic: error, kmalloc failed!\n");
 | 
					 | 
				
			||||||
				btrfsic_release_block_ctx(&tmp_next_block_ctx);
 | 
									btrfsic_release_block_ctx(&tmp_next_block_ctx);
 | 
				
			||||||
				return -1;
 | 
									return -1;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -2393,8 +2353,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 | 
				
			||||||
		 * by the most recent super block.
 | 
							 * by the most recent super block.
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: abort cyclic linkage (case 1).\n");
 | 
				
			||||||
			       "btrfsic: abort cyclic linkage (case 1).\n");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -2405,8 +2364,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	list_for_each_entry(l, &block->ref_to_list, node_ref_to) {
 | 
						list_for_each_entry(l, &block->ref_to_list, node_ref_to) {
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("rl=%d, %c @%llu (%s/%llu/%d) %u* refers to %c @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
			       "rl=%d, %c @%llu (%s/%llu/%d) %u* refers to %c @%llu (%s/%llu/%d)\n",
 | 
					 | 
				
			||||||
			       recursion_level,
 | 
								       recursion_level,
 | 
				
			||||||
			       btrfsic_get_block_type(state, block),
 | 
								       btrfsic_get_block_type(state, block),
 | 
				
			||||||
			       block->logical_bytenr, block->dev_state->name,
 | 
								       block->logical_bytenr, block->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2418,7 +2376,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 | 
				
			||||||
			       l->block_ref_to->dev_bytenr,
 | 
								       l->block_ref_to->dev_bytenr,
 | 
				
			||||||
			       l->block_ref_to->mirror_num);
 | 
								       l->block_ref_to->mirror_num);
 | 
				
			||||||
		if (l->block_ref_to->never_written) {
 | 
							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",
 | 
								pr_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),
 | 
								       btrfsic_get_block_type(state, l->block_ref_to),
 | 
				
			||||||
			       l->block_ref_to->logical_bytenr,
 | 
								       l->block_ref_to->logical_bytenr,
 | 
				
			||||||
			       l->block_ref_to->dev_state->name,
 | 
								       l->block_ref_to->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2426,7 +2384,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 | 
				
			||||||
			       l->block_ref_to->mirror_num);
 | 
								       l->block_ref_to->mirror_num);
 | 
				
			||||||
			ret = -1;
 | 
								ret = -1;
 | 
				
			||||||
		} else if (!l->block_ref_to->is_iodone) {
 | 
							} 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",
 | 
								pr_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),
 | 
								       btrfsic_get_block_type(state, l->block_ref_to),
 | 
				
			||||||
			       l->block_ref_to->logical_bytenr,
 | 
								       l->block_ref_to->logical_bytenr,
 | 
				
			||||||
			       l->block_ref_to->dev_state->name,
 | 
								       l->block_ref_to->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2434,7 +2392,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 | 
				
			||||||
			       l->block_ref_to->mirror_num);
 | 
								       l->block_ref_to->mirror_num);
 | 
				
			||||||
			ret = -1;
 | 
								ret = -1;
 | 
				
			||||||
		} else if (l->block_ref_to->iodone_w_error) {
 | 
							} 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",
 | 
								pr_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),
 | 
								       btrfsic_get_block_type(state, l->block_ref_to),
 | 
				
			||||||
			       l->block_ref_to->logical_bytenr,
 | 
								       l->block_ref_to->logical_bytenr,
 | 
				
			||||||
			       l->block_ref_to->dev_state->name,
 | 
								       l->block_ref_to->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2447,7 +2405,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 | 
				
			||||||
			   l->parent_generation &&
 | 
								   l->parent_generation &&
 | 
				
			||||||
			   BTRFSIC_GENERATION_UNKNOWN !=
 | 
								   BTRFSIC_GENERATION_UNKNOWN !=
 | 
				
			||||||
			   l->block_ref_to->generation) {
 | 
								   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",
 | 
								pr_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),
 | 
								       btrfsic_get_block_type(state, l->block_ref_to),
 | 
				
			||||||
			       l->block_ref_to->logical_bytenr,
 | 
								       l->block_ref_to->logical_bytenr,
 | 
				
			||||||
			       l->block_ref_to->dev_state->name,
 | 
								       l->block_ref_to->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2458,7 +2416,7 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
 | 
				
			||||||
			ret = -1;
 | 
								ret = -1;
 | 
				
			||||||
		} else if (l->block_ref_to->flush_gen >
 | 
							} else if (l->block_ref_to->flush_gen >
 | 
				
			||||||
			   l->block_ref_to->dev_state->last_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",
 | 
								pr_info("btrfs: attempt to write superblock which references block %c @%llu (%s/%llu/%d) which is not flushed out of disk's write cache (block flush_gen=%llu, dev->flush_gen=%llu)!\n",
 | 
				
			||||||
			       btrfsic_get_block_type(state, l->block_ref_to),
 | 
								       btrfsic_get_block_type(state, l->block_ref_to),
 | 
				
			||||||
			       l->block_ref_to->logical_bytenr,
 | 
								       l->block_ref_to->logical_bytenr,
 | 
				
			||||||
			       l->block_ref_to->dev_state->name,
 | 
								       l->block_ref_to->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2487,8 +2445,7 @@ static int btrfsic_is_block_ref_by_superblock(
 | 
				
			||||||
	if (recursion_level >= 3 + BTRFS_MAX_LEVEL) {
 | 
						if (recursion_level >= 3 + BTRFS_MAX_LEVEL) {
 | 
				
			||||||
		/* refer to comment at "abort cyclic linkage (case 1)" */
 | 
							/* refer to comment at "abort cyclic linkage (case 1)" */
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: abort cyclic linkage (case 2).\n");
 | 
				
			||||||
			       "btrfsic: abort cyclic linkage (case 2).\n");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -2499,8 +2456,7 @@ static int btrfsic_is_block_ref_by_superblock(
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	list_for_each_entry(l, &block->ref_from_list, node_ref_from) {
 | 
						list_for_each_entry(l, &block->ref_from_list, node_ref_from) {
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("rl=%d, %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
			       "rl=%d, %c @%llu (%s/%llu/%d) is ref %u* from %c @%llu (%s/%llu/%d)\n",
 | 
					 | 
				
			||||||
			       recursion_level,
 | 
								       recursion_level,
 | 
				
			||||||
			       btrfsic_get_block_type(state, block),
 | 
								       btrfsic_get_block_type(state, block),
 | 
				
			||||||
			       block->logical_bytenr, block->dev_state->name,
 | 
								       block->logical_bytenr, block->dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2530,8 +2486,7 @@ static int btrfsic_is_block_ref_by_superblock(
 | 
				
			||||||
static void btrfsic_print_add_link(const struct btrfsic_state *state,
 | 
					static void btrfsic_print_add_link(const struct btrfsic_state *state,
 | 
				
			||||||
				   const struct btrfsic_block_link *l)
 | 
									   const struct btrfsic_block_link *l)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	printk(KERN_INFO
 | 
						pr_info("Add %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
 | 
				
			||||||
	       "Add %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
 | 
					 | 
				
			||||||
	       l->ref_cnt,
 | 
						       l->ref_cnt,
 | 
				
			||||||
	       btrfsic_get_block_type(state, l->block_ref_from),
 | 
						       btrfsic_get_block_type(state, l->block_ref_from),
 | 
				
			||||||
	       l->block_ref_from->logical_bytenr,
 | 
						       l->block_ref_from->logical_bytenr,
 | 
				
			||||||
| 
						 | 
					@ -2546,8 +2501,7 @@ static void btrfsic_print_add_link(const struct btrfsic_state *state,
 | 
				
			||||||
static void btrfsic_print_rem_link(const struct btrfsic_state *state,
 | 
					static void btrfsic_print_rem_link(const struct btrfsic_state *state,
 | 
				
			||||||
				   const struct btrfsic_block_link *l)
 | 
									   const struct btrfsic_block_link *l)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	printk(KERN_INFO
 | 
						pr_info("Rem %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
 | 
				
			||||||
	       "Rem %u* link from %c @%llu (%s/%llu/%d) to %c @%llu (%s/%llu/%d).\n",
 | 
					 | 
				
			||||||
	       l->ref_cnt,
 | 
						       l->ref_cnt,
 | 
				
			||||||
	       btrfsic_get_block_type(state, l->block_ref_from),
 | 
						       btrfsic_get_block_type(state, l->block_ref_from),
 | 
				
			||||||
	       l->block_ref_from->logical_bytenr,
 | 
						       l->block_ref_from->logical_bytenr,
 | 
				
			||||||
| 
						 | 
					@ -2659,8 +2613,7 @@ static struct btrfsic_block_link *btrfsic_block_link_lookup_or_add(
 | 
				
			||||||
	if (NULL == l) {
 | 
						if (NULL == l) {
 | 
				
			||||||
		l = btrfsic_block_link_alloc();
 | 
							l = btrfsic_block_link_alloc();
 | 
				
			||||||
		if (NULL == l) {
 | 
							if (NULL == l) {
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
			       "btrfsic: error, kmalloc failed!\n");
 | 
					 | 
				
			||||||
			return NULL;
 | 
								return NULL;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2707,13 +2660,12 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		block = btrfsic_block_alloc();
 | 
							block = btrfsic_block_alloc();
 | 
				
			||||||
		if (NULL == block) {
 | 
							if (NULL == block) {
 | 
				
			||||||
			printk(KERN_INFO "btrfsic: error, kmalloc failed!\n");
 | 
								pr_info("btrfsic: error, kmalloc failed!\n");
 | 
				
			||||||
			return NULL;
 | 
								return NULL;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev);
 | 
							dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev);
 | 
				
			||||||
		if (NULL == dev_state) {
 | 
							if (NULL == dev_state) {
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfsic: error, lookup dev_state failed!\n");
 | 
				
			||||||
			       "btrfsic: error, lookup dev_state failed!\n");
 | 
					 | 
				
			||||||
			btrfsic_block_free(block);
 | 
								btrfsic_block_free(block);
 | 
				
			||||||
			return NULL;
 | 
								return NULL;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -2725,8 +2677,7 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
 | 
				
			||||||
		block->never_written = never_written;
 | 
							block->never_written = never_written;
 | 
				
			||||||
		block->mirror_num = mirror_num;
 | 
							block->mirror_num = mirror_num;
 | 
				
			||||||
		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
							if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("New %s%c-block @%llu (%s/%llu/%d)\n",
 | 
				
			||||||
			       "New %s%c-block @%llu (%s/%llu/%d)\n",
 | 
					 | 
				
			||||||
			       additional_string,
 | 
								       additional_string,
 | 
				
			||||||
			       btrfsic_get_block_type(state, block),
 | 
								       btrfsic_get_block_type(state, block),
 | 
				
			||||||
			       block->logical_bytenr, dev_state->name,
 | 
								       block->logical_bytenr, dev_state->name,
 | 
				
			||||||
| 
						 | 
					@ -2761,7 +2712,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
 | 
				
			||||||
		ret = btrfsic_map_block(state, bytenr, state->metablock_size,
 | 
							ret = btrfsic_map_block(state, bytenr, state->metablock_size,
 | 
				
			||||||
					&block_ctx, mirror_num);
 | 
										&block_ctx, mirror_num);
 | 
				
			||||||
		if (ret) {
 | 
							if (ret) {
 | 
				
			||||||
			printk(KERN_INFO "btrfsic: btrfsic_map_block(logical @%llu, mirror %d) failed!\n",
 | 
								pr_info("btrfsic: btrfsic_map_block(logical @%llu, mirror %d) failed!\n",
 | 
				
			||||||
			       bytenr, mirror_num);
 | 
								       bytenr, mirror_num);
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -2776,7 +2727,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (WARN_ON(!match)) {
 | 
						if (WARN_ON(!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",
 | 
							pr_info("btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio, buffer->log_bytenr=%llu, submit_bio(bdev=%s, phys_bytenr=%llu)!\n",
 | 
				
			||||||
		       bytenr, dev_state->name, dev_bytenr);
 | 
							       bytenr, dev_state->name, dev_bytenr);
 | 
				
			||||||
		for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
							for (mirror_num = 1; mirror_num <= num_copies; mirror_num++) {
 | 
				
			||||||
			ret = btrfsic_map_block(state, bytenr,
 | 
								ret = btrfsic_map_block(state, bytenr,
 | 
				
			||||||
| 
						 | 
					@ -2785,7 +2736,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
 | 
				
			||||||
			if (ret)
 | 
								if (ret)
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			printk(KERN_INFO "Read logical bytenr @%llu maps to (%s/%llu/%d)\n",
 | 
								pr_info("Read logical bytenr @%llu maps to (%s/%llu/%d)\n",
 | 
				
			||||||
			       bytenr, block_ctx.dev->name,
 | 
								       bytenr, block_ctx.dev->name,
 | 
				
			||||||
			       block_ctx.dev_bytenr, mirror_num);
 | 
								       block_ctx.dev_bytenr, mirror_num);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -2819,8 +2770,7 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh)
 | 
				
			||||||
		dev_bytenr = 4096 * bh->b_blocknr;
 | 
							dev_bytenr = 4096 * bh->b_blocknr;
 | 
				
			||||||
		if (dev_state->state->print_mask &
 | 
							if (dev_state->state->print_mask &
 | 
				
			||||||
		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
							    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("submit_bh(op=0x%x,0x%x, blocknr=%llu (bytenr %llu), size=%zu, data=%p, bdev=%p)\n",
 | 
				
			||||||
			       "submit_bh(op=0x%x,0x%x, blocknr=%llu (bytenr %llu), size=%zu, data=%p, bdev=%p)\n",
 | 
					 | 
				
			||||||
			       op, op_flags, (unsigned long long)bh->b_blocknr,
 | 
								       op, op_flags, (unsigned long long)bh->b_blocknr,
 | 
				
			||||||
			       dev_bytenr, bh->b_size, bh->b_data, bh->b_bdev);
 | 
								       dev_bytenr, bh->b_size, bh->b_data, bh->b_bdev);
 | 
				
			||||||
		btrfsic_process_written_block(dev_state, dev_bytenr,
 | 
							btrfsic_process_written_block(dev_state, dev_bytenr,
 | 
				
			||||||
| 
						 | 
					@ -2829,15 +2779,13 @@ int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh)
 | 
				
			||||||
	} else if (NULL != dev_state && (op_flags & REQ_PREFLUSH)) {
 | 
						} else if (NULL != dev_state && (op_flags & REQ_PREFLUSH)) {
 | 
				
			||||||
		if (dev_state->state->print_mask &
 | 
							if (dev_state->state->print_mask &
 | 
				
			||||||
		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
							    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("submit_bh(op=0x%x,0x%x FLUSH, bdev=%p)\n",
 | 
				
			||||||
			       "submit_bh(op=0x%x,0x%x FLUSH, bdev=%p)\n",
 | 
					 | 
				
			||||||
			       op, op_flags, bh->b_bdev);
 | 
								       op, op_flags, bh->b_bdev);
 | 
				
			||||||
		if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 | 
							if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 | 
				
			||||||
			if ((dev_state->state->print_mask &
 | 
								if ((dev_state->state->print_mask &
 | 
				
			||||||
			     (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
 | 
								     (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
 | 
				
			||||||
			      BTRFSIC_PRINT_MASK_VERBOSE)))
 | 
								      BTRFSIC_PRINT_MASK_VERBOSE)))
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic_submit_bh(%s) with FLUSH but dummy block already in use (ignored)!\n",
 | 
				
			||||||
				       "btrfsic_submit_bh(%s) with FLUSH but dummy block already in use (ignored)!\n",
 | 
					 | 
				
			||||||
				       dev_state->name);
 | 
									       dev_state->name);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			struct btrfsic_block *const block =
 | 
								struct btrfsic_block *const block =
 | 
				
			||||||
| 
						 | 
					@ -2882,8 +2830,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
 | 
				
			||||||
		bio_is_patched = 0;
 | 
							bio_is_patched = 0;
 | 
				
			||||||
		if (dev_state->state->print_mask &
 | 
							if (dev_state->state->print_mask &
 | 
				
			||||||
		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
							    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("submit_bio(rw=%d,0x%x, bi_vcnt=%u, bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
 | 
				
			||||||
			       "submit_bio(rw=%d,0x%x, bi_vcnt=%u, bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
 | 
					 | 
				
			||||||
			       bio_op(bio), bio->bi_opf, bio->bi_vcnt,
 | 
								       bio_op(bio), bio->bi_opf, bio->bi_vcnt,
 | 
				
			||||||
			       (unsigned long long)bio->bi_iter.bi_sector,
 | 
								       (unsigned long long)bio->bi_iter.bi_sector,
 | 
				
			||||||
			       dev_bytenr, bio->bi_bdev);
 | 
								       dev_bytenr, bio->bi_bdev);
 | 
				
			||||||
| 
						 | 
					@ -2906,8 +2853,7 @@ static void __btrfsic_submit_bio(struct bio *bio)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (dev_state->state->print_mask &
 | 
								if (dev_state->state->print_mask &
 | 
				
			||||||
			    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH_VERBOSE)
 | 
								    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH_VERBOSE)
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("#%u: bytenr=%llu, len=%u, offset=%u\n",
 | 
				
			||||||
				       "#%u: bytenr=%llu, len=%u, offset=%u\n",
 | 
					 | 
				
			||||||
				       i, cur_bytenr, bio->bi_io_vec[i].bv_len,
 | 
									       i, cur_bytenr, bio->bi_io_vec[i].bv_len,
 | 
				
			||||||
				       bio->bi_io_vec[i].bv_offset);
 | 
									       bio->bi_io_vec[i].bv_offset);
 | 
				
			||||||
			cur_bytenr += bio->bi_io_vec[i].bv_len;
 | 
								cur_bytenr += bio->bi_io_vec[i].bv_len;
 | 
				
			||||||
| 
						 | 
					@ -2924,15 +2870,13 @@ static void __btrfsic_submit_bio(struct bio *bio)
 | 
				
			||||||
	} else if (NULL != dev_state && (bio->bi_opf & REQ_PREFLUSH)) {
 | 
						} else if (NULL != dev_state && (bio->bi_opf & REQ_PREFLUSH)) {
 | 
				
			||||||
		if (dev_state->state->print_mask &
 | 
							if (dev_state->state->print_mask &
 | 
				
			||||||
		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
							    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n",
 | 
				
			||||||
			       "submit_bio(rw=%d,0x%x FLUSH, bdev=%p)\n",
 | 
					 | 
				
			||||||
			       bio_op(bio), bio->bi_opf, bio->bi_bdev);
 | 
								       bio_op(bio), bio->bi_opf, bio->bi_bdev);
 | 
				
			||||||
		if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 | 
							if (!dev_state->dummy_block_for_bio_bh_flush.is_iodone) {
 | 
				
			||||||
			if ((dev_state->state->print_mask &
 | 
								if ((dev_state->state->print_mask &
 | 
				
			||||||
			     (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
 | 
								     (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH |
 | 
				
			||||||
			      BTRFSIC_PRINT_MASK_VERBOSE)))
 | 
								      BTRFSIC_PRINT_MASK_VERBOSE)))
 | 
				
			||||||
				printk(KERN_INFO
 | 
									pr_info("btrfsic_submit_bio(%s) with FLUSH but dummy block already in use (ignored)!\n",
 | 
				
			||||||
				       "btrfsic_submit_bio(%s) with FLUSH but dummy block already in use (ignored)!\n",
 | 
					 | 
				
			||||||
				       dev_state->name);
 | 
									       dev_state->name);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			struct btrfsic_block *const block =
 | 
								struct btrfsic_block *const block =
 | 
				
			||||||
| 
						 | 
					@ -2976,14 +2920,12 @@ int btrfsic_mount(struct btrfs_root *root,
 | 
				
			||||||
	struct btrfs_device *device;
 | 
						struct btrfs_device *device;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (root->nodesize & ((u64)PAGE_SIZE - 1)) {
 | 
						if (root->nodesize & ((u64)PAGE_SIZE - 1)) {
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic: cannot handle nodesize %d not being a multiple of PAGE_SIZE %ld!\n",
 | 
				
			||||||
		       "btrfsic: cannot handle nodesize %d not being a multiple of PAGE_SIZE %ld!\n",
 | 
					 | 
				
			||||||
		       root->nodesize, PAGE_SIZE);
 | 
							       root->nodesize, PAGE_SIZE);
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (root->sectorsize & ((u64)PAGE_SIZE - 1)) {
 | 
						if (root->sectorsize & ((u64)PAGE_SIZE - 1)) {
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic: cannot handle sectorsize %d not being a multiple of PAGE_SIZE %ld!\n",
 | 
				
			||||||
		       "btrfsic: cannot handle sectorsize %d not being a multiple of PAGE_SIZE %ld!\n",
 | 
					 | 
				
			||||||
		       root->sectorsize, PAGE_SIZE);
 | 
							       root->sectorsize, PAGE_SIZE);
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -2991,7 +2933,7 @@ int btrfsic_mount(struct btrfs_root *root,
 | 
				
			||||||
	if (!state) {
 | 
						if (!state) {
 | 
				
			||||||
		state = vzalloc(sizeof(*state));
 | 
							state = vzalloc(sizeof(*state));
 | 
				
			||||||
		if (!state) {
 | 
							if (!state) {
 | 
				
			||||||
			printk(KERN_INFO "btrfs check-integrity: vzalloc() failed!\n");
 | 
								pr_info("btrfs check-integrity: vzalloc() failed!\n");
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -3023,8 +2965,7 @@ int btrfsic_mount(struct btrfs_root *root,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ds = btrfsic_dev_state_alloc();
 | 
							ds = btrfsic_dev_state_alloc();
 | 
				
			||||||
		if (NULL == ds) {
 | 
							if (NULL == ds) {
 | 
				
			||||||
			printk(KERN_INFO
 | 
								pr_info("btrfs check-integrity: kmalloc() failed!\n");
 | 
				
			||||||
			       "btrfs check-integrity: kmalloc() failed!\n");
 | 
					 | 
				
			||||||
			mutex_unlock(&btrfsic_mutex);
 | 
								mutex_unlock(&btrfsic_mutex);
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -3085,8 +3026,7 @@ void btrfsic_unmount(struct btrfs_root *root,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (NULL == state) {
 | 
						if (NULL == state) {
 | 
				
			||||||
		printk(KERN_INFO
 | 
							pr_info("btrfsic: error, cannot find state information on umount!\n");
 | 
				
			||||||
		       "btrfsic: error, cannot find state information on umount!\n");
 | 
					 | 
				
			||||||
		mutex_unlock(&btrfsic_mutex);
 | 
							mutex_unlock(&btrfsic_mutex);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -3113,7 +3053,7 @@ void btrfsic_unmount(struct btrfs_root *root,
 | 
				
			||||||
		if (b_all->is_iodone || b_all->never_written)
 | 
							if (b_all->is_iodone || b_all->never_written)
 | 
				
			||||||
			btrfsic_block_free(b_all);
 | 
								btrfsic_block_free(b_all);
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			printk(KERN_INFO "btrfs: attempt to free %c-block @%llu (%s/%llu/%d) on umount which is not yet iodone!\n",
 | 
								pr_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),
 | 
								       btrfsic_get_block_type(state, b_all),
 | 
				
			||||||
			       b_all->logical_bytenr, b_all->dev_state->name,
 | 
								       b_all->logical_bytenr, b_all->dev_state->name,
 | 
				
			||||||
			       b_all->dev_bytenr, b_all->mirror_num);
 | 
								       b_all->dev_bytenr, b_all->mirror_num);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -783,8 +783,7 @@ void __init btrfs_init_compress(void)
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		workspace = btrfs_compress_op[i]->alloc_workspace();
 | 
							workspace = btrfs_compress_op[i]->alloc_workspace();
 | 
				
			||||||
		if (IS_ERR(workspace)) {
 | 
							if (IS_ERR(workspace)) {
 | 
				
			||||||
			printk(KERN_WARNING
 | 
								pr_warn("BTRFS: cannot preallocate compression workspace, will try later\n");
 | 
				
			||||||
	"BTRFS: cannot preallocate compression workspace, will try later");
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			atomic_set(&btrfs_comp_ws[i].total_ws, 1);
 | 
								atomic_set(&btrfs_comp_ws[i].total_ws, 1);
 | 
				
			||||||
			btrfs_comp_ws[i].free_ws = 1;
 | 
								btrfs_comp_ws[i].free_ws = 1;
 | 
				
			||||||
| 
						 | 
					@ -854,8 +853,7 @@ static struct list_head *find_workspace(int type)
 | 
				
			||||||
					/* no burst */ 1);
 | 
										/* no burst */ 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (__ratelimit(&_rs)) {
 | 
								if (__ratelimit(&_rs)) {
 | 
				
			||||||
				printk(KERN_WARNING
 | 
									pr_warn("no compression workspaces, low memory, retrying\n");
 | 
				
			||||||
			    "no compression workspaces, low memory, retrying");
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		goto again;
 | 
							goto again;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4791,7 +4791,7 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
 | 
				
			||||||
		for (i = slot; i < nritems; i++) {
 | 
							for (i = slot; i < nritems; i++) {
 | 
				
			||||||
			u32 ioff;
 | 
								u32 ioff;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			item = btrfs_item_nr( i);
 | 
								item = btrfs_item_nr(i);
 | 
				
			||||||
			ioff = btrfs_token_item_offset(leaf, item, &token);
 | 
								ioff = btrfs_token_item_offset(leaf, item, &token);
 | 
				
			||||||
			btrfs_set_token_item_offset(leaf, item,
 | 
								btrfs_set_token_item_offset(leaf, item,
 | 
				
			||||||
						    ioff - total_data, &token);
 | 
											    ioff - total_data, &token);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1435,13 +1435,13 @@ static inline void btrfs_init_map_token (struct btrfs_map_token *token)
 | 
				
			||||||
#define cpu_to_le8(v) (v)
 | 
					#define cpu_to_le8(v) (v)
 | 
				
			||||||
#define __le8 u8
 | 
					#define __le8 u8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define read_eb_member(eb, ptr, type, member, result) (			\
 | 
					#define read_eb_member(eb, ptr, type, member, result) (\
 | 
				
			||||||
	read_extent_buffer(eb, (char *)(result),			\
 | 
						read_extent_buffer(eb, (char *)(result),			\
 | 
				
			||||||
			   ((unsigned long)(ptr)) +			\
 | 
								   ((unsigned long)(ptr)) +			\
 | 
				
			||||||
			    offsetof(type, member),			\
 | 
								    offsetof(type, member),			\
 | 
				
			||||||
			   sizeof(((type *)0)->member)))
 | 
								   sizeof(((type *)0)->member)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define write_eb_member(eb, ptr, type, member, result) (		\
 | 
					#define write_eb_member(eb, ptr, type, member, result) (\
 | 
				
			||||||
	write_extent_buffer(eb, (char *)(result),			\
 | 
						write_extent_buffer(eb, (char *)(result),			\
 | 
				
			||||||
			   ((unsigned long)(ptr)) +			\
 | 
								   ((unsigned long)(ptr)) +			\
 | 
				
			||||||
			    offsetof(type, member),			\
 | 
								    offsetof(type, member),			\
 | 
				
			||||||
| 
						 | 
					@ -3358,7 +3358,7 @@ do {									\
 | 
				
			||||||
	btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, ##args)
 | 
						btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, ##args)
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
#define btrfs_debug(fs_info, fmt, args...) \
 | 
					#define btrfs_debug(fs_info, fmt, args...) \
 | 
				
			||||||
    no_printk(KERN_DEBUG fmt, ##args)
 | 
						no_printk(KERN_DEBUG fmt, ##args)
 | 
				
			||||||
#define btrfs_debug_in_rcu(fs_info, fmt, args...) \
 | 
					#define btrfs_debug_in_rcu(fs_info, fmt, args...) \
 | 
				
			||||||
	no_printk(KERN_DEBUG fmt, ##args)
 | 
						no_printk(KERN_DEBUG fmt, ##args)
 | 
				
			||||||
#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \
 | 
					#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -427,7 +427,7 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
 | 
						if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: unsupported checksum algorithm %u\n",
 | 
							pr_err("BTRFS: unsupported checksum algorithm %u\n",
 | 
				
			||||||
				csum_type);
 | 
									csum_type);
 | 
				
			||||||
		ret = 1;
 | 
							ret = 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -4114,24 +4114,24 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
 | 
				
			||||||
	int ret = 0;
 | 
						int ret = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (btrfs_super_magic(sb) != BTRFS_MAGIC) {
 | 
						if (btrfs_super_magic(sb) != BTRFS_MAGIC) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: no valid FS found\n");
 | 
							pr_err("BTRFS: no valid FS found\n");
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP)
 | 
						if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP)
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: unrecognized super flag: %llu\n",
 | 
							pr_warn("BTRFS: unrecognized super flag: %llu\n",
 | 
				
			||||||
				btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP);
 | 
									btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP);
 | 
				
			||||||
	if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) {
 | 
						if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: tree_root level too big: %d >= %d\n",
 | 
							pr_err("BTRFS: tree_root level too big: %d >= %d\n",
 | 
				
			||||||
				btrfs_super_root_level(sb), BTRFS_MAX_LEVEL);
 | 
									btrfs_super_root_level(sb), BTRFS_MAX_LEVEL);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (btrfs_super_chunk_root_level(sb) >= BTRFS_MAX_LEVEL) {
 | 
						if (btrfs_super_chunk_root_level(sb) >= BTRFS_MAX_LEVEL) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: chunk_root level too big: %d >= %d\n",
 | 
							pr_err("BTRFS: chunk_root level too big: %d >= %d\n",
 | 
				
			||||||
				btrfs_super_chunk_root_level(sb), BTRFS_MAX_LEVEL);
 | 
									btrfs_super_chunk_root_level(sb), BTRFS_MAX_LEVEL);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (btrfs_super_log_root_level(sb) >= BTRFS_MAX_LEVEL) {
 | 
						if (btrfs_super_log_root_level(sb) >= BTRFS_MAX_LEVEL) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: log_root level too big: %d >= %d\n",
 | 
							pr_err("BTRFS: log_root level too big: %d >= %d\n",
 | 
				
			||||||
				btrfs_super_log_root_level(sb), BTRFS_MAX_LEVEL);
 | 
									btrfs_super_log_root_level(sb), BTRFS_MAX_LEVEL);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -4142,22 +4142,22 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (!is_power_of_2(sectorsize) || sectorsize < 4096 ||
 | 
						if (!is_power_of_2(sectorsize) || sectorsize < 4096 ||
 | 
				
			||||||
	    sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) {
 | 
						    sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: invalid sectorsize %llu\n", sectorsize);
 | 
							pr_err("BTRFS: invalid sectorsize %llu\n", sectorsize);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	/* Only PAGE SIZE is supported yet */
 | 
						/* Only PAGE SIZE is supported yet */
 | 
				
			||||||
	if (sectorsize != PAGE_SIZE) {
 | 
						if (sectorsize != PAGE_SIZE) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: sectorsize %llu not supported yet, only support %lu\n",
 | 
							pr_err("BTRFS: sectorsize %llu not supported yet, only support %lu\n",
 | 
				
			||||||
				sectorsize, PAGE_SIZE);
 | 
									sectorsize, PAGE_SIZE);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!is_power_of_2(nodesize) || nodesize < sectorsize ||
 | 
						if (!is_power_of_2(nodesize) || nodesize < sectorsize ||
 | 
				
			||||||
	    nodesize > BTRFS_MAX_METADATA_BLOCKSIZE) {
 | 
						    nodesize > BTRFS_MAX_METADATA_BLOCKSIZE) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: invalid nodesize %llu\n", nodesize);
 | 
							pr_err("BTRFS: invalid nodesize %llu\n", nodesize);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (nodesize != le32_to_cpu(sb->__unused_leafsize)) {
 | 
						if (nodesize != le32_to_cpu(sb->__unused_leafsize)) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: invalid leafsize %u, should be %llu\n",
 | 
							pr_err("BTRFS: invalid leafsize %u, should be %llu\n",
 | 
				
			||||||
				le32_to_cpu(sb->__unused_leafsize),
 | 
									le32_to_cpu(sb->__unused_leafsize),
 | 
				
			||||||
				nodesize);
 | 
									nodesize);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
| 
						 | 
					@ -4165,23 +4165,23 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Root alignment check */
 | 
						/* Root alignment check */
 | 
				
			||||||
	if (!IS_ALIGNED(btrfs_super_root(sb), sectorsize)) {
 | 
						if (!IS_ALIGNED(btrfs_super_root(sb), sectorsize)) {
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: tree_root block unaligned: %llu\n",
 | 
							pr_warn("BTRFS: tree_root block unaligned: %llu\n",
 | 
				
			||||||
				btrfs_super_root(sb));
 | 
									btrfs_super_root(sb));
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!IS_ALIGNED(btrfs_super_chunk_root(sb), sectorsize)) {
 | 
						if (!IS_ALIGNED(btrfs_super_chunk_root(sb), sectorsize)) {
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: chunk_root block unaligned: %llu\n",
 | 
							pr_warn("BTRFS: chunk_root block unaligned: %llu\n",
 | 
				
			||||||
				btrfs_super_chunk_root(sb));
 | 
									btrfs_super_chunk_root(sb));
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!IS_ALIGNED(btrfs_super_log_root(sb), sectorsize)) {
 | 
						if (!IS_ALIGNED(btrfs_super_log_root(sb), sectorsize)) {
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: log_root block unaligned: %llu\n",
 | 
							pr_warn("BTRFS: log_root block unaligned: %llu\n",
 | 
				
			||||||
				btrfs_super_log_root(sb));
 | 
									btrfs_super_log_root(sb));
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (memcmp(fs_info->fsid, sb->dev_item.fsid, BTRFS_UUID_SIZE) != 0) {
 | 
						if (memcmp(fs_info->fsid, sb->dev_item.fsid, BTRFS_UUID_SIZE) != 0) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: dev_item UUID does not match fsid: %pU != %pU\n",
 | 
							pr_err("BTRFS: dev_item UUID does not match fsid: %pU != %pU\n",
 | 
				
			||||||
				fs_info->fsid, sb->dev_item.fsid);
 | 
									fs_info->fsid, sb->dev_item.fsid);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -4201,15 +4201,15 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (btrfs_super_num_devices(sb) > (1UL << 31))
 | 
						if (btrfs_super_num_devices(sb) > (1UL << 31))
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: suspicious number of devices: %llu\n",
 | 
							pr_warn("BTRFS: suspicious number of devices: %llu\n",
 | 
				
			||||||
				btrfs_super_num_devices(sb));
 | 
									btrfs_super_num_devices(sb));
 | 
				
			||||||
	if (btrfs_super_num_devices(sb) == 0) {
 | 
						if (btrfs_super_num_devices(sb) == 0) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: number of devices is 0\n");
 | 
							pr_err("BTRFS: number of devices is 0\n");
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (btrfs_super_bytenr(sb) != BTRFS_SUPER_INFO_OFFSET) {
 | 
						if (btrfs_super_bytenr(sb) != BTRFS_SUPER_INFO_OFFSET) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: super offset mismatch %llu != %u\n",
 | 
							pr_err("BTRFS: super offset mismatch %llu != %u\n",
 | 
				
			||||||
				btrfs_super_bytenr(sb), BTRFS_SUPER_INFO_OFFSET);
 | 
									btrfs_super_bytenr(sb), BTRFS_SUPER_INFO_OFFSET);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -4219,14 +4219,14 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
 | 
				
			||||||
	 * and one chunk
 | 
						 * and one chunk
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (btrfs_super_sys_array_size(sb) > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) {
 | 
						if (btrfs_super_sys_array_size(sb) > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: system chunk array too big %u > %u\n",
 | 
							pr_err("BTRFS: system chunk array too big %u > %u\n",
 | 
				
			||||||
				btrfs_super_sys_array_size(sb),
 | 
									btrfs_super_sys_array_size(sb),
 | 
				
			||||||
				BTRFS_SYSTEM_CHUNK_ARRAY_SIZE);
 | 
									BTRFS_SYSTEM_CHUNK_ARRAY_SIZE);
 | 
				
			||||||
		ret = -EINVAL;
 | 
							ret = -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (btrfs_super_sys_array_size(sb) < sizeof(struct btrfs_disk_key)
 | 
						if (btrfs_super_sys_array_size(sb) < sizeof(struct btrfs_disk_key)
 | 
				
			||||||
			+ sizeof(struct btrfs_chunk)) {
 | 
								+ sizeof(struct btrfs_chunk)) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: system chunk array too small %u < %zu\n",
 | 
							pr_err("BTRFS: system chunk array too small %u < %zu\n",
 | 
				
			||||||
				btrfs_super_sys_array_size(sb),
 | 
									btrfs_super_sys_array_size(sb),
 | 
				
			||||||
				sizeof(struct btrfs_disk_key)
 | 
									sizeof(struct btrfs_disk_key)
 | 
				
			||||||
				+ sizeof(struct btrfs_chunk));
 | 
									+ sizeof(struct btrfs_chunk));
 | 
				
			||||||
| 
						 | 
					@ -4238,13 +4238,11 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
 | 
				
			||||||
	 * but it's still possible that it's the one that's wrong.
 | 
						 * but it's still possible that it's the one that's wrong.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (btrfs_super_generation(sb) < btrfs_super_chunk_root_generation(sb))
 | 
						if (btrfs_super_generation(sb) < btrfs_super_chunk_root_generation(sb))
 | 
				
			||||||
		printk(KERN_WARNING
 | 
							pr_warn("BTRFS: suspicious: generation < chunk_root_generation: %llu < %llu\n",
 | 
				
			||||||
			"BTRFS: suspicious: generation < chunk_root_generation: %llu < %llu\n",
 | 
					 | 
				
			||||||
			btrfs_super_generation(sb), btrfs_super_chunk_root_generation(sb));
 | 
								btrfs_super_generation(sb), btrfs_super_chunk_root_generation(sb));
 | 
				
			||||||
	if (btrfs_super_generation(sb) < btrfs_super_cache_generation(sb)
 | 
						if (btrfs_super_generation(sb) < btrfs_super_cache_generation(sb)
 | 
				
			||||||
	    && btrfs_super_cache_generation(sb) != (u64)-1)
 | 
						    && btrfs_super_cache_generation(sb) != (u64)-1)
 | 
				
			||||||
		printk(KERN_WARNING
 | 
							pr_warn("BTRFS: suspicious: generation < cache_generation: %llu < %llu\n",
 | 
				
			||||||
			"BTRFS: suspicious: generation < cache_generation: %llu < %llu\n",
 | 
					 | 
				
			||||||
			btrfs_super_generation(sb), btrfs_super_cache_generation(sb));
 | 
								btrfs_super_generation(sb), btrfs_super_cache_generation(sb));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7914,12 +7914,12 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
 | 
				
			||||||
	int index = 0;
 | 
						int index = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock(&info->lock);
 | 
						spin_lock(&info->lock);
 | 
				
			||||||
	printk(KERN_INFO "BTRFS: space_info %llu has %llu free, is %sfull\n",
 | 
						pr_info("BTRFS: space_info %llu has %llu free, is %sfull\n",
 | 
				
			||||||
	       info->flags,
 | 
						       info->flags,
 | 
				
			||||||
	       info->total_bytes - info->bytes_used - info->bytes_pinned -
 | 
						       info->total_bytes - info->bytes_used - info->bytes_pinned -
 | 
				
			||||||
	       info->bytes_reserved - info->bytes_readonly -
 | 
						       info->bytes_reserved - info->bytes_readonly -
 | 
				
			||||||
	       info->bytes_may_use, (info->full) ? "" : "not ");
 | 
						       info->bytes_may_use, (info->full) ? "" : "not ");
 | 
				
			||||||
	printk(KERN_INFO "BTRFS: space_info total=%llu, used=%llu, pinned=%llu, reserved=%llu, may_use=%llu, readonly=%llu\n",
 | 
						pr_info("BTRFS: space_info total=%llu, used=%llu, pinned=%llu, reserved=%llu, may_use=%llu, readonly=%llu\n",
 | 
				
			||||||
	       info->total_bytes, info->bytes_used, info->bytes_pinned,
 | 
						       info->total_bytes, info->bytes_used, info->bytes_pinned,
 | 
				
			||||||
	       info->bytes_reserved, info->bytes_may_use,
 | 
						       info->bytes_reserved, info->bytes_may_use,
 | 
				
			||||||
	       info->bytes_readonly);
 | 
						       info->bytes_readonly);
 | 
				
			||||||
| 
						 | 
					@ -7932,7 +7932,7 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
 | 
				
			||||||
again:
 | 
					again:
 | 
				
			||||||
	list_for_each_entry(cache, &info->block_groups[index], list) {
 | 
						list_for_each_entry(cache, &info->block_groups[index], list) {
 | 
				
			||||||
		spin_lock(&cache->lock);
 | 
							spin_lock(&cache->lock);
 | 
				
			||||||
		printk(KERN_INFO "BTRFS: block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n",
 | 
							pr_info("BTRFS: block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n",
 | 
				
			||||||
		       cache->key.objectid, cache->key.offset,
 | 
							       cache->key.objectid, cache->key.offset,
 | 
				
			||||||
		       btrfs_block_group_used(&cache->item), cache->pinned,
 | 
							       btrfs_block_group_used(&cache->item), cache->pinned,
 | 
				
			||||||
		       cache->reserved, cache->ro ? "[readonly]" : "");
 | 
							       cache->reserved, cache->ro ? "[readonly]" : "");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,7 +75,7 @@ void btrfs_leak_debug_check(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (!list_empty(&buffers)) {
 | 
						while (!list_empty(&buffers)) {
 | 
				
			||||||
		eb = list_entry(buffers.next, struct extent_buffer, leak_list);
 | 
							eb = list_entry(buffers.next, struct extent_buffer, leak_list);
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: buffer leak start %llu len %lu refs %d\n",
 | 
							pr_err("BTRFS: buffer leak start %llu len %lu refs %d\n",
 | 
				
			||||||
		       eb->start, eb->len, atomic_read(&eb->refs));
 | 
							       eb->start, eb->len, atomic_read(&eb->refs));
 | 
				
			||||||
		list_del(&eb->leak_list);
 | 
							list_del(&eb->leak_list);
 | 
				
			||||||
		kmem_cache_free(extent_buffer_cache, eb);
 | 
							kmem_cache_free(extent_buffer_cache, eb);
 | 
				
			||||||
| 
						 | 
					@ -460,7 +460,7 @@ static int insert_state(struct extent_io_tree *tree,
 | 
				
			||||||
	if (node) {
 | 
						if (node) {
 | 
				
			||||||
		struct extent_state *found;
 | 
							struct extent_state *found;
 | 
				
			||||||
		found = rb_entry(node, struct extent_state, rb_node);
 | 
							found = rb_entry(node, struct extent_state, rb_node);
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: found node %llu %llu on insert of %llu %llu\n",
 | 
							pr_err("BTRFS: found node %llu %llu on insert of %llu %llu\n",
 | 
				
			||||||
		       found->start, found->end, start, end);
 | 
							       found->start, found->end, start, end);
 | 
				
			||||||
		return -EEXIST;
 | 
							return -EEXIST;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2346,7 +2346,7 @@ int __btrfs_add_free_space(struct btrfs_free_space_ctl *ctl,
 | 
				
			||||||
	spin_unlock(&ctl->tree_lock);
 | 
						spin_unlock(&ctl->tree_lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
		printk(KERN_CRIT "BTRFS: unable to add free space :%d\n", ret);
 | 
							pr_crit("BTRFS: unable to add free space :%d\n", ret);
 | 
				
			||||||
		ASSERT(ret != -EEXIST);
 | 
							ASSERT(ret != -EEXIST);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -141,7 +141,7 @@ static int lzo_compress_pages(struct list_head *ws,
 | 
				
			||||||
		ret = lzo1x_1_compress(data_in, in_len, workspace->cbuf,
 | 
							ret = lzo1x_1_compress(data_in, in_len, workspace->cbuf,
 | 
				
			||||||
				       &out_len, workspace->mem);
 | 
									       &out_len, workspace->mem);
 | 
				
			||||||
		if (ret != LZO_E_OK) {
 | 
							if (ret != LZO_E_OK) {
 | 
				
			||||||
			printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n",
 | 
								pr_debug("BTRFS: deflate in loop returned %d\n",
 | 
				
			||||||
			       ret);
 | 
								       ret);
 | 
				
			||||||
			ret = -EIO;
 | 
								ret = -EIO;
 | 
				
			||||||
			goto out;
 | 
								goto out;
 | 
				
			||||||
| 
						 | 
					@ -356,7 +356,7 @@ static int lzo_decompress_biovec(struct list_head *ws,
 | 
				
			||||||
		if (need_unmap)
 | 
							if (need_unmap)
 | 
				
			||||||
			kunmap(pages_in[page_in_index - 1]);
 | 
								kunmap(pages_in[page_in_index - 1]);
 | 
				
			||||||
		if (ret != LZO_E_OK) {
 | 
							if (ret != LZO_E_OK) {
 | 
				
			||||||
			printk(KERN_WARNING "BTRFS: decompress failed\n");
 | 
								pr_warn("BTRFS: decompress failed\n");
 | 
				
			||||||
			ret = -EIO;
 | 
								ret = -EIO;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -402,7 +402,7 @@ static int lzo_decompress(struct list_head *ws, unsigned char *data_in,
 | 
				
			||||||
	out_len = PAGE_SIZE;
 | 
						out_len = PAGE_SIZE;
 | 
				
			||||||
	ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len);
 | 
						ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len);
 | 
				
			||||||
	if (ret != LZO_E_OK) {
 | 
						if (ret != LZO_E_OK) {
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: decompress failed!\n");
 | 
							pr_warn("BTRFS: decompress failed!\n");
 | 
				
			||||||
		ret = -EIO;
 | 
							ret = -EIO;
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,11 +24,11 @@ static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int num_stripes = btrfs_chunk_num_stripes(eb, chunk);
 | 
						int num_stripes = btrfs_chunk_num_stripes(eb, chunk);
 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
	printk(KERN_INFO "\t\tchunk length %llu owner %llu type %llu num_stripes %d\n",
 | 
						pr_info("\t\tchunk length %llu owner %llu type %llu num_stripes %d\n",
 | 
				
			||||||
	       btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk),
 | 
						       btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk),
 | 
				
			||||||
	       btrfs_chunk_type(eb, chunk), num_stripes);
 | 
						       btrfs_chunk_type(eb, chunk), num_stripes);
 | 
				
			||||||
	for (i = 0 ; i < num_stripes ; i++) {
 | 
						for (i = 0 ; i < num_stripes ; i++) {
 | 
				
			||||||
		printk(KERN_INFO "\t\t\tstripe %d devid %llu offset %llu\n", i,
 | 
							pr_info("\t\t\tstripe %d devid %llu offset %llu\n", i,
 | 
				
			||||||
		      btrfs_stripe_devid_nr(eb, chunk, i),
 | 
							      btrfs_stripe_devid_nr(eb, chunk, i),
 | 
				
			||||||
		      btrfs_stripe_offset_nr(eb, chunk, i));
 | 
							      btrfs_stripe_offset_nr(eb, chunk, i));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@ static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
 | 
				
			||||||
static void print_dev_item(struct extent_buffer *eb,
 | 
					static void print_dev_item(struct extent_buffer *eb,
 | 
				
			||||||
			   struct btrfs_dev_item *dev_item)
 | 
								   struct btrfs_dev_item *dev_item)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	printk(KERN_INFO "\t\tdev item devid %llu total_bytes %llu bytes used %llu\n",
 | 
						pr_info("\t\tdev item devid %llu total_bytes %llu bytes used %llu\n",
 | 
				
			||||||
	       btrfs_device_id(eb, dev_item),
 | 
						       btrfs_device_id(eb, dev_item),
 | 
				
			||||||
	       btrfs_device_total_bytes(eb, dev_item),
 | 
						       btrfs_device_total_bytes(eb, dev_item),
 | 
				
			||||||
	       btrfs_device_bytes_used(eb, dev_item));
 | 
						       btrfs_device_bytes_used(eb, dev_item));
 | 
				
			||||||
| 
						 | 
					@ -44,7 +44,7 @@ static void print_dev_item(struct extent_buffer *eb,
 | 
				
			||||||
static void print_extent_data_ref(struct extent_buffer *eb,
 | 
					static void print_extent_data_ref(struct extent_buffer *eb,
 | 
				
			||||||
				  struct btrfs_extent_data_ref *ref)
 | 
									  struct btrfs_extent_data_ref *ref)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	printk(KERN_INFO "\t\textent data backref root %llu objectid %llu offset %llu count %u\n",
 | 
						pr_info("\t\textent data backref root %llu objectid %llu offset %llu count %u\n",
 | 
				
			||||||
	       btrfs_extent_data_ref_root(eb, ref),
 | 
						       btrfs_extent_data_ref_root(eb, ref),
 | 
				
			||||||
	       btrfs_extent_data_ref_objectid(eb, ref),
 | 
						       btrfs_extent_data_ref_objectid(eb, ref),
 | 
				
			||||||
	       btrfs_extent_data_ref_offset(eb, ref),
 | 
						       btrfs_extent_data_ref_offset(eb, ref),
 | 
				
			||||||
| 
						 | 
					@ -69,7 +69,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
 | 
				
			||||||
		struct btrfs_extent_item_v0 *ei0;
 | 
							struct btrfs_extent_item_v0 *ei0;
 | 
				
			||||||
		BUG_ON(item_size != sizeof(*ei0));
 | 
							BUG_ON(item_size != sizeof(*ei0));
 | 
				
			||||||
		ei0 = btrfs_item_ptr(eb, slot, struct btrfs_extent_item_v0);
 | 
							ei0 = btrfs_item_ptr(eb, slot, struct btrfs_extent_item_v0);
 | 
				
			||||||
		printk(KERN_INFO "\t\textent refs %u\n",
 | 
							pr_info("\t\textent refs %u\n",
 | 
				
			||||||
		       btrfs_extent_refs_v0(eb, ei0));
 | 
							       btrfs_extent_refs_v0(eb, ei0));
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -80,7 +80,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
 | 
				
			||||||
	ei = btrfs_item_ptr(eb, slot, struct btrfs_extent_item);
 | 
						ei = btrfs_item_ptr(eb, slot, struct btrfs_extent_item);
 | 
				
			||||||
	flags = btrfs_extent_flags(eb, ei);
 | 
						flags = btrfs_extent_flags(eb, ei);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printk(KERN_INFO "\t\textent refs %llu gen %llu flags %llu\n",
 | 
						pr_info("\t\textent refs %llu gen %llu flags %llu\n",
 | 
				
			||||||
	       btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei),
 | 
						       btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei),
 | 
				
			||||||
	       flags);
 | 
						       flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -89,7 +89,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
 | 
				
			||||||
		struct btrfs_tree_block_info *info;
 | 
							struct btrfs_tree_block_info *info;
 | 
				
			||||||
		info = (struct btrfs_tree_block_info *)(ei + 1);
 | 
							info = (struct btrfs_tree_block_info *)(ei + 1);
 | 
				
			||||||
		btrfs_tree_block_key(eb, info, &key);
 | 
							btrfs_tree_block_key(eb, info, &key);
 | 
				
			||||||
		printk(KERN_INFO "\t\ttree block key (%llu %u %llu) level %d\n",
 | 
							pr_info("\t\ttree block key (%llu %u %llu) level %d\n",
 | 
				
			||||||
		       btrfs_disk_key_objectid(&key), key.type,
 | 
							       btrfs_disk_key_objectid(&key), key.type,
 | 
				
			||||||
		       btrfs_disk_key_offset(&key),
 | 
							       btrfs_disk_key_offset(&key),
 | 
				
			||||||
		       btrfs_tree_block_level(eb, info));
 | 
							       btrfs_tree_block_level(eb, info));
 | 
				
			||||||
| 
						 | 
					@ -106,10 +106,10 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
 | 
				
			||||||
		offset = btrfs_extent_inline_ref_offset(eb, iref);
 | 
							offset = btrfs_extent_inline_ref_offset(eb, iref);
 | 
				
			||||||
		switch (type) {
 | 
							switch (type) {
 | 
				
			||||||
		case BTRFS_TREE_BLOCK_REF_KEY:
 | 
							case BTRFS_TREE_BLOCK_REF_KEY:
 | 
				
			||||||
			printk(KERN_INFO "\t\ttree block backref root %llu\n", offset);
 | 
								pr_info("\t\ttree block backref root %llu\n", offset);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_SHARED_BLOCK_REF_KEY:
 | 
							case BTRFS_SHARED_BLOCK_REF_KEY:
 | 
				
			||||||
			printk(KERN_INFO "\t\tshared block backref parent %llu\n", offset);
 | 
								pr_info("\t\tshared block backref parent %llu\n", offset);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_EXTENT_DATA_REF_KEY:
 | 
							case BTRFS_EXTENT_DATA_REF_KEY:
 | 
				
			||||||
			dref = (struct btrfs_extent_data_ref *)(&iref->offset);
 | 
								dref = (struct btrfs_extent_data_ref *)(&iref->offset);
 | 
				
			||||||
| 
						 | 
					@ -117,7 +117,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_SHARED_DATA_REF_KEY:
 | 
							case BTRFS_SHARED_DATA_REF_KEY:
 | 
				
			||||||
			sref = (struct btrfs_shared_data_ref *)(iref + 1);
 | 
								sref = (struct btrfs_shared_data_ref *)(iref + 1);
 | 
				
			||||||
			printk(KERN_INFO "\t\tshared data backref parent %llu count %u\n",
 | 
								pr_info("\t\tshared data backref parent %llu count %u\n",
 | 
				
			||||||
			       offset, btrfs_shared_data_ref_count(eb, sref));
 | 
								       offset, btrfs_shared_data_ref_count(eb, sref));
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
| 
						 | 
					@ -154,7 +154,7 @@ static void print_uuid_item(struct extent_buffer *l, unsigned long offset,
 | 
				
			||||||
		__le64 subvol_id;
 | 
							__le64 subvol_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		read_extent_buffer(l, &subvol_id, offset, sizeof(subvol_id));
 | 
							read_extent_buffer(l, &subvol_id, offset, sizeof(subvol_id));
 | 
				
			||||||
		printk(KERN_INFO "\t\tsubvol_id %llu\n",
 | 
							pr_info("\t\tsubvol_id %llu\n",
 | 
				
			||||||
		       (unsigned long long)le64_to_cpu(subvol_id));
 | 
							       (unsigned long long)le64_to_cpu(subvol_id));
 | 
				
			||||||
		item_size -= sizeof(u64);
 | 
							item_size -= sizeof(u64);
 | 
				
			||||||
		offset += sizeof(u64);
 | 
							offset += sizeof(u64);
 | 
				
			||||||
| 
						 | 
					@ -188,13 +188,13 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 | 
				
			||||||
		item = btrfs_item_nr(i);
 | 
							item = btrfs_item_nr(i);
 | 
				
			||||||
		btrfs_item_key_to_cpu(l, &key, i);
 | 
							btrfs_item_key_to_cpu(l, &key, i);
 | 
				
			||||||
		type = key.type;
 | 
							type = key.type;
 | 
				
			||||||
		printk(KERN_INFO "\titem %d key (%llu %u %llu) itemoff %d itemsize %d\n",
 | 
							pr_info("\titem %d key (%llu %u %llu) itemoff %d itemsize %d\n",
 | 
				
			||||||
			i, key.objectid, type, key.offset,
 | 
								i, key.objectid, type, key.offset,
 | 
				
			||||||
			btrfs_item_offset(l, item), btrfs_item_size(l, item));
 | 
								btrfs_item_offset(l, item), btrfs_item_size(l, item));
 | 
				
			||||||
		switch (type) {
 | 
							switch (type) {
 | 
				
			||||||
		case BTRFS_INODE_ITEM_KEY:
 | 
							case BTRFS_INODE_ITEM_KEY:
 | 
				
			||||||
			ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
 | 
								ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
 | 
				
			||||||
			printk(KERN_INFO "\t\tinode generation %llu size %llu mode %o\n",
 | 
								pr_info("\t\tinode generation %llu size %llu mode %o\n",
 | 
				
			||||||
			       btrfs_inode_generation(l, ii),
 | 
								       btrfs_inode_generation(l, ii),
 | 
				
			||||||
			       btrfs_inode_size(l, ii),
 | 
								       btrfs_inode_size(l, ii),
 | 
				
			||||||
			       btrfs_inode_mode(l, ii));
 | 
								       btrfs_inode_mode(l, ii));
 | 
				
			||||||
| 
						 | 
					@ -202,13 +202,13 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 | 
				
			||||||
		case BTRFS_DIR_ITEM_KEY:
 | 
							case BTRFS_DIR_ITEM_KEY:
 | 
				
			||||||
			di = btrfs_item_ptr(l, i, struct btrfs_dir_item);
 | 
								di = btrfs_item_ptr(l, i, struct btrfs_dir_item);
 | 
				
			||||||
			btrfs_dir_item_key_to_cpu(l, di, &found_key);
 | 
								btrfs_dir_item_key_to_cpu(l, di, &found_key);
 | 
				
			||||||
			printk(KERN_INFO "\t\tdir oid %llu type %u\n",
 | 
								pr_info("\t\tdir oid %llu type %u\n",
 | 
				
			||||||
				found_key.objectid,
 | 
									found_key.objectid,
 | 
				
			||||||
				btrfs_dir_type(l, di));
 | 
									btrfs_dir_type(l, di));
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_ROOT_ITEM_KEY:
 | 
							case BTRFS_ROOT_ITEM_KEY:
 | 
				
			||||||
			ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
 | 
								ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
 | 
				
			||||||
			printk(KERN_INFO "\t\troot data bytenr %llu refs %u\n",
 | 
								pr_info("\t\troot data bytenr %llu refs %u\n",
 | 
				
			||||||
				btrfs_disk_root_bytenr(l, ri),
 | 
									btrfs_disk_root_bytenr(l, ri),
 | 
				
			||||||
				btrfs_disk_root_refs(l, ri));
 | 
									btrfs_disk_root_refs(l, ri));
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
| 
						 | 
					@ -217,10 +217,10 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 | 
				
			||||||
			print_extent_item(l, i, type);
 | 
								print_extent_item(l, i, type);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_TREE_BLOCK_REF_KEY:
 | 
							case BTRFS_TREE_BLOCK_REF_KEY:
 | 
				
			||||||
			printk(KERN_INFO "\t\ttree block backref\n");
 | 
								pr_info("\t\ttree block backref\n");
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_SHARED_BLOCK_REF_KEY:
 | 
							case BTRFS_SHARED_BLOCK_REF_KEY:
 | 
				
			||||||
			printk(KERN_INFO "\t\tshared block backref\n");
 | 
								pr_info("\t\tshared block backref\n");
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_EXTENT_DATA_REF_KEY:
 | 
							case BTRFS_EXTENT_DATA_REF_KEY:
 | 
				
			||||||
			dref = btrfs_item_ptr(l, i,
 | 
								dref = btrfs_item_ptr(l, i,
 | 
				
			||||||
| 
						 | 
					@ -230,7 +230,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 | 
				
			||||||
		case BTRFS_SHARED_DATA_REF_KEY:
 | 
							case BTRFS_SHARED_DATA_REF_KEY:
 | 
				
			||||||
			sref = btrfs_item_ptr(l, i,
 | 
								sref = btrfs_item_ptr(l, i,
 | 
				
			||||||
					      struct btrfs_shared_data_ref);
 | 
										      struct btrfs_shared_data_ref);
 | 
				
			||||||
			printk(KERN_INFO "\t\tshared data backref count %u\n",
 | 
								pr_info("\t\tshared data backref count %u\n",
 | 
				
			||||||
			       btrfs_shared_data_ref_count(l, sref));
 | 
								       btrfs_shared_data_ref_count(l, sref));
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_EXTENT_DATA_KEY:
 | 
							case BTRFS_EXTENT_DATA_KEY:
 | 
				
			||||||
| 
						 | 
					@ -238,14 +238,14 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 | 
				
			||||||
					    struct btrfs_file_extent_item);
 | 
										    struct btrfs_file_extent_item);
 | 
				
			||||||
			if (btrfs_file_extent_type(l, fi) ==
 | 
								if (btrfs_file_extent_type(l, fi) ==
 | 
				
			||||||
			    BTRFS_FILE_EXTENT_INLINE) {
 | 
								    BTRFS_FILE_EXTENT_INLINE) {
 | 
				
			||||||
				printk(KERN_INFO "\t\tinline extent data size %u\n",
 | 
									pr_info("\t\tinline extent data size %u\n",
 | 
				
			||||||
				       btrfs_file_extent_inline_len(l, i, fi));
 | 
									       btrfs_file_extent_inline_len(l, i, fi));
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			printk(KERN_INFO "\t\textent data disk bytenr %llu nr %llu\n",
 | 
								pr_info("\t\textent data disk bytenr %llu nr %llu\n",
 | 
				
			||||||
			       btrfs_file_extent_disk_bytenr(l, fi),
 | 
								       btrfs_file_extent_disk_bytenr(l, fi),
 | 
				
			||||||
			       btrfs_file_extent_disk_num_bytes(l, fi));
 | 
								       btrfs_file_extent_disk_num_bytes(l, fi));
 | 
				
			||||||
			printk(KERN_INFO "\t\textent data offset %llu nr %llu ram %llu\n",
 | 
								pr_info("\t\textent data offset %llu nr %llu ram %llu\n",
 | 
				
			||||||
			       btrfs_file_extent_offset(l, fi),
 | 
								       btrfs_file_extent_offset(l, fi),
 | 
				
			||||||
			       btrfs_file_extent_num_bytes(l, fi),
 | 
								       btrfs_file_extent_num_bytes(l, fi),
 | 
				
			||||||
			       btrfs_file_extent_ram_bytes(l, fi));
 | 
								       btrfs_file_extent_ram_bytes(l, fi));
 | 
				
			||||||
| 
						 | 
					@ -260,7 +260,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 | 
				
			||||||
		case BTRFS_BLOCK_GROUP_ITEM_KEY:
 | 
							case BTRFS_BLOCK_GROUP_ITEM_KEY:
 | 
				
			||||||
			bi = btrfs_item_ptr(l, i,
 | 
								bi = btrfs_item_ptr(l, i,
 | 
				
			||||||
					    struct btrfs_block_group_item);
 | 
										    struct btrfs_block_group_item);
 | 
				
			||||||
			printk(KERN_INFO "\t\tblock group used %llu\n",
 | 
								pr_info("\t\tblock group used %llu\n",
 | 
				
			||||||
			       btrfs_disk_block_group_used(l, bi));
 | 
								       btrfs_disk_block_group_used(l, bi));
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_CHUNK_ITEM_KEY:
 | 
							case BTRFS_CHUNK_ITEM_KEY:
 | 
				
			||||||
| 
						 | 
					@ -274,36 +274,36 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 | 
				
			||||||
		case BTRFS_DEV_EXTENT_KEY:
 | 
							case BTRFS_DEV_EXTENT_KEY:
 | 
				
			||||||
			dev_extent = btrfs_item_ptr(l, i,
 | 
								dev_extent = btrfs_item_ptr(l, i,
 | 
				
			||||||
						    struct btrfs_dev_extent);
 | 
											    struct btrfs_dev_extent);
 | 
				
			||||||
			printk(KERN_INFO "\t\tdev extent chunk_tree %llu\n\t\tchunk objectid %llu chunk offset %llu length %llu\n",
 | 
								pr_info("\t\tdev extent chunk_tree %llu\n\t\tchunk objectid %llu chunk offset %llu length %llu\n",
 | 
				
			||||||
			       btrfs_dev_extent_chunk_tree(l, dev_extent),
 | 
								       btrfs_dev_extent_chunk_tree(l, dev_extent),
 | 
				
			||||||
			       btrfs_dev_extent_chunk_objectid(l, dev_extent),
 | 
								       btrfs_dev_extent_chunk_objectid(l, dev_extent),
 | 
				
			||||||
			       btrfs_dev_extent_chunk_offset(l, dev_extent),
 | 
								       btrfs_dev_extent_chunk_offset(l, dev_extent),
 | 
				
			||||||
			       btrfs_dev_extent_length(l, dev_extent));
 | 
								       btrfs_dev_extent_length(l, dev_extent));
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_PERSISTENT_ITEM_KEY:
 | 
							case BTRFS_PERSISTENT_ITEM_KEY:
 | 
				
			||||||
			printk(KERN_INFO "\t\tpersistent item objectid %llu offset %llu\n",
 | 
								pr_info("\t\tpersistent item objectid %llu offset %llu\n",
 | 
				
			||||||
					key.objectid, key.offset);
 | 
										key.objectid, key.offset);
 | 
				
			||||||
			switch (key.objectid) {
 | 
								switch (key.objectid) {
 | 
				
			||||||
			case BTRFS_DEV_STATS_OBJECTID:
 | 
								case BTRFS_DEV_STATS_OBJECTID:
 | 
				
			||||||
				printk(KERN_INFO "\t\tdevice stats\n");
 | 
									pr_info("\t\tdevice stats\n");
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			default:
 | 
								default:
 | 
				
			||||||
				printk(KERN_INFO "\t\tunknown persistent item\n");
 | 
									pr_info("\t\tunknown persistent item\n");
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_TEMPORARY_ITEM_KEY:
 | 
							case BTRFS_TEMPORARY_ITEM_KEY:
 | 
				
			||||||
			printk(KERN_INFO "\t\ttemporary item objectid %llu offset %llu\n",
 | 
								pr_info("\t\ttemporary item objectid %llu offset %llu\n",
 | 
				
			||||||
					key.objectid, key.offset);
 | 
										key.objectid, key.offset);
 | 
				
			||||||
			switch (key.objectid) {
 | 
								switch (key.objectid) {
 | 
				
			||||||
			case BTRFS_BALANCE_OBJECTID:
 | 
								case BTRFS_BALANCE_OBJECTID:
 | 
				
			||||||
				printk(KERN_INFO "\t\tbalance status\n");
 | 
									pr_info("\t\tbalance status\n");
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			default:
 | 
								default:
 | 
				
			||||||
				printk(KERN_INFO "\t\tunknown temporary item\n");
 | 
									pr_info("\t\tunknown temporary item\n");
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_DEV_REPLACE_KEY:
 | 
							case BTRFS_DEV_REPLACE_KEY:
 | 
				
			||||||
			printk(KERN_INFO "\t\tdev replace\n");
 | 
								pr_info("\t\tdev replace\n");
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case BTRFS_UUID_KEY_SUBVOL:
 | 
							case BTRFS_UUID_KEY_SUBVOL:
 | 
				
			||||||
		case BTRFS_UUID_KEY_RECEIVED_SUBVOL:
 | 
							case BTRFS_UUID_KEY_RECEIVED_SUBVOL:
 | 
				
			||||||
| 
						 | 
					@ -334,7 +334,7 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
 | 
				
			||||||
		   (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
 | 
							   (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
 | 
				
			||||||
	for (i = 0; i < nr; i++) {
 | 
						for (i = 0; i < nr; i++) {
 | 
				
			||||||
		btrfs_node_key_to_cpu(c, &key, i);
 | 
							btrfs_node_key_to_cpu(c, &key, i);
 | 
				
			||||||
		printk(KERN_INFO "\tkey %d (%llu %u %llu) block %llu\n",
 | 
							pr_info("\tkey %d (%llu %u %llu) block %llu\n",
 | 
				
			||||||
		       i, key.objectid, key.type, key.offset,
 | 
							       i, key.objectid, key.type, key.offset,
 | 
				
			||||||
		       btrfs_node_blockptr(c, i));
 | 
							       btrfs_node_blockptr(c, i));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -820,7 +820,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock(&fs_info->reada_lock);
 | 
						spin_lock(&fs_info->reada_lock);
 | 
				
			||||||
	list_for_each_entry(device, &fs_devices->devices, dev_list) {
 | 
						list_for_each_entry(device, &fs_devices->devices, dev_list) {
 | 
				
			||||||
		printk(KERN_DEBUG "dev %lld has %d in flight\n", device->devid,
 | 
							pr_debug("dev %lld has %d in flight\n", device->devid,
 | 
				
			||||||
			atomic_read(&device->reada_in_flight));
 | 
								atomic_read(&device->reada_in_flight));
 | 
				
			||||||
		index = 0;
 | 
							index = 0;
 | 
				
			||||||
		while (1) {
 | 
							while (1) {
 | 
				
			||||||
| 
						 | 
					@ -829,17 +829,17 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
 | 
				
			||||||
						     (void **)&zone, index, 1);
 | 
											     (void **)&zone, index, 1);
 | 
				
			||||||
			if (ret == 0)
 | 
								if (ret == 0)
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			printk(KERN_DEBUG "  zone %llu-%llu elems %llu locked %d devs",
 | 
								pr_debug("  zone %llu-%llu elems %llu locked %d devs",
 | 
				
			||||||
			       zone->start, zone->end, zone->elems,
 | 
								       zone->start, zone->end, zone->elems,
 | 
				
			||||||
			       zone->locked);
 | 
								       zone->locked);
 | 
				
			||||||
			for (j = 0; j < zone->ndevs; ++j) {
 | 
								for (j = 0; j < zone->ndevs; ++j) {
 | 
				
			||||||
				printk(KERN_CONT " %lld",
 | 
									pr_cont(" %lld",
 | 
				
			||||||
					zone->devs[j]->devid);
 | 
										zone->devs[j]->devid);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (device->reada_curr_zone == zone)
 | 
								if (device->reada_curr_zone == zone)
 | 
				
			||||||
				printk(KERN_CONT " curr off %llu",
 | 
									pr_cont(" curr off %llu",
 | 
				
			||||||
					device->reada_next - zone->start);
 | 
										device->reada_next - zone->start);
 | 
				
			||||||
			printk(KERN_CONT "\n");
 | 
								pr_cont("\n");
 | 
				
			||||||
			index = (zone->end >> PAGE_SHIFT) + 1;
 | 
								index = (zone->end >> PAGE_SHIFT) + 1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		cnt = 0;
 | 
							cnt = 0;
 | 
				
			||||||
| 
						 | 
					@ -851,21 +851,20 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
 | 
				
			||||||
						     (void **)&re, index, 1);
 | 
											     (void **)&re, index, 1);
 | 
				
			||||||
			if (ret == 0)
 | 
								if (ret == 0)
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			printk(KERN_DEBUG
 | 
								pr_debug("  re: logical %llu size %u empty %d scheduled %d",
 | 
				
			||||||
				"  re: logical %llu size %u empty %d scheduled %d",
 | 
					 | 
				
			||||||
				re->logical, fs_info->tree_root->nodesize,
 | 
									re->logical, fs_info->tree_root->nodesize,
 | 
				
			||||||
				list_empty(&re->extctl), re->scheduled);
 | 
									list_empty(&re->extctl), re->scheduled);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for (i = 0; i < re->nzones; ++i) {
 | 
								for (i = 0; i < re->nzones; ++i) {
 | 
				
			||||||
				printk(KERN_CONT " zone %llu-%llu devs",
 | 
									pr_cont(" zone %llu-%llu devs",
 | 
				
			||||||
					re->zones[i]->start,
 | 
										re->zones[i]->start,
 | 
				
			||||||
					re->zones[i]->end);
 | 
										re->zones[i]->end);
 | 
				
			||||||
				for (j = 0; j < re->zones[i]->ndevs; ++j) {
 | 
									for (j = 0; j < re->zones[i]->ndevs; ++j) {
 | 
				
			||||||
					printk(KERN_CONT " %lld",
 | 
										pr_cont(" %lld",
 | 
				
			||||||
						re->zones[i]->devs[j]->devid);
 | 
											re->zones[i]->devs[j]->devid);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			printk(KERN_CONT "\n");
 | 
								pr_cont("\n");
 | 
				
			||||||
			index = (re->logical >> PAGE_SHIFT) + 1;
 | 
								index = (re->logical >> PAGE_SHIFT) + 1;
 | 
				
			||||||
			if (++cnt > 15)
 | 
								if (++cnt > 15)
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
| 
						 | 
					@ -885,20 +884,19 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all)
 | 
				
			||||||
			index = (re->logical >> PAGE_SHIFT) + 1;
 | 
								index = (re->logical >> PAGE_SHIFT) + 1;
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		printk(KERN_DEBUG
 | 
							pr_debug("re: logical %llu size %u list empty %d scheduled %d",
 | 
				
			||||||
			"re: logical %llu size %u list empty %d scheduled %d",
 | 
					 | 
				
			||||||
			re->logical, fs_info->tree_root->nodesize,
 | 
								re->logical, fs_info->tree_root->nodesize,
 | 
				
			||||||
			list_empty(&re->extctl), re->scheduled);
 | 
								list_empty(&re->extctl), re->scheduled);
 | 
				
			||||||
		for (i = 0; i < re->nzones; ++i) {
 | 
							for (i = 0; i < re->nzones; ++i) {
 | 
				
			||||||
			printk(KERN_CONT " zone %llu-%llu devs",
 | 
								pr_cont(" zone %llu-%llu devs",
 | 
				
			||||||
				re->zones[i]->start,
 | 
									re->zones[i]->start,
 | 
				
			||||||
				re->zones[i]->end);
 | 
									re->zones[i]->end);
 | 
				
			||||||
			for (j = 0; j < re->zones[i]->ndevs; ++j) {
 | 
								for (j = 0; j < re->zones[i]->ndevs; ++j) {
 | 
				
			||||||
				printk(KERN_CONT " %lld",
 | 
									pr_cont(" %lld",
 | 
				
			||||||
				       re->zones[i]->devs[j]->devid);
 | 
									       re->zones[i]->devs[j]->devid);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		printk(KERN_CONT "\n");
 | 
							pr_cont("\n");
 | 
				
			||||||
		index = (re->logical >> PAGE_SHIFT) + 1;
 | 
							index = (re->logical >> PAGE_SHIFT) + 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	spin_unlock(&fs_info->reada_lock);
 | 
						spin_unlock(&fs_info->reada_lock);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -151,12 +151,11 @@ void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function
 | 
				
			||||||
		vaf.fmt = fmt;
 | 
							vaf.fmt = fmt;
 | 
				
			||||||
		vaf.va = &args;
 | 
							vaf.va = &args;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		printk(KERN_CRIT
 | 
							pr_crit("BTRFS: error (device %s) in %s:%d: errno=%d %s (%pV)\n",
 | 
				
			||||||
			"BTRFS: error (device %s) in %s:%d: errno=%d %s (%pV)\n",
 | 
					 | 
				
			||||||
			sb->s_id, function, line, errno, errstr, &vaf);
 | 
								sb->s_id, function, line, errno, errstr, &vaf);
 | 
				
			||||||
		va_end(args);
 | 
							va_end(args);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		printk(KERN_CRIT "BTRFS: error (device %s) in %s:%d: errno=%d %s\n",
 | 
							pr_crit("BTRFS: error (device %s) in %s:%d: errno=%d %s\n",
 | 
				
			||||||
			sb->s_id, function, line, errno, errstr);
 | 
								sb->s_id, function, line, errno, errstr);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					@ -925,8 +924,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags,
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case Opt_subvolrootid:
 | 
							case Opt_subvolrootid:
 | 
				
			||||||
			printk(KERN_WARNING
 | 
								pr_warn("BTRFS: 'subvolrootid' mount option is deprecated and has no effect\n");
 | 
				
			||||||
				"BTRFS: 'subvolrootid' mount option is deprecated and has no effect\n");
 | 
					 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case Opt_device:
 | 
							case Opt_device:
 | 
				
			||||||
			device_name = match_strdup(&args[0]);
 | 
								device_name = match_strdup(&args[0]);
 | 
				
			||||||
| 
						 | 
					@ -1150,7 +1148,7 @@ static int btrfs_fill_super(struct super_block *sb,
 | 
				
			||||||
	sb->s_iflags |= SB_I_CGROUPWB;
 | 
						sb->s_iflags |= SB_I_CGROUPWB;
 | 
				
			||||||
	err = open_ctree(sb, fs_devices, (char *)data);
 | 
						err = open_ctree(sb, fs_devices, (char *)data);
 | 
				
			||||||
	if (err) {
 | 
						if (err) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: open_ctree failed\n");
 | 
							pr_err("BTRFS: open_ctree failed\n");
 | 
				
			||||||
		return err;
 | 
							return err;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2356,7 +2354,7 @@ static void btrfs_interface_exit(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void btrfs_print_mod_info(void)
 | 
					static void btrfs_print_mod_info(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	printk(KERN_INFO "Btrfs loaded, crc32c=%s"
 | 
						pr_info("Btrfs loaded, crc32c=%s"
 | 
				
			||||||
#ifdef CONFIG_BTRFS_DEBUG
 | 
					#ifdef CONFIG_BTRFS_DEBUG
 | 
				
			||||||
			", debug=on"
 | 
								", debug=on"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@ static int can_modify_feature(struct btrfs_feature_attr *fa)
 | 
				
			||||||
		clear = BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR;
 | 
							clear = BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR;
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		printk(KERN_WARNING "btrfs: sysfs: unknown feature set %d\n",
 | 
							pr_warn("btrfs: sysfs: unknown feature set %d\n",
 | 
				
			||||||
				fa->feature_set);
 | 
									fa->feature_set);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,7 +65,7 @@ void btrfs_put_transaction(struct btrfs_transaction *transaction)
 | 
				
			||||||
		BUG_ON(!list_empty(&transaction->list));
 | 
							BUG_ON(!list_empty(&transaction->list));
 | 
				
			||||||
		WARN_ON(!RB_EMPTY_ROOT(&transaction->delayed_refs.href_root));
 | 
							WARN_ON(!RB_EMPTY_ROOT(&transaction->delayed_refs.href_root));
 | 
				
			||||||
		if (transaction->delayed_refs.pending_csums)
 | 
							if (transaction->delayed_refs.pending_csums)
 | 
				
			||||||
			printk(KERN_ERR "pending csums is %llu\n",
 | 
								pr_err("pending csums is %llu\n",
 | 
				
			||||||
			       transaction->delayed_refs.pending_csums);
 | 
								       transaction->delayed_refs.pending_csums);
 | 
				
			||||||
		while (!list_empty(&transaction->pending_chunks)) {
 | 
							while (!list_empty(&transaction->pending_chunks)) {
 | 
				
			||||||
			struct extent_map *em;
 | 
								struct extent_map *em;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1140,12 +1140,12 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
 | 
				
			||||||
	ret = device_list_add(path, disk_super, devid, fs_devices_ret);
 | 
						ret = device_list_add(path, disk_super, devid, fs_devices_ret);
 | 
				
			||||||
	if (ret > 0) {
 | 
						if (ret > 0) {
 | 
				
			||||||
		if (disk_super->label[0]) {
 | 
							if (disk_super->label[0]) {
 | 
				
			||||||
			printk(KERN_INFO "BTRFS: device label %s ", disk_super->label);
 | 
								pr_info("BTRFS: device label %s ", disk_super->label);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			printk(KERN_INFO "BTRFS: device fsid %pU ", disk_super->fsid);
 | 
								pr_info("BTRFS: device fsid %pU ", disk_super->fsid);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path);
 | 
							pr_cont("devid %llu transid %llu %s\n", devid, transid, path);
 | 
				
			||||||
		ret = 0;
 | 
							ret = 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!ret && fs_devices_ret)
 | 
						if (!ret && fs_devices_ret)
 | 
				
			||||||
| 
						 | 
					@ -5907,13 +5907,13 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
 | 
				
			||||||
	read_unlock(&em_tree->lock);
 | 
						read_unlock(&em_tree->lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!em) {
 | 
						if (!em) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: couldn't find em for chunk %Lu\n",
 | 
							pr_err("BTRFS: couldn't find em for chunk %Lu\n",
 | 
				
			||||||
		       chunk_start);
 | 
							       chunk_start);
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (em->start != chunk_start) {
 | 
						if (em->start != chunk_start) {
 | 
				
			||||||
		printk(KERN_ERR "BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n",
 | 
							pr_err("BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n",
 | 
				
			||||||
		       em->start, chunk_start);
 | 
							       em->start, chunk_start);
 | 
				
			||||||
		free_extent_map(em);
 | 
							free_extent_map(em);
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
| 
						 | 
					@ -6715,8 +6715,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			num_stripes = btrfs_chunk_num_stripes(sb, chunk);
 | 
								num_stripes = btrfs_chunk_num_stripes(sb, chunk);
 | 
				
			||||||
			if (!num_stripes) {
 | 
								if (!num_stripes) {
 | 
				
			||||||
				printk(KERN_ERR
 | 
									pr_err("BTRFS: invalid number of stripes %u in sys_array at offset %u\n",
 | 
				
			||||||
	    "BTRFS: invalid number of stripes %u in sys_array at offset %u\n",
 | 
					 | 
				
			||||||
					num_stripes, cur_offset);
 | 
										num_stripes, cur_offset);
 | 
				
			||||||
				ret = -EIO;
 | 
									ret = -EIO;
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
| 
						 | 
					@ -6739,8 +6738,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
 | 
				
			||||||
			if (ret)
 | 
								if (ret)
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			printk(KERN_ERR
 | 
								pr_err("BTRFS: unexpected item type %u in sys_array at offset %u\n",
 | 
				
			||||||
		"BTRFS: unexpected item type %u in sys_array at offset %u\n",
 | 
					 | 
				
			||||||
				(u32)key.type, cur_offset);
 | 
									(u32)key.type, cur_offset);
 | 
				
			||||||
			ret = -EIO;
 | 
								ret = -EIO;
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
| 
						 | 
					@ -6754,7 +6752,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out_short_read:
 | 
					out_short_read:
 | 
				
			||||||
	printk(KERN_ERR "BTRFS: sys_array too short to read %u bytes at offset %u\n",
 | 
						pr_err("BTRFS: sys_array too short to read %u bytes at offset %u\n",
 | 
				
			||||||
			len, cur_offset);
 | 
								len, cur_offset);
 | 
				
			||||||
	clear_extent_buffer_uptodate(sb);
 | 
						clear_extent_buffer_uptodate(sb);
 | 
				
			||||||
	free_extent_buffer_stale(sb);
 | 
						free_extent_buffer_stale(sb);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -95,7 +95,7 @@ static int zlib_compress_pages(struct list_head *ws,
 | 
				
			||||||
	*total_in = 0;
 | 
						*total_in = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (Z_OK != zlib_deflateInit(&workspace->strm, 3)) {
 | 
						if (Z_OK != zlib_deflateInit(&workspace->strm, 3)) {
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: deflateInit failed\n");
 | 
							pr_warn("BTRFS: deflateInit failed\n");
 | 
				
			||||||
		ret = -EIO;
 | 
							ret = -EIO;
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -123,7 +123,7 @@ static int zlib_compress_pages(struct list_head *ws,
 | 
				
			||||||
	while (workspace->strm.total_in < len) {
 | 
						while (workspace->strm.total_in < len) {
 | 
				
			||||||
		ret = zlib_deflate(&workspace->strm, Z_SYNC_FLUSH);
 | 
							ret = zlib_deflate(&workspace->strm, Z_SYNC_FLUSH);
 | 
				
			||||||
		if (ret != Z_OK) {
 | 
							if (ret != Z_OK) {
 | 
				
			||||||
			printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n",
 | 
								pr_debug("BTRFS: deflate in loop returned %d\n",
 | 
				
			||||||
			       ret);
 | 
								       ret);
 | 
				
			||||||
			zlib_deflateEnd(&workspace->strm);
 | 
								zlib_deflateEnd(&workspace->strm);
 | 
				
			||||||
			ret = -EIO;
 | 
								ret = -EIO;
 | 
				
			||||||
| 
						 | 
					@ -249,7 +249,7 @@ static int zlib_decompress_biovec(struct list_head *ws, struct page **pages_in,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
 | 
						if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: inflateInit failed\n");
 | 
							pr_warn("BTRFS: inflateInit failed\n");
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	while (workspace->strm.total_in < srclen) {
 | 
						while (workspace->strm.total_in < srclen) {
 | 
				
			||||||
| 
						 | 
					@ -339,7 +339,7 @@ static int zlib_decompress(struct list_head *ws, unsigned char *data_in,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
 | 
						if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
 | 
				
			||||||
		printk(KERN_WARNING "BTRFS: inflateInit failed\n");
 | 
							pr_warn("BTRFS: inflateInit failed\n");
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue