Btrfs: Remove superfluous casts from u64 to unsigned long long

u64 is "unsigned long long" on all architectures now, so there's no need to
cast it when formatting it using the "ll" length modifier.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
Geert Uytterhoeven 2013-08-20 13:20:07 +02:00 committed by Chris Mason
parent 1cb048f596
commit c1c9ff7c94
22 changed files with 221 additions and 422 deletions

View File

@ -295,10 +295,9 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
ret = btrfs_search_old_slot(root, &ref->key_for_search, path, time_seq); ret = btrfs_search_old_slot(root, &ref->key_for_search, path, time_seq);
pr_debug("search slot in root %llu (level %d, ref count %d) returned " pr_debug("search slot in root %llu (level %d, ref count %d) returned "
"%d for key (%llu %u %llu)\n", "%d for key (%llu %u %llu)\n",
(unsigned long long)ref->root_id, level, ref->count, ret, ref->root_id, level, ref->count, ret,
(unsigned long long)ref->key_for_search.objectid, ref->key_for_search.objectid, ref->key_for_search.type,
ref->key_for_search.type, ref->key_for_search.offset);
(unsigned long long)ref->key_for_search.offset);
if (ret < 0) if (ret < 0)
goto out; goto out;
@ -1328,8 +1327,7 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
found_key->type != BTRFS_METADATA_ITEM_KEY) || found_key->type != BTRFS_METADATA_ITEM_KEY) ||
found_key->objectid > logical || found_key->objectid > logical ||
found_key->objectid + size <= logical) { found_key->objectid + size <= logical) {
pr_debug("logical %llu is not within any extent\n", pr_debug("logical %llu is not within any extent\n", logical);
(unsigned long long)logical);
return -ENOENT; return -ENOENT;
} }
@ -1342,11 +1340,8 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
pr_debug("logical %llu is at position %llu within the extent (%llu " pr_debug("logical %llu is at position %llu within the extent (%llu "
"EXTENT_ITEM %llu) flags %#llx size %u\n", "EXTENT_ITEM %llu) flags %#llx size %u\n",
(unsigned long long)logical, logical, logical - found_key->objectid, found_key->objectid,
(unsigned long long)(logical - found_key->objectid), found_key->offset, flags, item_size);
(unsigned long long)found_key->objectid,
(unsigned long long)found_key->offset,
(unsigned long long)flags, item_size);
WARN_ON(!flags_ret); WARN_ON(!flags_ret);
if (flags_ret) { if (flags_ret) {
@ -1518,7 +1513,7 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
while (!ret && (root_node = ulist_next(roots, &root_uiter))) { while (!ret && (root_node = ulist_next(roots, &root_uiter))) {
pr_debug("root %llu references leaf %llu, data list " pr_debug("root %llu references leaf %llu, data list "
"%#llx\n", root_node->val, ref_node->val, "%#llx\n", root_node->val, ref_node->val,
(long long)ref_node->aux); ref_node->aux);
ret = iterate_leaf_refs((struct extent_inode_elem *) ret = iterate_leaf_refs((struct extent_inode_elem *)
(uintptr_t)ref_node->aux, (uintptr_t)ref_node->aux,
root_node->val, root_node->val,
@ -1610,9 +1605,8 @@ static int iterate_inode_refs(u64 inum, struct btrfs_root *fs_root,
name_len = btrfs_inode_ref_name_len(eb, iref); name_len = btrfs_inode_ref_name_len(eb, iref);
/* path must be released before calling iterate()! */ /* path must be released before calling iterate()! */
pr_debug("following ref at offset %u for inode %llu in " pr_debug("following ref at offset %u for inode %llu in "
"tree %llu\n", cur, "tree %llu\n", cur, found_key.objectid,
(unsigned long long)found_key.objectid, fs_root->objectid);
(unsigned long long)fs_root->objectid);
ret = iterate(parent, name_len, ret = iterate(parent, name_len,
(unsigned long)(iref + 1), eb, ctx); (unsigned long)(iref + 1), eb, ctx);
if (ret) if (ret)

View File

@ -701,15 +701,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", printk(KERN_INFO "root@%llu\n", next_bytenr);
(unsigned long long)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", printk(KERN_INFO "chunk@%llu\n", next_bytenr);
(unsigned long long)next_bytenr);
break; break;
case 2: case 2:
next_bytenr = btrfs_super_log_root(selected_super); next_bytenr = btrfs_super_log_root(selected_super);
@ -717,8 +715,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", printk(KERN_INFO "log@%llu\n", next_bytenr);
(unsigned long long)next_bytenr);
break; break;
} }
@ -727,7 +724,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
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", printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
(unsigned long long)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;
@ -742,8 +739,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
printk(KERN_INFO "btrfsic:" printk(KERN_INFO "btrfsic:"
" btrfsic_map_block(root @%llu," " btrfsic_map_block(root @%llu,"
" mirror %d) failed!\n", " mirror %d) failed!\n",
(unsigned long long)next_bytenr, next_bytenr, mirror_num);
mirror_num);
kfree(selected_super); kfree(selected_super);
return -1; return -1;
} }
@ -767,7 +763,6 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
if (ret < (int)PAGE_CACHE_SIZE) { if (ret < (int)PAGE_CACHE_SIZE) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: read @logical %llu failed!\n", "btrfsic: read @logical %llu failed!\n",
(unsigned long long)
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);
@ -847,10 +842,8 @@ static int btrfsic_process_superblock_dev_mirror(
printk_in_rcu(KERN_INFO "New initial S-block (bdev %p, %s)" printk_in_rcu(KERN_INFO "New initial S-block (bdev %p, %s)"
" @%llu (%s/%llu/%d)\n", " @%llu (%s/%llu/%d)\n",
superblock_bdev, superblock_bdev,
rcu_str_deref(device->name), rcu_str_deref(device->name), dev_bytenr,
(unsigned long long)dev_bytenr, dev_state->name, dev_bytenr,
dev_state->name,
(unsigned long long)dev_bytenr,
superblock_mirror_num); superblock_mirror_num);
list_add(&superblock_tmp->all_blocks_node, list_add(&superblock_tmp->all_blocks_node,
&state->all_blocks_list); &state->all_blocks_list);
@ -906,7 +899,7 @@ static int btrfsic_process_superblock_dev_mirror(
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", printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
(unsigned long long)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;
struct btrfsic_block_data_ctx tmp_next_block_ctx; struct btrfsic_block_data_ctx tmp_next_block_ctx;
@ -918,8 +911,7 @@ static int btrfsic_process_superblock_dev_mirror(
mirror_num)) { mirror_num)) {
printk(KERN_INFO "btrfsic: btrfsic_map_block(" printk(KERN_INFO "btrfsic: btrfsic_map_block("
"bytenr @%llu, mirror %d) failed!\n", "bytenr @%llu, mirror %d) failed!\n",
(unsigned long long)next_bytenr, next_bytenr, mirror_num);
mirror_num);
brelse(bh); brelse(bh);
return -1; return -1;
} }
@ -1009,13 +1001,9 @@ continue_with_new_stack_frame:
printk(KERN_INFO printk(KERN_INFO
"leaf %llu items %d generation %llu" "leaf %llu items %d generation %llu"
" owner %llu\n", " owner %llu\n",
(unsigned long long) sf->block_ctx->start, sf->nr,
sf->block_ctx->start,
sf->nr,
(unsigned long long)
btrfs_stack_header_generation( btrfs_stack_header_generation(
&leafhdr->header), &leafhdr->header),
(unsigned long long)
btrfs_stack_header_owner( btrfs_stack_header_owner(
&leafhdr->header)); &leafhdr->header));
} }
@ -1137,13 +1125,10 @@ leaf_item_out_of_bounce_error:
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" printk(KERN_INFO "node %llu level %d items %d"
" generation %llu owner %llu\n", " generation %llu owner %llu\n",
(unsigned long long)
sf->block_ctx->start, sf->block_ctx->start,
nodehdr->header.level, sf->nr, nodehdr->header.level, sf->nr,
(unsigned long long)
btrfs_stack_header_generation( btrfs_stack_header_generation(
&nodehdr->header), &nodehdr->header),
(unsigned long long)
btrfs_stack_header_owner( btrfs_stack_header_owner(
&nodehdr->header)); &nodehdr->header));
} }
@ -1294,7 +1279,7 @@ static int btrfsic_create_link_to_next_block(
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", printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
(unsigned long long)next_bytenr, *num_copiesp); next_bytenr, *num_copiesp);
*mirror_nump = 1; *mirror_nump = 1;
} }
@ -1311,7 +1296,7 @@ static int btrfsic_create_link_to_next_block(
if (ret) { if (ret) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n", "btrfsic: btrfsic_map_block(@%llu, mirror=%d) failed!\n",
(unsigned long long)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;
return -1; return -1;
@ -1339,20 +1324,16 @@ static int btrfsic_create_link_to_next_block(
"Referenced block @%llu (%s/%llu/%d)" "Referenced block @%llu (%s/%llu/%d)"
" found in hash table, %c," " found in hash table, %c,"
" bytenr mismatch (!= stored %llu).\n", " bytenr mismatch (!= stored %llu).\n",
(unsigned long long)next_bytenr, next_bytenr, next_block_ctx->dev->name,
next_block_ctx->dev->name, next_block_ctx->dev_bytenr, *mirror_nump,
(unsigned long long)next_block_ctx->dev_bytenr,
*mirror_nump,
btrfsic_get_block_type(state, next_block), btrfsic_get_block_type(state, next_block),
(unsigned long long)next_block->logical_bytenr); next_block->logical_bytenr);
} else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) } else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
printk(KERN_INFO printk(KERN_INFO
"Referenced block @%llu (%s/%llu/%d)" "Referenced block @%llu (%s/%llu/%d)"
" found in hash table, %c.\n", " found in hash table, %c.\n",
(unsigned long long)next_bytenr, next_bytenr, next_block_ctx->dev->name,
next_block_ctx->dev->name, next_block_ctx->dev_bytenr, *mirror_nump,
(unsigned long long)next_block_ctx->dev_bytenr,
*mirror_nump,
btrfsic_get_block_type(state, next_block)); btrfsic_get_block_type(state, next_block));
next_block->logical_bytenr = next_bytenr; next_block->logical_bytenr = next_bytenr;
@ -1404,7 +1385,7 @@ static int btrfsic_create_link_to_next_block(
if (ret < (int)next_block_ctx->len) { if (ret < (int)next_block_ctx->len) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: read block @logical %llu failed!\n", "btrfsic: read block @logical %llu failed!\n",
(unsigned long long)next_bytenr); next_bytenr);
btrfsic_release_block_ctx(next_block_ctx); btrfsic_release_block_ctx(next_block_ctx);
*next_blockp = NULL; *next_blockp = NULL;
return -1; return -1;
@ -1452,7 +1433,6 @@ static int btrfsic_handle_extent_data(
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", printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu\n",
file_extent_item.type, file_extent_item.type,
(unsigned long long)
btrfs_stack_file_extent_disk_bytenr( btrfs_stack_file_extent_disk_bytenr(
&file_extent_item)); &file_extent_item));
return 0; return 0;
@ -1478,11 +1458,9 @@ static int btrfsic_handle_extent_data(
printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu," printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu,"
" offset = %llu, num_bytes = %llu\n", " offset = %llu, num_bytes = %llu\n",
file_extent_item.type, file_extent_item.type,
(unsigned long long)
btrfs_stack_file_extent_disk_bytenr(&file_extent_item), btrfs_stack_file_extent_disk_bytenr(&file_extent_item),
(unsigned long long)
btrfs_stack_file_extent_offset(&file_extent_item), btrfs_stack_file_extent_offset(&file_extent_item),
(unsigned long long)num_bytes); num_bytes);
while (num_bytes > 0) { while (num_bytes > 0) {
u32 chunk_len; u32 chunk_len;
int num_copies; int num_copies;
@ -1498,7 +1476,7 @@ static int btrfsic_handle_extent_data(
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", printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
(unsigned long long)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;
struct btrfsic_block *next_block; struct btrfsic_block *next_block;
@ -1510,8 +1488,7 @@ static int btrfsic_handle_extent_data(
if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE) if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
printk(KERN_INFO printk(KERN_INFO
"\tdisk_bytenr = %llu, num_bytes %u\n", "\tdisk_bytenr = %llu, num_bytes %u\n",
(unsigned long long)next_bytenr, next_bytenr, chunk_len);
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);
@ -1519,8 +1496,7 @@ static int btrfsic_handle_extent_data(
printk(KERN_INFO printk(KERN_INFO
"btrfsic: btrfsic_map_block(@%llu," "btrfsic: btrfsic_map_block(@%llu,"
" mirror=%d) failed!\n", " mirror=%d) failed!\n",
(unsigned long long)next_bytenr, next_bytenr, mirror_num);
mirror_num);
return -1; return -1;
} }
@ -1549,12 +1525,10 @@ static int btrfsic_handle_extent_data(
" found in hash table, D," " found in hash table, D,"
" bytenr mismatch" " bytenr mismatch"
" (!= stored %llu).\n", " (!= stored %llu).\n",
(unsigned long long)next_bytenr, next_bytenr,
next_block_ctx.dev->name, next_block_ctx.dev->name,
(unsigned long long)
next_block_ctx.dev_bytenr, next_block_ctx.dev_bytenr,
mirror_num, mirror_num,
(unsigned long long)
next_block->logical_bytenr); next_block->logical_bytenr);
} }
next_block->logical_bytenr = next_bytenr; next_block->logical_bytenr = next_bytenr;
@ -1681,7 +1655,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
if (block_ctx->dev_bytenr & ((u64)PAGE_CACHE_SIZE - 1)) { if (block_ctx->dev_bytenr & ((u64)PAGE_CACHE_SIZE - 1)) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: read_block() with unaligned bytenr %llu\n", "btrfsic: read_block() with unaligned bytenr %llu\n",
(unsigned long long)block_ctx->dev_bytenr); block_ctx->dev_bytenr);
return -1; return -1;
} }
@ -1778,10 +1752,8 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
printk(KERN_INFO "%c-block @%llu (%s/%llu/%d)\n", printk(KERN_INFO "%c-block @%llu (%s/%llu/%d)\n",
btrfsic_get_block_type(state, b_all), btrfsic_get_block_type(state, b_all),
(unsigned long long)b_all->logical_bytenr, b_all->logical_bytenr, b_all->dev_state->name,
b_all->dev_state->name, b_all->dev_bytenr, b_all->mirror_num);
(unsigned long long)b_all->dev_bytenr,
b_all->mirror_num);
list_for_each(elem_ref_to, &b_all->ref_to_list) { list_for_each(elem_ref_to, &b_all->ref_to_list) {
const struct btrfsic_block_link *const l = const struct btrfsic_block_link *const l =
@ -1793,16 +1765,13 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
" refers %u* to" " refers %u* to"
" %c @%llu (%s/%llu/%d)\n", " %c @%llu (%s/%llu/%d)\n",
btrfsic_get_block_type(state, b_all), btrfsic_get_block_type(state, b_all),
(unsigned long long)b_all->logical_bytenr, b_all->logical_bytenr, b_all->dev_state->name,
b_all->dev_state->name, b_all->dev_bytenr, b_all->mirror_num,
(unsigned long long)b_all->dev_bytenr,
b_all->mirror_num,
l->ref_cnt, l->ref_cnt,
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)
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,
(unsigned long long)l->block_ref_to->dev_bytenr, l->block_ref_to->dev_bytenr,
l->block_ref_to->mirror_num); l->block_ref_to->mirror_num);
} }
@ -1816,16 +1785,12 @@ static void btrfsic_dump_database(struct btrfsic_state *state)
" is ref %u* from" " is ref %u* from"
" %c @%llu (%s/%llu/%d)\n", " %c @%llu (%s/%llu/%d)\n",
btrfsic_get_block_type(state, b_all), btrfsic_get_block_type(state, b_all),
(unsigned long long)b_all->logical_bytenr, b_all->logical_bytenr, b_all->dev_state->name,
b_all->dev_state->name, b_all->dev_bytenr, b_all->mirror_num,
(unsigned long long)b_all->dev_bytenr,
b_all->mirror_num,
l->ref_cnt, l->ref_cnt,
btrfsic_get_block_type(state, l->block_ref_from), btrfsic_get_block_type(state, l->block_ref_from),
(unsigned long long)
l->block_ref_from->logical_bytenr, l->block_ref_from->logical_bytenr,
l->block_ref_from->dev_state->name, l->block_ref_from->dev_state->name,
(unsigned long long)
l->block_ref_from->dev_bytenr, l->block_ref_from->dev_bytenr,
l->block_ref_from->mirror_num); l->block_ref_from->mirror_num);
} }
@ -1942,12 +1907,9 @@ again:
" found in hash table, %c," " found in hash table, %c,"
" bytenr mismatch" " bytenr mismatch"
" (!= stored %llu).\n", " (!= stored %llu).\n",
(unsigned long long)bytenr, bytenr, dev_state->name, dev_bytenr,
dev_state->name,
(unsigned long long)dev_bytenr,
block->mirror_num, block->mirror_num,
btrfsic_get_block_type(state, block), btrfsic_get_block_type(state, block),
(unsigned long long)
block->logical_bytenr); block->logical_bytenr);
block->logical_bytenr = bytenr; block->logical_bytenr = bytenr;
} else if (state->print_mask & } else if (state->print_mask &
@ -1955,9 +1917,7 @@ again:
printk(KERN_INFO printk(KERN_INFO
"Written block @%llu (%s/%llu/%d)" "Written block @%llu (%s/%llu/%d)"
" found in hash table, %c.\n", " found in hash table, %c.\n",
(unsigned long long)bytenr, bytenr, dev_state->name, dev_bytenr,
dev_state->name,
(unsigned long long)dev_bytenr,
block->mirror_num, block->mirror_num,
btrfsic_get_block_type(state, block)); btrfsic_get_block_type(state, block));
} else { } else {
@ -1973,9 +1933,7 @@ again:
printk(KERN_INFO printk(KERN_INFO
"Written block @%llu (%s/%llu/%d)" "Written block @%llu (%s/%llu/%d)"
" found in hash table, %c.\n", " found in hash table, %c.\n",
(unsigned long long)bytenr, bytenr, dev_state->name, dev_bytenr,
dev_state->name,
(unsigned long long)dev_bytenr,
block->mirror_num, block->mirror_num,
btrfsic_get_block_type(state, block)); btrfsic_get_block_type(state, block));
} }
@ -1992,21 +1950,14 @@ again:
" new(gen=%llu)," " new(gen=%llu),"
" which is referenced by most recent superblock" " which is referenced by most recent superblock"
" (superblockgen=%llu)!\n", " (superblockgen=%llu)!\n",
btrfsic_get_block_type(state, block), btrfsic_get_block_type(state, block), bytenr,
(unsigned long long)bytenr, dev_state->name, dev_bytenr, block->mirror_num,
dev_state->name, block->generation,
(unsigned long long)dev_bytenr,
block->mirror_num,
(unsigned long long)block->generation,
(unsigned long long)
btrfs_disk_key_objectid(&block->disk_key), btrfs_disk_key_objectid(&block->disk_key),
block->disk_key.type, block->disk_key.type,
(unsigned long long)
btrfs_disk_key_offset(&block->disk_key), btrfs_disk_key_offset(&block->disk_key),
(unsigned long long)
btrfs_stack_header_generation( btrfs_stack_header_generation(
(struct btrfs_header *) mapped_datav[0]), (struct btrfs_header *) mapped_datav[0]),
(unsigned long long)
state->max_superblock_generation); state->max_superblock_generation);
btrfsic_dump_tree(state); btrfsic_dump_tree(state);
} }
@ -2015,13 +1966,9 @@ again:
printk(KERN_INFO "btrfs: attempt to overwrite %c-block" printk(KERN_INFO "btrfs: attempt to overwrite %c-block"
" @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu," " @%llu (%s/%llu/%d), oldgen=%llu, newgen=%llu,"
" which is not yet iodone!\n", " which is not yet iodone!\n",
btrfsic_get_block_type(state, block), btrfsic_get_block_type(state, block), bytenr,
(unsigned long long)bytenr, dev_state->name, dev_bytenr, block->mirror_num,
dev_state->name, block->generation,
(unsigned long long)dev_bytenr,
block->mirror_num,
(unsigned long long)block->generation,
(unsigned long long)
btrfs_stack_header_generation( btrfs_stack_header_generation(
(struct btrfs_header *) (struct btrfs_header *)
mapped_datav[0])); mapped_datav[0]));
@ -2064,7 +2011,7 @@ again:
if (ret) { if (ret) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: btrfsic_map_block(root @%llu)" "btrfsic: btrfsic_map_block(root @%llu)"
" failed!\n", (unsigned long long)bytenr); " failed!\n", bytenr);
goto continue_loop; goto continue_loop;
} }
block_ctx.datav = mapped_datav; block_ctx.datav = mapped_datav;
@ -2148,7 +2095,7 @@ again:
printk(KERN_INFO printk(KERN_INFO
"btrfsic: btrfsic_process_metablock" "btrfsic: btrfsic_process_metablock"
"(root @%llu) failed!\n", "(root @%llu) failed!\n",
(unsigned long long)dev_bytenr); dev_bytenr);
} else { } else {
block->is_metadata = 0; block->is_metadata = 0;
block->mirror_num = 0; /* unknown */ block->mirror_num = 0; /* unknown */
@ -2176,8 +2123,7 @@ again:
if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
printk(KERN_INFO "Written block (%s/%llu/?)" printk(KERN_INFO "Written block (%s/%llu/?)"
" !found in hash table, D.\n", " !found in hash table, D.\n",
dev_state->name, dev_state->name, dev_bytenr);
(unsigned long long)dev_bytenr);
if (!state->include_extent_data) { if (!state->include_extent_data) {
/* ignore that written D block */ /* ignore that written D block */
goto continue_loop; goto continue_loop;
@ -2201,9 +2147,7 @@ again:
printk(KERN_INFO printk(KERN_INFO
"Written block @%llu (%s/%llu/?)" "Written block @%llu (%s/%llu/?)"
" !found in hash table, M.\n", " !found in hash table, M.\n",
(unsigned long long)bytenr, bytenr, dev_state->name, dev_bytenr);
dev_state->name,
(unsigned long long)dev_bytenr);
ret = btrfsic_map_block(state, bytenr, processed_len, ret = btrfsic_map_block(state, bytenr, processed_len,
&block_ctx, 0); &block_ctx, 0);
@ -2211,7 +2155,7 @@ again:
printk(KERN_INFO printk(KERN_INFO
"btrfsic: btrfsic_map_block(root @%llu)" "btrfsic: btrfsic_map_block(root @%llu)"
" failed!\n", " failed!\n",
(unsigned long long)dev_bytenr); dev_bytenr);
goto continue_loop; goto continue_loop;
} }
} }
@ -2276,10 +2220,8 @@ again:
printk(KERN_INFO printk(KERN_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',
(unsigned long long)block->logical_bytenr, block->logical_bytenr, block->dev_state->name,
block->dev_state->name, block->dev_bytenr, block->mirror_num);
(unsigned long long)block->dev_bytenr,
block->mirror_num);
list_add(&block->all_blocks_node, &state->all_blocks_list); list_add(&block->all_blocks_node, &state->all_blocks_list);
btrfsic_block_hashtable_add(block, &state->block_hashtable); btrfsic_block_hashtable_add(block, &state->block_hashtable);
@ -2290,7 +2232,7 @@ again:
printk(KERN_INFO printk(KERN_INFO
"btrfsic: process_metablock(root @%llu)" "btrfsic: process_metablock(root @%llu)"
" failed!\n", " failed!\n",
(unsigned long long)dev_bytenr); dev_bytenr);
} }
btrfsic_release_block_ctx(&block_ctx); btrfsic_release_block_ctx(&block_ctx);
} }
@ -2328,10 +2270,8 @@ static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status)
"bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n", "bio_end_io(err=%d) for %c @%llu (%s/%llu/%d)\n",
bio_error_status, bio_error_status,
btrfsic_get_block_type(dev_state->state, block), btrfsic_get_block_type(dev_state->state, block),
(unsigned long long)block->logical_bytenr, block->logical_bytenr, dev_state->name,
dev_state->name, block->dev_bytenr, block->mirror_num);
(unsigned long long)block->dev_bytenr,
block->mirror_num);
next_block = block->next_in_same_bio; next_block = block->next_in_same_bio;
block->iodone_w_error = iodone_w_error; block->iodone_w_error = iodone_w_error;
if (block->submit_bio_bh_rw & REQ_FLUSH) { if (block->submit_bio_bh_rw & REQ_FLUSH) {
@ -2341,7 +2281,6 @@ static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status)
printk(KERN_INFO printk(KERN_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,
(unsigned long long)
dev_state->last_flush_gen); dev_state->last_flush_gen);
} }
if (block->submit_bio_bh_rw & REQ_FUA) if (block->submit_bio_bh_rw & REQ_FUA)
@ -2367,10 +2306,8 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
"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),
(unsigned long long)block->logical_bytenr, block->logical_bytenr, block->dev_state->name,
block->dev_state->name, block->dev_bytenr, block->mirror_num);
(unsigned long long)block->dev_bytenr,
block->mirror_num);
block->iodone_w_error = iodone_w_error; block->iodone_w_error = iodone_w_error;
if (block->submit_bio_bh_rw & REQ_FLUSH) { if (block->submit_bio_bh_rw & REQ_FLUSH) {
@ -2379,8 +2316,7 @@ static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
BTRFSIC_PRINT_MASK_END_IO_BIO_BH)) BTRFSIC_PRINT_MASK_END_IO_BIO_BH))
printk(KERN_INFO printk(KERN_INFO
"bh_end_io() new %s flush_gen=%llu\n", "bh_end_io() new %s flush_gen=%llu\n",
dev_state->name, dev_state->name, dev_state->last_flush_gen);
(unsigned long long)dev_state->last_flush_gen);
} }
if (block->submit_bio_bh_rw & REQ_FUA) if (block->submit_bio_bh_rw & REQ_FUA)
block->flush_gen = 0; /* FUA completed means block is on disk */ block->flush_gen = 0; /* FUA completed means block is on disk */
@ -2405,26 +2341,20 @@ static int btrfsic_process_written_superblock(
printk(KERN_INFO printk(KERN_INFO
"btrfsic: superblock @%llu (%s/%llu/%d)" "btrfsic: superblock @%llu (%s/%llu/%d)"
" with old gen %llu <= %llu\n", " with old gen %llu <= %llu\n",
(unsigned long long)superblock->logical_bytenr, superblock->logical_bytenr,
superblock->dev_state->name, superblock->dev_state->name,
(unsigned long long)superblock->dev_bytenr, superblock->dev_bytenr, superblock->mirror_num,
superblock->mirror_num,
(unsigned long long)
btrfs_super_generation(super_hdr), btrfs_super_generation(super_hdr),
(unsigned long long)
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 printk(KERN_INFO
"btrfsic: got new superblock @%llu (%s/%llu/%d)" "btrfsic: got new superblock @%llu (%s/%llu/%d)"
" with new gen %llu > %llu\n", " with new gen %llu > %llu\n",
(unsigned long long)superblock->logical_bytenr, superblock->logical_bytenr,
superblock->dev_state->name, superblock->dev_state->name,
(unsigned long long)superblock->dev_bytenr, superblock->dev_bytenr, superblock->mirror_num,
superblock->mirror_num,
(unsigned long long)
btrfs_super_generation(super_hdr), btrfs_super_generation(super_hdr),
(unsigned long long)
state->max_superblock_generation); state->max_superblock_generation);
state->max_superblock_generation = state->max_superblock_generation =
@ -2455,8 +2385,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", printk(KERN_INFO "root@%llu\n", next_bytenr);
(unsigned long long)next_bytenr);
break; break;
case 1: case 1:
btrfs_set_disk_key_objectid(&tmp_disk_key, btrfs_set_disk_key_objectid(&tmp_disk_key,
@ -2465,8 +2394,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", printk(KERN_INFO "chunk@%llu\n", next_bytenr);
(unsigned long long)next_bytenr);
break; break;
case 2: case 2:
btrfs_set_disk_key_objectid(&tmp_disk_key, btrfs_set_disk_key_objectid(&tmp_disk_key,
@ -2477,8 +2405,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", printk(KERN_INFO "log@%llu\n", next_bytenr);
(unsigned long long)next_bytenr);
break; break;
} }
@ -2487,7 +2414,7 @@ static int btrfsic_process_written_superblock(
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", printk(KERN_INFO "num_copies(log_bytenr=%llu) = %d\n",
(unsigned long long)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;
@ -2503,8 +2430,7 @@ static int btrfsic_process_written_superblock(
printk(KERN_INFO printk(KERN_INFO
"btrfsic: btrfsic_map_block(@%llu," "btrfsic: btrfsic_map_block(@%llu,"
" mirror=%d) failed!\n", " mirror=%d) failed!\n",
(unsigned long long)next_bytenr, next_bytenr, mirror_num);
mirror_num);
return -1; return -1;
} }
@ -2589,26 +2515,22 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
" %u* refers to %c @%llu (%s/%llu/%d)\n", " %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),
(unsigned long long)block->logical_bytenr, block->logical_bytenr, block->dev_state->name,
block->dev_state->name, block->dev_bytenr, block->mirror_num,
(unsigned long long)block->dev_bytenr,
block->mirror_num,
l->ref_cnt, l->ref_cnt,
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)
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,
(unsigned long long)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" printk(KERN_INFO "btrfs: attempt to write superblock"
" which references block %c @%llu (%s/%llu/%d)" " which references block %c @%llu (%s/%llu/%d)"
" which is never written!\n", " which is never written!\n",
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)
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,
(unsigned long long)l->block_ref_to->dev_bytenr, l->block_ref_to->dev_bytenr,
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) {
@ -2616,10 +2538,9 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
" which references block %c @%llu (%s/%llu/%d)" " which references block %c @%llu (%s/%llu/%d)"
" which is not yet iodone!\n", " which is not yet iodone!\n",
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)
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,
(unsigned long long)l->block_ref_to->dev_bytenr, l->block_ref_to->dev_bytenr,
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) {
@ -2627,10 +2548,9 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
" which references block %c @%llu (%s/%llu/%d)" " which references block %c @%llu (%s/%llu/%d)"
" which has write error!\n", " which has write error!\n",
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)
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,
(unsigned long long)l->block_ref_to->dev_bytenr, l->block_ref_to->dev_bytenr,
l->block_ref_to->mirror_num); l->block_ref_to->mirror_num);
ret = -1; ret = -1;
} else if (l->parent_generation != } else if (l->parent_generation !=
@ -2644,13 +2564,12 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
" with generation %llu !=" " with generation %llu !="
" parent generation %llu!\n", " parent generation %llu!\n",
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)
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,
(unsigned long long)l->block_ref_to->dev_bytenr, l->block_ref_to->dev_bytenr,
l->block_ref_to->mirror_num, l->block_ref_to->mirror_num,
(unsigned long long)l->block_ref_to->generation, l->block_ref_to->generation,
(unsigned long long)l->parent_generation); l->parent_generation);
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) {
@ -2660,13 +2579,10 @@ static int btrfsic_check_all_ref_blocks(struct btrfsic_state *state,
" (block flush_gen=%llu," " (block flush_gen=%llu,"
" dev->flush_gen=%llu)!\n", " dev->flush_gen=%llu)!\n",
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)
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,
(unsigned long long)l->block_ref_to->dev_bytenr, l->block_ref_to->dev_bytenr,
l->block_ref_to->mirror_num, l->block_ref_to->mirror_num, block->flush_gen,
(unsigned long long)block->flush_gen,
(unsigned long long)
l->block_ref_to->dev_state->last_flush_gen); l->block_ref_to->dev_state->last_flush_gen);
ret = -1; ret = -1;
} else if (-1 == btrfsic_check_all_ref_blocks(state, } else if (-1 == btrfsic_check_all_ref_blocks(state,
@ -2711,16 +2627,12 @@ static int btrfsic_is_block_ref_by_superblock(
" is ref %u* from %c @%llu (%s/%llu/%d)\n", " 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),
(unsigned long long)block->logical_bytenr, block->logical_bytenr, block->dev_state->name,
block->dev_state->name, block->dev_bytenr, block->mirror_num,
(unsigned long long)block->dev_bytenr,
block->mirror_num,
l->ref_cnt, l->ref_cnt,
btrfsic_get_block_type(state, l->block_ref_from), btrfsic_get_block_type(state, l->block_ref_from),
(unsigned long long)
l->block_ref_from->logical_bytenr, l->block_ref_from->logical_bytenr,
l->block_ref_from->dev_state->name, l->block_ref_from->dev_state->name,
(unsigned long long)
l->block_ref_from->dev_bytenr, l->block_ref_from->dev_bytenr,
l->block_ref_from->mirror_num); l->block_ref_from->mirror_num);
if (l->block_ref_from->is_superblock && if (l->block_ref_from->is_superblock &&
@ -2747,14 +2659,12 @@ static void btrfsic_print_add_link(const struct btrfsic_state *state,
" to %c @%llu (%s/%llu/%d).\n", " 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),
(unsigned long long)l->block_ref_from->logical_bytenr, l->block_ref_from->logical_bytenr,
l->block_ref_from->dev_state->name, l->block_ref_from->dev_state->name,
(unsigned long long)l->block_ref_from->dev_bytenr, l->block_ref_from->dev_bytenr, l->block_ref_from->mirror_num,
l->block_ref_from->mirror_num,
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)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, l->block_ref_to->dev_bytenr,
(unsigned long long)l->block_ref_to->dev_bytenr,
l->block_ref_to->mirror_num); l->block_ref_to->mirror_num);
} }
@ -2766,14 +2676,12 @@ static void btrfsic_print_rem_link(const struct btrfsic_state *state,
" to %c @%llu (%s/%llu/%d).\n", " 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),
(unsigned long long)l->block_ref_from->logical_bytenr, l->block_ref_from->logical_bytenr,
l->block_ref_from->dev_state->name, l->block_ref_from->dev_state->name,
(unsigned long long)l->block_ref_from->dev_bytenr, l->block_ref_from->dev_bytenr, l->block_ref_from->mirror_num,
l->block_ref_from->mirror_num,
btrfsic_get_block_type(state, l->block_ref_to), btrfsic_get_block_type(state, l->block_ref_to),
(unsigned long long)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, l->block_ref_to->dev_bytenr,
(unsigned long long)l->block_ref_to->dev_bytenr,
l->block_ref_to->mirror_num); l->block_ref_to->mirror_num);
} }
@ -2817,10 +2725,8 @@ static void btrfsic_dump_tree_sub(const struct btrfsic_state *state,
*/ */
indent_add = sprintf(buf, "%c-%llu(%s/%llu/%d)", indent_add = sprintf(buf, "%c-%llu(%s/%llu/%d)",
btrfsic_get_block_type(state, block), btrfsic_get_block_type(state, block),
(unsigned long long)block->logical_bytenr, block->logical_bytenr, block->dev_state->name,
block->dev_state->name, block->dev_bytenr, block->mirror_num);
(unsigned long long)block->dev_bytenr,
block->mirror_num);
if (indent_level + indent_add > BTRFSIC_TREE_DUMP_MAX_INDENT_LEVEL) { if (indent_level + indent_add > BTRFSIC_TREE_DUMP_MAX_INDENT_LEVEL) {
printk("[...]\n"); printk("[...]\n");
return; return;
@ -2953,10 +2859,8 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
"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),
(unsigned long long)block->logical_bytenr, block->logical_bytenr, dev_state->name,
dev_state->name, block->dev_bytenr, mirror_num);
(unsigned long long)block->dev_bytenr,
mirror_num);
list_add(&block->all_blocks_node, &state->all_blocks_list); list_add(&block->all_blocks_node, &state->all_blocks_list);
btrfsic_block_hashtable_add(block, &state->block_hashtable); btrfsic_block_hashtable_add(block, &state->block_hashtable);
if (NULL != was_created) if (NULL != was_created)
@ -2990,7 +2894,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
printk(KERN_INFO "btrfsic:" printk(KERN_INFO "btrfsic:"
" btrfsic_map_block(logical @%llu," " btrfsic_map_block(logical @%llu,"
" mirror %d) failed!\n", " mirror %d) failed!\n",
(unsigned long long)bytenr, mirror_num); bytenr, mirror_num);
continue; continue;
} }
@ -3007,8 +2911,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
printk(KERN_INFO "btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio," 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," " buffer->log_bytenr=%llu, submit_bio(bdev=%s,"
" phys_bytenr=%llu)!\n", " phys_bytenr=%llu)!\n",
(unsigned long long)bytenr, dev_state->name, bytenr, dev_state->name, dev_bytenr);
(unsigned long long)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,
state->metablock_size, state->metablock_size,
@ -3018,10 +2921,8 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
printk(KERN_INFO "Read logical bytenr @%llu maps to" printk(KERN_INFO "Read logical bytenr @%llu maps to"
" (%s/%llu/%d)\n", " (%s/%llu/%d)\n",
(unsigned long long)bytenr, bytenr, block_ctx.dev->name,
block_ctx.dev->name, block_ctx.dev_bytenr, mirror_num);
(unsigned long long)block_ctx.dev_bytenr,
mirror_num);
} }
WARN_ON(1); WARN_ON(1);
} }
@ -3060,8 +2961,7 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh)
printk(KERN_INFO printk(KERN_INFO
"submit_bh(rw=0x%x, blocknr=%lu (bytenr %llu)," "submit_bh(rw=0x%x, blocknr=%lu (bytenr %llu),"
" size=%lu, data=%p, bdev=%p)\n", " size=%lu, data=%p, bdev=%p)\n",
rw, (unsigned long)bh->b_blocknr, rw, (unsigned long)bh->b_blocknr, dev_bytenr,
(unsigned long long)dev_bytenr,
(unsigned long)bh->b_size, bh->b_data, (unsigned long)bh->b_size, bh->b_data,
bh->b_bdev); bh->b_bdev);
btrfsic_process_written_block(dev_state, dev_bytenr, btrfsic_process_written_block(dev_state, dev_bytenr,
@ -3130,8 +3030,7 @@ void btrfsic_submit_bio(int rw, struct bio *bio)
"submit_bio(rw=0x%x, bi_vcnt=%u," "submit_bio(rw=0x%x, bi_vcnt=%u,"
" bi_sector=%lu (bytenr %llu), bi_bdev=%p)\n", " bi_sector=%lu (bytenr %llu), bi_bdev=%p)\n",
rw, bio->bi_vcnt, (unsigned long)bio->bi_sector, rw, bio->bi_vcnt, (unsigned long)bio->bi_sector,
(unsigned long long)dev_bytenr, dev_bytenr, bio->bi_bdev);
bio->bi_bdev);
mapped_datav = kmalloc(sizeof(*mapped_datav) * bio->bi_vcnt, mapped_datav = kmalloc(sizeof(*mapped_datav) * bio->bi_vcnt,
GFP_NOFS); GFP_NOFS);
@ -3379,10 +3278,8 @@ void btrfsic_unmount(struct btrfs_root *root,
" @%llu (%s/%llu/%d) on umount which is" " @%llu (%s/%llu/%d) on umount which is"
" not yet iodone!\n", " not yet iodone!\n",
btrfsic_get_block_type(state, b_all), btrfsic_get_block_type(state, b_all),
(unsigned long long)b_all->logical_bytenr, b_all->logical_bytenr, b_all->dev_state->name,
b_all->dev_state->name, b_all->dev_bytenr, b_all->mirror_num);
(unsigned long long)b_all->dev_bytenr,
b_all->mirror_num);
} }
mutex_unlock(&btrfsic_mutex); mutex_unlock(&btrfsic_mutex);

View File

@ -132,9 +132,8 @@ static int check_compressed_csum(struct inode *inode,
printk(KERN_INFO "btrfs csum failed ino %llu " printk(KERN_INFO "btrfs csum failed ino %llu "
"extent %llu csum %u " "extent %llu csum %u "
"wanted %u mirror %d\n", "wanted %u mirror %d\n",
(unsigned long long)btrfs_ino(inode), btrfs_ino(inode), disk_start, csum, *cb_sum,
(unsigned long long)disk_start, cb->mirror_num);
csum, *cb_sum, cb->mirror_num);
ret = -EIO; ret = -EIO;
goto fail; goto fail;
} }

View File

@ -1383,14 +1383,12 @@ noinline int btrfs_cow_block(struct btrfs_trans_handle *trans,
if (trans->transaction != root->fs_info->running_transaction) if (trans->transaction != root->fs_info->running_transaction)
WARN(1, KERN_CRIT "trans %llu running %llu\n", WARN(1, KERN_CRIT "trans %llu running %llu\n",
(unsigned long long)trans->transid, trans->transid,
(unsigned long long)
root->fs_info->running_transaction->transid); root->fs_info->running_transaction->transid);
if (trans->transid != root->fs_info->generation) if (trans->transid != root->fs_info->generation)
WARN(1, KERN_CRIT "trans %llu running %llu\n", WARN(1, KERN_CRIT "trans %llu running %llu\n",
(unsigned long long)trans->transid, trans->transid, root->fs_info->generation);
(unsigned long long)root->fs_info->generation);
if (!should_cow_block(trans, root, buf)) { if (!should_cow_block(trans, root, buf)) {
*cow_ret = buf; *cow_ret = buf;

View File

@ -1474,10 +1474,8 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
printk(KERN_ERR "err add delayed dir index item(name: %s) into " printk(KERN_ERR "err add delayed dir index item(name: %s) into "
"the insertion tree of the delayed node" "the insertion tree of the delayed node"
"(root id: %llu, inode id: %llu, errno: %d)\n", "(root id: %llu, inode id: %llu, errno: %d)\n",
name, name, delayed_node->root->objectid,
(unsigned long long)delayed_node->root->objectid, delayed_node->inode_id, ret);
(unsigned long long)delayed_node->inode_id,
ret);
BUG(); BUG();
} }
mutex_unlock(&delayed_node->mutex); mutex_unlock(&delayed_node->mutex);
@ -1548,9 +1546,7 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
printk(KERN_ERR "err add delayed dir index item(index: %llu) " printk(KERN_ERR "err add delayed dir index item(index: %llu) "
"into the deletion tree of the delayed node" "into the deletion tree of the delayed node"
"(root id: %llu, inode id: %llu, errno: %d)\n", "(root id: %llu, inode id: %llu, errno: %d)\n",
(unsigned long long)index, index, node->root->objectid, node->inode_id,
(unsigned long long)node->root->objectid,
(unsigned long long)node->inode_id,
ret); ret);
BUG(); BUG();
} }

View File

@ -148,7 +148,7 @@ no_valid_dev_replace_entry_found:
!btrfs_test_opt(dev_root, DEGRADED)) { !btrfs_test_opt(dev_root, DEGRADED)) {
ret = -EIO; ret = -EIO;
pr_warn("btrfs: cannot mount because device replace operation is ongoing and\n" "srcdev (devid %llu) is missing, need to run 'btrfs dev scan'?\n", pr_warn("btrfs: cannot mount because device replace operation is ongoing and\n" "srcdev (devid %llu) is missing, need to run 'btrfs dev scan'?\n",
(unsigned long long)src_devid); src_devid);
} }
if (!dev_replace->tgtdev && if (!dev_replace->tgtdev &&
!btrfs_test_opt(dev_root, DEGRADED)) { !btrfs_test_opt(dev_root, DEGRADED)) {

View File

@ -303,9 +303,8 @@ static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
printk_ratelimited(KERN_INFO "btrfs: %s checksum verify " printk_ratelimited(KERN_INFO "btrfs: %s checksum verify "
"failed on %llu wanted %X found %X " "failed on %llu wanted %X found %X "
"level %d\n", "level %d\n",
root->fs_info->sb->s_id, root->fs_info->sb->s_id, buf->start,
(unsigned long long)buf->start, val, found, val, found, btrfs_header_level(buf));
btrfs_header_level(buf));
if (result != (char *)&inline_result) if (result != (char *)&inline_result)
kfree(result); kfree(result);
return 1; return 1;
@ -346,9 +345,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
} }
printk_ratelimited("parent transid verify failed on %llu wanted %llu " printk_ratelimited("parent transid verify failed on %llu wanted %llu "
"found %llu\n", "found %llu\n",
(unsigned long long)eb->start, eb->start, parent_transid, btrfs_header_generation(eb));
(unsigned long long)parent_transid,
(unsigned long long)btrfs_header_generation(eb));
ret = 1; ret = 1;
clear_extent_buffer_uptodate(eb); clear_extent_buffer_uptodate(eb);
out: out:
@ -513,8 +510,7 @@ static int check_tree_block_fsid(struct btrfs_root *root,
#define CORRUPT(reason, eb, root, slot) \ #define CORRUPT(reason, eb, root, slot) \
printk(KERN_CRIT "btrfs: corrupt leaf, %s: block=%llu," \ printk(KERN_CRIT "btrfs: corrupt leaf, %s: block=%llu," \
"root=%llu, slot=%d\n", reason, \ "root=%llu, slot=%d\n", reason, \
(unsigned long long)btrfs_header_bytenr(eb), \ btrfs_header_bytenr(eb), root->objectid, slot)
(unsigned long long)root->objectid, slot)
static noinline int check_leaf(struct btrfs_root *root, static noinline int check_leaf(struct btrfs_root *root,
struct extent_buffer *leaf) struct extent_buffer *leaf)
@ -614,14 +610,13 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
if (found_start != eb->start) { if (found_start != eb->start) {
printk_ratelimited(KERN_INFO "btrfs bad tree block start " printk_ratelimited(KERN_INFO "btrfs bad tree block start "
"%llu %llu\n", "%llu %llu\n",
(unsigned long long)found_start, found_start, eb->start);
(unsigned long long)eb->start);
ret = -EIO; ret = -EIO;
goto err; goto err;
} }
if (check_tree_block_fsid(root, eb)) { if (check_tree_block_fsid(root, eb)) {
printk_ratelimited(KERN_INFO "btrfs bad fsid on block %llu\n", printk_ratelimited(KERN_INFO "btrfs bad fsid on block %llu\n",
(unsigned long long)eb->start); eb->start);
ret = -EIO; ret = -EIO;
goto err; goto err;
} }
@ -2405,7 +2400,7 @@ int open_ctree(struct super_block *sb,
if (features) { if (features) {
printk(KERN_ERR "BTRFS: couldn't mount because of " printk(KERN_ERR "BTRFS: couldn't mount because of "
"unsupported optional features (%Lx).\n", "unsupported optional features (%Lx).\n",
(unsigned long long)features); features);
err = -EINVAL; err = -EINVAL;
goto fail_alloc; goto fail_alloc;
} }
@ -2475,7 +2470,7 @@ int open_ctree(struct super_block *sb,
if (!(sb->s_flags & MS_RDONLY) && features) { if (!(sb->s_flags & MS_RDONLY) && features) {
printk(KERN_ERR "BTRFS: couldn't mount RDWR because of " printk(KERN_ERR "BTRFS: couldn't mount RDWR because of "
"unsupported option features (%Lx).\n", "unsupported option features (%Lx).\n",
(unsigned long long)features); features);
err = -EINVAL; err = -EINVAL;
goto fail_alloc; goto fail_alloc;
} }
@ -3681,9 +3676,7 @@ void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
if (transid != root->fs_info->generation) if (transid != root->fs_info->generation)
WARN(1, KERN_CRIT "btrfs transid mismatch buffer %llu, " WARN(1, KERN_CRIT "btrfs transid mismatch buffer %llu, "
"found %llu running %llu\n", "found %llu running %llu\n",
(unsigned long long)buf->start, buf->start, transid, root->fs_info->generation);
(unsigned long long)transid,
(unsigned long long)root->fs_info->generation);
was_dirty = set_extent_buffer_dirty(buf); was_dirty = set_extent_buffer_dirty(buf);
if (!was_dirty) if (!was_dirty)
__percpu_counter_add(&root->fs_info->dirty_metadata_bytes, __percpu_counter_add(&root->fs_info->dirty_metadata_bytes,

View File

@ -5718,7 +5718,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
if (ret) { if (ret) {
btrfs_err(info, "umm, got %d back from search, was looking for %llu", btrfs_err(info, "umm, got %d back from search, was looking for %llu",
ret, (unsigned long long)bytenr); ret, bytenr);
if (ret > 0) if (ret > 0)
btrfs_print_leaf(extent_root, btrfs_print_leaf(extent_root,
path->nodes[0]); path->nodes[0]);
@ -5734,11 +5734,8 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
WARN_ON(1); WARN_ON(1);
btrfs_err(info, btrfs_err(info,
"unable to find ref byte nr %llu parent %llu root %llu owner %llu offset %llu", "unable to find ref byte nr %llu parent %llu root %llu owner %llu offset %llu",
(unsigned long long)bytenr, bytenr, parent, root_objectid, owner_objectid,
(unsigned long long)parent, owner_offset);
(unsigned long long)root_objectid,
(unsigned long long)owner_objectid,
(unsigned long long)owner_offset);
} else { } else {
btrfs_abort_transaction(trans, extent_root, ret); btrfs_abort_transaction(trans, extent_root, ret);
goto out; goto out;
@ -5767,7 +5764,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
-1, 1); -1, 1);
if (ret) { if (ret) {
btrfs_err(info, "umm, got %d back from search, was looking for %llu", btrfs_err(info, "umm, got %d back from search, was looking for %llu",
ret, (unsigned long long)bytenr); ret, bytenr);
btrfs_print_leaf(extent_root, path->nodes[0]); btrfs_print_leaf(extent_root, path->nodes[0]);
} }
if (ret < 0) { if (ret < 0) {
@ -6529,19 +6526,15 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
spin_lock(&info->lock); spin_lock(&info->lock);
printk(KERN_INFO "space_info %llu has %llu free, is %sfull\n", printk(KERN_INFO "space_info %llu has %llu free, is %sfull\n",
(unsigned long long)info->flags, info->flags,
(unsigned long long)(info->total_bytes - info->bytes_used - info->total_bytes - info->bytes_used - info->bytes_pinned -
info->bytes_pinned - info->bytes_reserved - info->bytes_reserved - info->bytes_readonly,
info->bytes_readonly),
(info->full) ? "" : "not "); (info->full) ? "" : "not ");
printk(KERN_INFO "space_info total=%llu, used=%llu, pinned=%llu, " printk(KERN_INFO "space_info total=%llu, used=%llu, pinned=%llu, "
"reserved=%llu, may_use=%llu, readonly=%llu\n", "reserved=%llu, may_use=%llu, readonly=%llu\n",
(unsigned long long)info->total_bytes, info->total_bytes, info->bytes_used, info->bytes_pinned,
(unsigned long long)info->bytes_used, info->bytes_reserved, info->bytes_may_use,
(unsigned long long)info->bytes_pinned, info->bytes_readonly);
(unsigned long long)info->bytes_reserved,
(unsigned long long)info->bytes_may_use,
(unsigned long long)info->bytes_readonly);
spin_unlock(&info->lock); spin_unlock(&info->lock);
if (!dump_block_groups) if (!dump_block_groups)
@ -6552,12 +6545,9 @@ 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 "block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n", printk(KERN_INFO "block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n",
(unsigned long long)cache->key.objectid, cache->key.objectid, cache->key.offset,
(unsigned long long)cache->key.offset, btrfs_block_group_used(&cache->item), cache->pinned,
(unsigned long long)btrfs_block_group_used(&cache->item), cache->reserved, cache->ro ? "[readonly]" : "");
(unsigned long long)cache->pinned,
(unsigned long long)cache->reserved,
cache->ro ? "[readonly]" : "");
btrfs_dump_free_space(cache, bytes); btrfs_dump_free_space(cache, bytes);
spin_unlock(&cache->lock); spin_unlock(&cache->lock);
} }
@ -6594,8 +6584,7 @@ again:
sinfo = __find_space_info(root->fs_info, flags); sinfo = __find_space_info(root->fs_info, flags);
btrfs_err(root->fs_info, "allocation failed flags %llu, wanted %llu", btrfs_err(root->fs_info, "allocation failed flags %llu, wanted %llu",
(unsigned long long)flags, flags, num_bytes);
(unsigned long long)num_bytes);
if (sinfo) if (sinfo)
dump_space_info(sinfo, num_bytes, 1); dump_space_info(sinfo, num_bytes, 1);
} }
@ -6615,7 +6604,7 @@ static int __btrfs_free_reserved_extent(struct btrfs_root *root,
cache = btrfs_lookup_block_group(root->fs_info, start); cache = btrfs_lookup_block_group(root->fs_info, start);
if (!cache) { if (!cache) {
btrfs_err(root->fs_info, "Unable to find block group for %llu", btrfs_err(root->fs_info, "Unable to find block group for %llu",
(unsigned long long)start); start);
return -ENOSPC; return -ENOSPC;
} }
@ -6711,8 +6700,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
ret = update_block_group(root, ins->objectid, ins->offset, 1); ret = update_block_group(root, ins->objectid, ins->offset, 1);
if (ret) { /* -ENOENT, logic error */ if (ret) { /* -ENOENT, logic error */
btrfs_err(fs_info, "update block group failed for %llu %llu", btrfs_err(fs_info, "update block group failed for %llu %llu",
(unsigned long long)ins->objectid, ins->objectid, ins->offset);
(unsigned long long)ins->offset);
BUG(); BUG();
} }
return ret; return ret;
@ -6784,8 +6772,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
ret = update_block_group(root, ins->objectid, root->leafsize, 1); ret = update_block_group(root, ins->objectid, root->leafsize, 1);
if (ret) { /* -ENOENT, logic error */ if (ret) { /* -ENOENT, logic error */
btrfs_err(fs_info, "update block group failed for %llu %llu", btrfs_err(fs_info, "update block group failed for %llu %llu",
(unsigned long long)ins->objectid, ins->objectid, ins->offset);
(unsigned long long)ins->offset);
BUG(); BUG();
} }
return ret; return ret;

View File

@ -61,9 +61,8 @@ void btrfs_leak_debug_check(void)
state = list_entry(states.next, struct extent_state, leak_list); state = list_entry(states.next, struct extent_state, leak_list);
printk(KERN_ERR "btrfs state leak: start %llu end %llu " printk(KERN_ERR "btrfs state leak: start %llu end %llu "
"state %lu in tree %p refs %d\n", "state %lu in tree %p refs %d\n",
(unsigned long long)state->start, state->start, state->end, state->state, state->tree,
(unsigned long long)state->end, atomic_read(&state->refs));
state->state, state->tree, atomic_read(&state->refs));
list_del(&state->leak_list); list_del(&state->leak_list);
kmem_cache_free(extent_state_cache, state); kmem_cache_free(extent_state_cache, state);
} }
@ -71,8 +70,8 @@ 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 " printk(KERN_ERR "btrfs buffer leak start %llu len %lu "
"refs %d\n", (unsigned long long)eb->start, "refs %d\n",
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);
} }
@ -88,11 +87,7 @@ static inline void __btrfs_debug_check_extent_io_range(const char *caller,
if (end >= PAGE_SIZE && (end % 2) == 0 && end != isize - 1) { if (end >= PAGE_SIZE && (end % 2) == 0 && end != isize - 1) {
printk_ratelimited(KERN_DEBUG printk_ratelimited(KERN_DEBUG
"btrfs: %s: ino %llu isize %llu odd range [%llu,%llu]\n", "btrfs: %s: ino %llu isize %llu odd range [%llu,%llu]\n",
caller, caller, btrfs_ino(inode), isize, start, end);
(unsigned long long)btrfs_ino(inode),
(unsigned long long)isize,
(unsigned long long)start,
(unsigned long long)end);
} }
} }
#else #else
@ -388,8 +383,7 @@ static int insert_state(struct extent_io_tree *tree,
if (end < start) if (end < start)
WARN(1, KERN_ERR "btrfs end < start %llu %llu\n", WARN(1, KERN_ERR "btrfs end < start %llu %llu\n",
(unsigned long long)end, end, start);
(unsigned long long)start);
state->start = start; state->start = start;
state->end = end; state->end = end;
@ -400,9 +394,8 @@ static int insert_state(struct extent_io_tree *tree,
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 " printk(KERN_ERR "btrfs found node %llu %llu on insert of "
"%llu %llu\n", (unsigned long long)found->start, "%llu %llu\n",
(unsigned long long)found->end, found->start, found->end, start, end);
(unsigned long long)start, (unsigned long long)end);
return -EEXIST; return -EEXIST;
} }
state->tree = tree; state->tree = tree;
@ -3298,8 +3291,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
if (!PageWriteback(page)) { if (!PageWriteback(page)) {
printk(KERN_ERR "btrfs warning page %lu not " printk(KERN_ERR "btrfs warning page %lu not "
"writeback, cur %llu end %llu\n", "writeback, cur %llu end %llu\n",
page->index, (unsigned long long)cur, page->index, cur, end);
(unsigned long long)end);
} }
ret = submit_extent_page(write_flags, tree, page, ret = submit_extent_page(write_flags, tree, page,
@ -4923,8 +4915,8 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
if (start + min_len > eb->len) { if (start + min_len > eb->len) {
WARN(1, KERN_ERR "btrfs bad mapping eb start %llu len %lu, " WARN(1, KERN_ERR "btrfs bad mapping eb start %llu len %lu, "
"wanted %lu %lu\n", (unsigned long long)eb->start, "wanted %lu %lu\n",
eb->len, start, min_len); eb->start, eb->len, start, min_len);
return -EINVAL; return -EINVAL;
} }

View File

@ -248,9 +248,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
} else { } else {
printk(KERN_INFO "btrfs no csum found " printk(KERN_INFO "btrfs no csum found "
"for inode %llu start %llu\n", "for inode %llu start %llu\n",
(unsigned long long) btrfs_ino(inode), offset);
btrfs_ino(inode),
(unsigned long long)offset);
} }
item = NULL; item = NULL;
btrfs_release_path(path); btrfs_release_path(path);

View File

@ -673,8 +673,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
btrfs_err(root->fs_info, btrfs_err(root->fs_info,
"free space inode generation (%llu) " "free space inode generation (%llu) "
"did not match free space cache generation (%llu)", "did not match free space cache generation (%llu)",
(unsigned long long)BTRFS_I(inode)->generation, BTRFS_I(inode)->generation, generation);
(unsigned long long)generation);
return 0; return 0;
} }
@ -1991,8 +1990,7 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,
if (info->bytes >= bytes && !block_group->ro) if (info->bytes >= bytes && !block_group->ro)
count++; count++;
printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n", printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n",
(unsigned long long)info->offset, info->offset, info->bytes,
(unsigned long long)info->bytes,
(info->bitmap) ? "yes" : "no"); (info->bitmap) ? "yes" : "no");
} }
printk(KERN_INFO "block group has cluster?: %s\n", printk(KERN_INFO "block group has cluster?: %s\n",

View File

@ -2786,8 +2786,7 @@ good:
zeroit: zeroit:
if (__ratelimit(&_rs)) if (__ratelimit(&_rs))
btrfs_info(root->fs_info, "csum failed ino %llu off %llu csum %u expected csum %u", btrfs_info(root->fs_info, "csum failed ino %llu off %llu csum %u expected csum %u",
(unsigned long long)btrfs_ino(page->mapping->host), btrfs_ino(page->mapping->host), start, csum, csum_expected);
(unsigned long long)start, csum, csum_expected);
memset(kaddr + offset, 1, end - start + 1); memset(kaddr + offset, 1, end - start + 1);
flush_dcache_page(page); flush_dcache_page(page);
kunmap_atomic(kaddr); kunmap_atomic(kaddr);
@ -3572,8 +3571,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
if (ret) { if (ret) {
btrfs_info(root->fs_info, btrfs_info(root->fs_info,
"failed to delete reference to %.*s, inode %llu parent %llu", "failed to delete reference to %.*s, inode %llu parent %llu",
name_len, name, name_len, name, ino, dir_ino);
(unsigned long long)ino, (unsigned long long)dir_ino);
btrfs_abort_transaction(trans, root, ret); btrfs_abort_transaction(trans, root, ret);
goto err; goto err;
} }
@ -6081,10 +6079,7 @@ insert:
btrfs_release_path(path); btrfs_release_path(path);
if (em->start > start || extent_map_end(em) <= start) { if (em->start > start || extent_map_end(em) <= start) {
btrfs_err(root->fs_info, "bad extent! em: [%llu %llu] passed [%llu %llu]", btrfs_err(root->fs_info, "bad extent! em: [%llu %llu] passed [%llu %llu]",
(unsigned long long)em->start, em->start, em->len, start, len);
(unsigned long long)em->len,
(unsigned long long)start,
(unsigned long long)len);
err = -EIO; err = -EIO;
goto out; goto out;
} }
@ -6753,9 +6748,8 @@ static void btrfs_endio_direct_read(struct bio *bio, int err)
flush_dcache_page(bvec->bv_page); flush_dcache_page(bvec->bv_page);
if (csum != csums[index]) { if (csum != csums[index]) {
btrfs_err(root->fs_info, "csum failed ino %llu off %llu csum %u expected csum %u", btrfs_err(root->fs_info, "csum failed ino %llu off %llu csum %u expected csum %u",
(unsigned long long)btrfs_ino(inode), btrfs_ino(inode), start, csum,
(unsigned long long)start, csums[index]);
csum, csums[index]);
err = -EIO; err = -EIO;
} }
} }
@ -6843,7 +6837,7 @@ static void btrfs_end_dio_bio(struct bio *bio, int err)
if (err) { if (err) {
printk(KERN_ERR "btrfs direct IO failed ino %llu rw %lu " printk(KERN_ERR "btrfs direct IO failed ino %llu rw %lu "
"sector %#Lx len %u err no %d\n", "sector %#Lx len %u err no %d\n",
(unsigned long long)btrfs_ino(dip->inode), bio->bi_rw, btrfs_ino(dip->inode), bio->bi_rw,
(unsigned long long)bio->bi_sector, bio->bi_size, err); (unsigned long long)bio->bi_sector, bio->bi_size, err);
dip->errors = 1; dip->errors = 1;
@ -7775,7 +7769,7 @@ void btrfs_destroy_inode(struct inode *inode)
if (test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, if (test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
&BTRFS_I(inode)->runtime_flags)) { &BTRFS_I(inode)->runtime_flags)) {
btrfs_info(root->fs_info, "inode %llu still on the orphan list", btrfs_info(root->fs_info, "inode %llu still on the orphan list",
(unsigned long long)btrfs_ino(inode)); btrfs_ino(inode));
atomic_dec(&root->orphan_inodes); atomic_dec(&root->orphan_inodes);
} }
@ -7785,8 +7779,7 @@ void btrfs_destroy_inode(struct inode *inode)
break; break;
else { else {
btrfs_err(root->fs_info, "found ordered extent %llu %llu on inode cleanup", btrfs_err(root->fs_info, "found ordered extent %llu %llu on inode cleanup",
(unsigned long long)ordered->file_offset, ordered->file_offset, ordered->len);
(unsigned long long)ordered->len);
btrfs_remove_ordered_extent(inode, ordered); btrfs_remove_ordered_extent(inode, ordered);
btrfs_put_ordered_extent(ordered); btrfs_put_ordered_extent(ordered);
btrfs_put_ordered_extent(ordered); btrfs_put_ordered_extent(ordered);

View File

@ -1421,14 +1421,13 @@ static noinline int btrfs_ioctl_resize(struct file *file,
ret = -EINVAL; ret = -EINVAL;
goto out_free; goto out_free;
} }
printk(KERN_INFO "btrfs: resizing devid %llu\n", printk(KERN_INFO "btrfs: resizing devid %llu\n", devid);
(unsigned long long)devid);
} }
device = btrfs_find_device(root->fs_info, devid, NULL, NULL); device = btrfs_find_device(root->fs_info, devid, NULL, NULL);
if (!device) { if (!device) {
printk(KERN_INFO "btrfs: resizer unable to find device %llu\n", printk(KERN_INFO "btrfs: resizer unable to find device %llu\n",
(unsigned long long)devid); devid);
ret = -ENODEV; ret = -ENODEV;
goto out_free; goto out_free;
} }
@ -1436,7 +1435,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
if (!device->writeable) { if (!device->writeable) {
printk(KERN_INFO "btrfs: resizer unable to apply on " printk(KERN_INFO "btrfs: resizer unable to apply on "
"readonly device %llu\n", "readonly device %llu\n",
(unsigned long long)devid); devid);
ret = -EPERM; ret = -EPERM;
goto out_free; goto out_free;
} }
@ -1488,8 +1487,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
new_size *= root->sectorsize; new_size *= root->sectorsize;
printk_in_rcu(KERN_INFO "btrfs: new size for %s is %llu\n", printk_in_rcu(KERN_INFO "btrfs: new size for %s is %llu\n",
rcu_str_deref(device->name), rcu_str_deref(device->name), new_size);
(unsigned long long)new_size);
if (new_size > old_size) { if (new_size > old_size) {
trans = btrfs_start_transaction(root, 0); trans = btrfs_start_transaction(root, 0);

View File

@ -67,7 +67,7 @@ static void ordered_data_tree_panic(struct inode *inode, int errno,
{ {
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
btrfs_panic(fs_info, errno, "Inconsistency in ordered tree at offset " btrfs_panic(fs_info, errno, "Inconsistency in ordered tree at offset "
"%llu\n", (unsigned long long)offset); "%llu\n", offset);
} }
/* /*
@ -336,14 +336,12 @@ int btrfs_dec_test_first_ordered_pending(struct inode *inode,
*file_offset = dec_end; *file_offset = dec_end;
if (dec_start > dec_end) { if (dec_start > dec_end) {
printk(KERN_CRIT "bad ordering dec_start %llu end %llu\n", printk(KERN_CRIT "bad ordering dec_start %llu end %llu\n",
(unsigned long long)dec_start, dec_start, dec_end);
(unsigned long long)dec_end);
} }
to_dec = dec_end - dec_start; to_dec = dec_end - dec_start;
if (to_dec > entry->bytes_left) { if (to_dec > entry->bytes_left) {
printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n", printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n",
(unsigned long long)entry->bytes_left, entry->bytes_left, to_dec);
(unsigned long long)to_dec);
} }
entry->bytes_left -= to_dec; entry->bytes_left -= to_dec;
if (!uptodate) if (!uptodate)
@ -403,8 +401,7 @@ have_entry:
if (io_size > entry->bytes_left) { if (io_size > entry->bytes_left) {
printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n", printk(KERN_CRIT "bad ordered accounting left %llu size %llu\n",
(unsigned long long)entry->bytes_left, entry->bytes_left, io_size);
(unsigned long long)io_size);
} }
entry->bytes_left -= io_size; entry->bytes_left -= io_size;
if (!uptodate) if (!uptodate)

View File

@ -26,14 +26,12 @@ static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
int i; int i;
printk(KERN_INFO "\t\tchunk length %llu owner %llu type %llu " printk(KERN_INFO "\t\tchunk length %llu owner %llu type %llu "
"num_stripes %d\n", "num_stripes %d\n",
(unsigned long long)btrfs_chunk_length(eb, chunk), btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk),
(unsigned long long)btrfs_chunk_owner(eb, chunk), btrfs_chunk_type(eb, chunk), num_stripes);
(unsigned long long)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, printk(KERN_INFO "\t\t\tstripe %d devid %llu offset %llu\n", i,
(unsigned long long)btrfs_stripe_devid_nr(eb, chunk, i), btrfs_stripe_devid_nr(eb, chunk, i),
(unsigned long long)btrfs_stripe_offset_nr(eb, chunk, i)); btrfs_stripe_offset_nr(eb, chunk, i));
} }
} }
static void print_dev_item(struct extent_buffer *eb, static void print_dev_item(struct extent_buffer *eb,
@ -41,18 +39,18 @@ static void print_dev_item(struct extent_buffer *eb,
{ {
printk(KERN_INFO "\t\tdev item devid %llu " printk(KERN_INFO "\t\tdev item devid %llu "
"total_bytes %llu bytes used %llu\n", "total_bytes %llu bytes used %llu\n",
(unsigned long long)btrfs_device_id(eb, dev_item), btrfs_device_id(eb, dev_item),
(unsigned long long)btrfs_device_total_bytes(eb, dev_item), btrfs_device_total_bytes(eb, dev_item),
(unsigned long long)btrfs_device_bytes_used(eb, dev_item)); btrfs_device_bytes_used(eb, dev_item));
} }
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 " printk(KERN_INFO "\t\textent data backref root %llu "
"objectid %llu offset %llu count %u\n", "objectid %llu offset %llu count %u\n",
(unsigned long long)btrfs_extent_data_ref_root(eb, ref), btrfs_extent_data_ref_root(eb, ref),
(unsigned long long)btrfs_extent_data_ref_objectid(eb, ref), btrfs_extent_data_ref_objectid(eb, ref),
(unsigned long long)btrfs_extent_data_ref_offset(eb, ref), btrfs_extent_data_ref_offset(eb, ref),
btrfs_extent_data_ref_count(eb, ref)); btrfs_extent_data_ref_count(eb, ref));
} }
@ -87,9 +85,8 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
flags = btrfs_extent_flags(eb, ei); flags = btrfs_extent_flags(eb, ei);
printk(KERN_INFO "\t\textent refs %llu gen %llu flags %llu\n", printk(KERN_INFO "\t\textent refs %llu gen %llu flags %llu\n",
(unsigned long long)btrfs_extent_refs(eb, ei), btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei),
(unsigned long long)btrfs_extent_generation(eb, ei), flags);
(unsigned long long)flags);
if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
struct btrfs_tree_block_info *info; struct btrfs_tree_block_info *info;
@ -97,9 +94,8 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
btrfs_tree_block_key(eb, info, &key); btrfs_tree_block_key(eb, info, &key);
printk(KERN_INFO "\t\ttree block key (%llu %u %llu) " printk(KERN_INFO "\t\ttree block key (%llu %u %llu) "
"level %d\n", "level %d\n",
(unsigned long long)btrfs_disk_key_objectid(&key), btrfs_disk_key_objectid(&key), key.type,
key.type, btrfs_disk_key_offset(&key),
(unsigned long long)btrfs_disk_key_offset(&key),
btrfs_tree_block_level(eb, info)); btrfs_tree_block_level(eb, info));
iref = (struct btrfs_extent_inline_ref *)(info + 1); iref = (struct btrfs_extent_inline_ref *)(info + 1);
} else { } else {
@ -115,11 +111,11 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
switch (type) { switch (type) {
case BTRFS_TREE_BLOCK_REF_KEY: case BTRFS_TREE_BLOCK_REF_KEY:
printk(KERN_INFO "\t\ttree block backref " printk(KERN_INFO "\t\ttree block backref "
"root %llu\n", (unsigned long long)offset); "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 " printk(KERN_INFO "\t\tshared block backref "
"parent %llu\n", (unsigned long long)offset); "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);
@ -129,8 +125,7 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
sref = (struct btrfs_shared_data_ref *)(iref + 1); sref = (struct btrfs_shared_data_ref *)(iref + 1);
printk(KERN_INFO "\t\tshared data backref " printk(KERN_INFO "\t\tshared data backref "
"parent %llu count %u\n", "parent %llu count %u\n",
(unsigned long long)offset, offset, btrfs_shared_data_ref_count(eb, sref));
btrfs_shared_data_ref_count(eb, sref));
break; break;
default: default:
BUG(); BUG();
@ -148,9 +143,9 @@ static void print_extent_ref_v0(struct extent_buffer *eb, int slot)
ref0 = btrfs_item_ptr(eb, slot, struct btrfs_extent_ref_v0); ref0 = btrfs_item_ptr(eb, slot, struct btrfs_extent_ref_v0);
printk("\t\textent back ref root %llu gen %llu " printk("\t\textent back ref root %llu gen %llu "
"owner %llu num_refs %lu\n", "owner %llu num_refs %lu\n",
(unsigned long long)btrfs_ref_root_v0(eb, ref0), btrfs_ref_root_v0(eb, ref0),
(unsigned long long)btrfs_ref_generation_v0(eb, ref0), btrfs_ref_generation_v0(eb, ref0),
(unsigned long long)btrfs_ref_objectid_v0(eb, ref0), btrfs_ref_objectid_v0(eb, ref0),
(unsigned long)btrfs_ref_count_v0(eb, ref0)); (unsigned long)btrfs_ref_count_v0(eb, ref0));
} }
#endif #endif
@ -196,39 +191,34 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
nr = btrfs_header_nritems(l); nr = btrfs_header_nritems(l);
btrfs_info(root->fs_info, "leaf %llu total ptrs %d free space %d", btrfs_info(root->fs_info, "leaf %llu total ptrs %d free space %d",
(unsigned long long)btrfs_header_bytenr(l), nr, btrfs_header_bytenr(l), nr, btrfs_leaf_free_space(root, l));
btrfs_leaf_free_space(root, l));
for (i = 0 ; i < nr ; i++) { for (i = 0 ; i < nr ; i++) {
item = btrfs_item_nr(l, i); item = btrfs_item_nr(l, i);
btrfs_item_key_to_cpu(l, &key, i); btrfs_item_key_to_cpu(l, &key, i);
type = btrfs_key_type(&key); type = btrfs_key_type(&key);
printk(KERN_INFO "\titem %d key (%llu %u %llu) itemoff %d " printk(KERN_INFO "\titem %d key (%llu %u %llu) itemoff %d "
"itemsize %d\n", "itemsize %d\n",
i, i, key.objectid, type, key.offset,
(unsigned long long)key.objectid, type,
(unsigned long long)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 " printk(KERN_INFO "\t\tinode generation %llu size %llu "
"mode %o\n", "mode %o\n",
(unsigned long long)
btrfs_inode_generation(l, ii), btrfs_inode_generation(l, ii),
(unsigned long long)btrfs_inode_size(l, ii), btrfs_inode_size(l, ii),
btrfs_inode_mode(l, ii)); btrfs_inode_mode(l, ii));
break; break;
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", printk(KERN_INFO "\t\tdir oid %llu type %u\n",
(unsigned long long)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", printk(KERN_INFO "\t\troot data bytenr %llu refs %u\n",
(unsigned long long)
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;
@ -264,17 +254,12 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
} }
printk(KERN_INFO "\t\textent data disk bytenr %llu " printk(KERN_INFO "\t\textent data disk bytenr %llu "
"nr %llu\n", "nr %llu\n",
(unsigned long long)
btrfs_file_extent_disk_bytenr(l, fi), btrfs_file_extent_disk_bytenr(l, fi),
(unsigned long long)
btrfs_file_extent_disk_num_bytes(l, fi)); btrfs_file_extent_disk_num_bytes(l, fi));
printk(KERN_INFO "\t\textent data offset %llu " printk(KERN_INFO "\t\textent data offset %llu "
"nr %llu ram %llu\n", "nr %llu ram %llu\n",
(unsigned long long)
btrfs_file_extent_offset(l, fi), btrfs_file_extent_offset(l, fi),
(unsigned long long)
btrfs_file_extent_num_bytes(l, fi), btrfs_file_extent_num_bytes(l, fi),
(unsigned long long)
btrfs_file_extent_ram_bytes(l, fi)); btrfs_file_extent_ram_bytes(l, fi));
break; break;
case BTRFS_EXTENT_REF_V0_KEY: case BTRFS_EXTENT_REF_V0_KEY:
@ -288,7 +273,6 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
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", printk(KERN_INFO "\t\tblock group used %llu\n",
(unsigned long long)
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:
@ -305,13 +289,9 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
printk(KERN_INFO "\t\tdev extent chunk_tree %llu\n" printk(KERN_INFO "\t\tdev extent chunk_tree %llu\n"
"\t\tchunk objectid %llu chunk offset %llu " "\t\tchunk objectid %llu chunk offset %llu "
"length %llu\n", "length %llu\n",
(unsigned long long)
btrfs_dev_extent_chunk_tree(l, dev_extent), btrfs_dev_extent_chunk_tree(l, dev_extent),
(unsigned long long)
btrfs_dev_extent_chunk_objectid(l, dev_extent), btrfs_dev_extent_chunk_objectid(l, dev_extent),
(unsigned long long)
btrfs_dev_extent_chunk_offset(l, dev_extent), btrfs_dev_extent_chunk_offset(l, dev_extent),
(unsigned long long)
btrfs_dev_extent_length(l, dev_extent)); btrfs_dev_extent_length(l, dev_extent));
break; break;
case BTRFS_DEV_STATS_KEY: case BTRFS_DEV_STATS_KEY:
@ -344,16 +324,13 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
return; return;
} }
btrfs_info(root->fs_info, "node %llu level %d total ptrs %d free spc %u", btrfs_info(root->fs_info, "node %llu level %d total ptrs %d free spc %u",
(unsigned long long)btrfs_header_bytenr(c), btrfs_header_bytenr(c), level, nr,
level, nr, (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", printk(KERN_INFO "\tkey %d (%llu %u %llu) block %llu\n",
i, i, key.objectid, key.type, key.offset,
(unsigned long long)key.objectid, btrfs_node_blockptr(c, i));
key.type,
(unsigned long long)key.offset,
(unsigned long long)btrfs_node_blockptr(c, i));
} }
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
struct extent_buffer *next = read_tree_block(root, struct extent_buffer *next = read_tree_block(root,

View File

@ -398,8 +398,7 @@ next1:
if (ret == -ENOENT) { if (ret == -ENOENT) {
printk(KERN_WARNING printk(KERN_WARNING
"btrfs: orphan qgroup relation 0x%llx->0x%llx\n", "btrfs: orphan qgroup relation 0x%llx->0x%llx\n",
(unsigned long long)found_key.objectid, found_key.objectid, found_key.offset);
(unsigned long long)found_key.offset);
ret = 0; /* ignore the error */ ret = 0; /* ignore the error */
} }
if (ret) if (ret)
@ -1163,7 +1162,7 @@ int btrfs_limit_qgroup(struct btrfs_trans_handle *trans,
if (ret) { if (ret) {
fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
printk(KERN_INFO "unable to update quota limit for %llu\n", printk(KERN_INFO "unable to update quota limit for %llu\n",
(unsigned long long)qgroupid); qgroupid);
} }
spin_lock(&fs_info->qgroup_lock); spin_lock(&fs_info->qgroup_lock);
@ -1873,10 +1872,9 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
path, 1, 0); path, 1, 0);
pr_debug("current progress key (%llu %u %llu), search_slot ret %d\n", pr_debug("current progress key (%llu %u %llu), search_slot ret %d\n",
(unsigned long long)fs_info->qgroup_rescan_progress.objectid, fs_info->qgroup_rescan_progress.objectid,
fs_info->qgroup_rescan_progress.type, fs_info->qgroup_rescan_progress.type,
(unsigned long long)fs_info->qgroup_rescan_progress.offset, fs_info->qgroup_rescan_progress.offset, ret);
ret);
if (ret) { if (ret) {
/* /*

View File

@ -335,7 +335,7 @@ static void backref_tree_panic(struct rb_node *rb_node, int errno, u64 bytenr)
if (bnode->root) if (bnode->root)
fs_info = bnode->root->fs_info; fs_info = bnode->root->fs_info;
btrfs_panic(fs_info, errno, "Inconsistency in backref cache " btrfs_panic(fs_info, errno, "Inconsistency in backref cache "
"found at offset %llu\n", (unsigned long long)bytenr); "found at offset %llu\n", bytenr);
} }
/* /*
@ -4234,8 +4234,7 @@ int btrfs_relocate_block_group(struct btrfs_root *extent_root, u64 group_start)
} }
printk(KERN_INFO "btrfs: relocating block group %llu flags %llu\n", printk(KERN_INFO "btrfs: relocating block group %llu flags %llu\n",
(unsigned long long)rc->block_group->key.objectid, rc->block_group->key.objectid, rc->block_group->flags);
(unsigned long long)rc->block_group->flags);
ret = btrfs_start_all_delalloc_inodes(fs_info, 0); ret = btrfs_start_all_delalloc_inodes(fs_info, 0);
if (ret < 0) { if (ret < 0) {
@ -4257,7 +4256,7 @@ int btrfs_relocate_block_group(struct btrfs_root *extent_root, u64 group_start)
break; break;
printk(KERN_INFO "btrfs: found %llu extents\n", printk(KERN_INFO "btrfs: found %llu extents\n",
(unsigned long long)rc->extents_found); rc->extents_found);
if (rc->stage == MOVE_DATA_EXTENTS && rc->found_file_extent) { if (rc->stage == MOVE_DATA_EXTENTS && rc->found_file_extent) {
btrfs_wait_ordered_range(rc->data_inode, 0, (u64)-1); btrfs_wait_ordered_range(rc->data_inode, 0, (u64)-1);

View File

@ -155,8 +155,7 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
if (ret != 0) { if (ret != 0) {
btrfs_print_leaf(root, path->nodes[0]); btrfs_print_leaf(root, path->nodes[0]);
printk(KERN_CRIT "unable to update root key %llu %u %llu\n", printk(KERN_CRIT "unable to update root key %llu %u %llu\n",
(unsigned long long)key->objectid, key->type, key->objectid, key->type, key->offset);
(unsigned long long)key->offset);
BUG_ON(1); BUG_ON(1);
} }

View File

@ -754,8 +754,7 @@ out:
num_uncorrectable_read_errors); num_uncorrectable_read_errors);
printk_ratelimited_in_rcu(KERN_ERR printk_ratelimited_in_rcu(KERN_ERR
"btrfs: unable to fixup (nodatasum) error at logical %llu on dev %s\n", "btrfs: unable to fixup (nodatasum) error at logical %llu on dev %s\n",
(unsigned long long)fixup->logical, fixup->logical, rcu_str_deref(fixup->dev->name));
rcu_str_deref(fixup->dev->name));
} }
btrfs_free_path(path); btrfs_free_path(path);
@ -1154,8 +1153,7 @@ corrected_error:
spin_unlock(&sctx->stat_lock); spin_unlock(&sctx->stat_lock);
printk_ratelimited_in_rcu(KERN_ERR printk_ratelimited_in_rcu(KERN_ERR
"btrfs: fixed up error at logical %llu on dev %s\n", "btrfs: fixed up error at logical %llu on dev %s\n",
(unsigned long long)logical, logical, rcu_str_deref(dev->name));
rcu_str_deref(dev->name));
} }
} else { } else {
did_not_correct_error: did_not_correct_error:
@ -1164,8 +1162,7 @@ did_not_correct_error:
spin_unlock(&sctx->stat_lock); spin_unlock(&sctx->stat_lock);
printk_ratelimited_in_rcu(KERN_ERR printk_ratelimited_in_rcu(KERN_ERR
"btrfs: unable to fixup (regular) error at logical %llu on dev %s\n", "btrfs: unable to fixup (regular) error at logical %llu on dev %s\n",
(unsigned long long)logical, logical, rcu_str_deref(dev->name));
rcu_str_deref(dev->name));
} }
out: out:
@ -2455,8 +2452,7 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
printk(KERN_ERR printk(KERN_ERR
"btrfs scrub: tree block %llu spanning " "btrfs scrub: tree block %llu spanning "
"stripes, ignored. logical=%llu\n", "stripes, ignored. logical=%llu\n",
(unsigned long long)key.objectid, key.objectid, logical);
(unsigned long long)logical);
goto next; goto next;
} }
@ -3176,9 +3172,7 @@ static void copy_nocow_pages_worker(struct btrfs_work *work)
nocow_ctx); nocow_ctx);
if (ret != 0 && ret != -ENOENT) { if (ret != 0 && ret != -ENOENT) {
pr_warn("iterate_inodes_from_logical() failed: log %llu, phys %llu, len %llu, mir %llu, ret %d\n", pr_warn("iterate_inodes_from_logical() failed: log %llu, phys %llu, len %llu, mir %llu, ret %d\n",
(unsigned long long)logical, logical, physical_for_dev_replace, len,
(unsigned long long)physical_for_dev_replace,
(unsigned long long)len,
(unsigned long long)mirror_num, ret); (unsigned long long)mirror_num, ret);
not_written = 1; not_written = 1;
goto out; goto out;

View File

@ -522,7 +522,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
root->sectorsize); root->sectorsize);
} }
printk(KERN_INFO "btrfs: max_inline at %llu\n", printk(KERN_INFO "btrfs: max_inline at %llu\n",
(unsigned long long)info->max_inline); info->max_inline);
} else { } else {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
@ -537,7 +537,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
kfree(num); kfree(num);
printk(KERN_INFO printk(KERN_INFO
"btrfs: allocations start at %llu\n", "btrfs: allocations start at %llu\n",
(unsigned long long)info->alloc_start); info->alloc_start);
} else { } else {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
@ -947,11 +947,9 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
if (btrfs_test_opt(root, NOBARRIER)) if (btrfs_test_opt(root, NOBARRIER))
seq_puts(seq, ",nobarrier"); seq_puts(seq, ",nobarrier");
if (info->max_inline != 8192 * 1024) if (info->max_inline != 8192 * 1024)
seq_printf(seq, ",max_inline=%llu", seq_printf(seq, ",max_inline=%llu", info->max_inline);
(unsigned long long)info->max_inline);
if (info->alloc_start != 0) if (info->alloc_start != 0)
seq_printf(seq, ",alloc_start=%llu", seq_printf(seq, ",alloc_start=%llu", info->alloc_start);
(unsigned long long)info->alloc_start);
if (info->thread_pool_size != min_t(unsigned long, if (info->thread_pool_size != min_t(unsigned long,
num_online_cpus() + 2, 8)) num_online_cpus() + 2, 8))
seq_printf(seq, ",thread_pool=%d", info->thread_pool_size); seq_printf(seq, ",thread_pool=%d", info->thread_pool_size);

View File

@ -1948,8 +1948,7 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root)
list_del_init(&root->root_list); list_del_init(&root->root_list);
spin_unlock(&fs_info->trans_lock); spin_unlock(&fs_info->trans_lock);
pr_debug("btrfs: cleaner removing %llu\n", pr_debug("btrfs: cleaner removing %llu\n", root->objectid);
(unsigned long long)root->objectid);
btrfs_kill_all_delayed_nodes(root); btrfs_kill_all_delayed_nodes(root);

View File

@ -914,8 +914,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
printk(KERN_INFO "device fsid %pU ", disk_super->fsid); printk(KERN_INFO "device fsid %pU ", disk_super->fsid);
} }
printk(KERN_CONT "devid %llu transid %llu %s\n", printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path);
(unsigned long long)devid, (unsigned long long)transid, path);
ret = device_list_add(path, disk_super, devid, fs_devices_ret); ret = device_list_add(path, disk_super, devid, fs_devices_ret);
if (!ret && fs_devices_ret) if (!ret && fs_devices_ret)
@ -3159,7 +3158,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
(bctl->data.target & ~allowed))) { (bctl->data.target & ~allowed))) {
printk(KERN_ERR "btrfs: unable to start balance with target " printk(KERN_ERR "btrfs: unable to start balance with target "
"data profile %llu\n", "data profile %llu\n",
(unsigned long long)bctl->data.target); bctl->data.target);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
@ -3168,7 +3167,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
(bctl->meta.target & ~allowed))) { (bctl->meta.target & ~allowed))) {
printk(KERN_ERR "btrfs: unable to start balance with target " printk(KERN_ERR "btrfs: unable to start balance with target "
"metadata profile %llu\n", "metadata profile %llu\n",
(unsigned long long)bctl->meta.target); bctl->meta.target);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
@ -3177,7 +3176,7 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
(bctl->sys.target & ~allowed))) { (bctl->sys.target & ~allowed))) {
printk(KERN_ERR "btrfs: unable to start balance with target " printk(KERN_ERR "btrfs: unable to start balance with target "
"system profile %llu\n", "system profile %llu\n",
(unsigned long long)bctl->sys.target); bctl->sys.target);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
@ -4652,8 +4651,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
if (!em) { if (!em) {
btrfs_crit(fs_info, "unable to find logical %llu len %llu", btrfs_crit(fs_info, "unable to find logical %llu len %llu",
(unsigned long long)logical, logical, *length);
(unsigned long long)*length);
return -EINVAL; return -EINVAL;
} }
@ -5524,9 +5522,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
if (map_length < length) { if (map_length < length) {
btrfs_crit(root->fs_info, "mapping failed logical %llu bio len %llu len %llu", btrfs_crit(root->fs_info, "mapping failed logical %llu bio len %llu len %llu",
(unsigned long long)logical, logical, length, map_length);
(unsigned long long)length,
(unsigned long long)map_length);
BUG(); BUG();
} }
@ -5846,8 +5842,7 @@ static int read_one_dev(struct btrfs_root *root,
return -EIO; return -EIO;
if (!device) { if (!device) {
btrfs_warn(root->fs_info, "devid %llu missing", btrfs_warn(root->fs_info, "devid %llu missing", devid);
(unsigned long long)devid);
device = add_missing_dev(root, devid, dev_uuid); device = add_missing_dev(root, devid, dev_uuid);
if (!device) if (!device)
return -ENOMEM; return -ENOMEM;