"inode table at %llu\n"
" %u free %s%s, "
"%u free %s, "
- "%u used %s%s",
- i, ext2fs_block_bitmap_loc(current_fs, i),
- ext2fs_inode_bitmap_loc(current_fs, i),
- ext2fs_inode_table_loc(current_fs, i),
- ext2fs_bg_free_blocks_count(current_fs, i), units,
+ "%u used %s%s", i,
+ (unsigned long long) ext2fs_block_bitmap_loc(current_fs, i),
+ (unsigned long long) ext2fs_inode_bitmap_loc(current_fs, i),
+ (unsigned long long) ext2fs_inode_table_loc(current_fs, i),
+ ext2fs_bg_free_blocks_count(current_fs, i),
+ units,
ext2fs_bg_free_blocks_count(current_fs, i) != 1 ?
"s" : "",
ext2fs_bg_free_inodes_count(current_fs, i),
fprintf(lb->f, ", ");
if (lb->first_block == lb->last_block)
fprintf(lb->f, "(%lld):%llu",
- (long long)lb->first_bcnt, lb->first_block);
+ (long long)lb->first_bcnt,
+ (unsigned long long) lb->first_block);
else
fprintf(lb->f, "(%lld-%lld):%llu-%llu",
(long long)lb->first_bcnt, (long long)lb->last_bcnt,
- lb->first_block, lb->last_block);
+ (unsigned long long) lb->first_block,
+ (unsigned long long) lb->last_block);
lb->first_block = 0;
}
info.curr_level, info.max_depth,
info.curr_entry, info.num_entries,
logical_width,
- extent.e_lblk,
+ (unsigned long long) extent.e_lblk,
logical_width,
- extent.e_lblk + (extent.e_len - 1),
+ (unsigned long long) extent.e_lblk + (extent.e_len - 1),
physical_width,
- extent.e_pblk,
+ (unsigned long long) extent.e_pblk,
physical_width+3, "", extent.e_len);
continue;
}
fprintf(f, "%s(ETB%d):%llu",
printed ? ", " : "", info.curr_level,
- extent.e_pblk);
+ (unsigned long long) extent.e_pblk);
printed = 1;
continue;
}
info.curr_level, info.max_depth,
info.curr_entry, info.num_entries,
logical_width,
- extent.e_lblk,
+ (unsigned long long) extent.e_lblk,
logical_width,
- extent.e_lblk + (extent.e_len - 1),
+ (unsigned long long) extent.e_lblk + (extent.e_len - 1),
physical_width,
- extent.e_pblk,
+ (unsigned long long) extent.e_pblk,
physical_width,
- extent.e_pblk + (extent.e_len - 1),
+ (unsigned long long) extent.e_pblk + (extent.e_len - 1),
extent.e_len,
extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
"Uninit" : "");
fprintf(f,
"%s(%lld%s):%lld",
printed ? ", " : "",
- extent.e_lblk,
+ (unsigned long long) extent.e_lblk,
extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
"[u]" : "",
- extent.e_pblk);
+ (unsigned long long) extent.e_pblk);
else
fprintf(f,
"%s(%lld-%lld%s):%lld-%lld",
printed ? ", " : "",
- extent.e_lblk,
- extent.e_lblk + (extent.e_len - 1),
+ (unsigned long long) extent.e_lblk,
+ (unsigned long long) extent.e_lblk + (extent.e_len - 1),
extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
"[u]" : "",
- extent.e_pblk,
- extent.e_pblk + (extent.e_len - 1));
+ (unsigned long long) extent.e_pblk,
+ (unsigned long long) extent.e_pblk + (extent.e_len - 1));
printed = 1;
}
if (printed)
fprintf(out, " Project: %5d", large_inode->i_projid);
fputs(" Size: ", out);
if (LINUX_S_ISREG(inode->i_mode) || LINUX_S_ISDIR(inode->i_mode))
- fprintf(out, "%llu\n", EXT2_I_SIZE(inode));
+ fprintf(out, "%llu\n", (unsigned long long) EXT2_I_SIZE(inode));
else
fprintf(out, "%u\n", inode->i_size);
if (os == EXT2_OS_HURD)
int ref_offset EXT2FS_ATTR((unused)),
void *private EXT2FS_ATTR((unused)))
{
- printf("%llu ", *blocknr);
+ printf("%llu ", (unsigned long long) *blocknr);
return 0;
}
while (count-- > 0) {
if (!ext2fs_test_block_bitmap2(current_fs->block_map,block))
com_err(argv[0], 0, "Warning: block %llu already clear",
- block);
+ (unsigned long long) block);
ext2fs_unmark_block_bitmap2(current_fs->block_map,block);
block++;
}
while (count-- > 0) {
if (ext2fs_test_block_bitmap2(current_fs->block_map,block))
com_err(argv[0], 0, "Warning: block %llu already set",
- block);
+ (unsigned long long) block);
ext2fs_mark_block_bitmap2(current_fs->block_map,block);
block++;
}
return;
while (count-- > 0) {
if (ext2fs_test_block_bitmap2(current_fs->block_map,block))
- printf("Block %llu marked in use\n", block);
+ printf("Block %llu marked in use\n",
+ (unsigned long long) block);
else
- printf("Block %llu not in use\n", block);
+ printf("Block %llu not in use\n",
+ (unsigned long long) block);
block++;
}
}
com_err("ext2fs_new_block", retval, 0);
return;
} else
- printf("%llu ", free_blk);
+ printf("%llu ", (unsigned long long) free_blk);
}
printf("\n");
}
&ret_flags, &pblk);
if (errcode) {
com_err(argv[0], errcode,
- "while mapping logical block %llu\n", blk);
+ "while mapping logical block %llu\n",
+ (unsigned long long) blk);
return;
}
- printf("%llu", pblk);
+ printf("%llu", (unsigned long long) pblk);
if (ret_flags & BMAP_RET_UNINIT)
fputs(" (uninit)", stdout);
fputc('\n', stdout);
retval = ext2fs_mmp_read(current_fs, mmp_block, current_fs->mmp_buf);
if (retval) {
com_err(argv[0], retval, "reading MMP block %llu.\n",
- mmp_block);
+ (unsigned long long) mmp_block);
return;
}
t = mmp_s->mmp_time;
- fprintf(stdout, "block_number: %llu\n", current_fs->super->s_mmp_block);
+ fprintf(stdout, "block_number: %llu\n",
+ (unsigned long long) current_fs->super->s_mmp_block);
fprintf(stdout, "update_interval: %d\n",
current_fs->super->s_mmp_update_interval);
fprintf(stdout, "check_interval: %d\n", mmp_s->mmp_check_interval);
fprintf(stdout, "sequence: %08x\n", mmp_s->mmp_seq);
- fprintf(stdout, "time: %lld -- %s", mmp_s->mmp_time, ctime(&t));
+ fprintf(stdout, "time: %llu -- %s",
+ (unsigned long long) mmp_s->mmp_time, ctime(&t));
fprintf(stdout, "node_name: %.*s\n",
EXT2_LEN_STR(mmp_s->mmp_nodename));
fprintf(stdout, "device_name: %.*s\n",
if (desc)
printf("%s: ", desc);
printf("extent: lblk %llu--%llu, len %u, pblk %llu, flags: ",
- extent->e_lblk, extent->e_lblk + extent->e_len - 1,
- extent->e_len, extent->e_pblk);
+ (unsigned long long) extent->e_lblk,
+ (unsigned long long) extent->e_lblk + extent->e_len - 1,
+ extent->e_len, (unsigned long long) extent->e_pblk);
if (extent->e_flags & EXT2_EXTENT_FLAGS_LEAF)
fputs("LEAF ", stdout);
if (extent->e_flags & EXT2_EXTENT_FLAGS_UNINIT)
printf("Current handle location: %d/%d (max: %d, bytes %d), level %d/%d\n",
info.curr_entry, info.num_entries, info.max_entries,
info.bytes_avail, info.curr_level, info.max_depth);
- printf("\tmax lblk: %llu, max pblk: %llu\n", info.max_lblk,
- info.max_pblk);
+ printf("\tmax lblk: %llu, max pblk: %llu\n",
+ (unsigned long long) info.max_lblk,
+ (unsigned long long) info.max_pblk);
printf("\tmax_len: %u, max_uninit_len: %u\n", info.max_len,
info.max_uninit_len);
}
fprintf(fs->f, "%4d %*lu %*llu %*llu %*lu\n", fs->ext,
fs->logical_width,
(unsigned long) fs->logical_start,
- fs->physical_width, fs->physical_start,
- fs->physical_width, fs->expected,
+ fs->physical_width,
+ (unsigned long long) fs->physical_start,
+ fs->physical_width,
+ (unsigned long long) fs->expected,
fs->logical_width, (unsigned long) fs->num);
else
fprintf(fs->f, "%4d %*lu %*llu %*s %*lu\n", fs->ext,
fs->logical_width,
(unsigned long) fs->logical_start,
- fs->physical_width, fs->physical_start,
+ fs->physical_width,
+ (unsigned long long) fs->physical_start,
fs->physical_width, "",
fs->logical_width, (unsigned long) fs->num);
}
num_blocks /= current_fs->blocksize / 512;
fprintf(fs->f, "\n%s has %llu block(s), i_size is %llu\n",
- fs->name, num_blocks, EXT2_I_SIZE(inode));
+ fs->name, (unsigned long long) num_blocks,
+ (unsigned long long) EXT2_I_SIZE(inode));
}
print_header(fs);
if (ext2fs_inode_has_valid_blocks2(current_fs, inode)) {
errcode = ext2fs_bmap2(fs, ino, inode, buf, 0, blk, 0, &pblk);
if (errcode) {
com_err("htree_dump_leaf_node", errcode,
- "while mapping logical block %llu\n", blk);
+ "while mapping logical block %llu\n",
+ (unsigned long long) blk);
return;
}
- fprintf(pager, "Reading directory block %llu, phys %llu\n", blk, pblk);
+ fprintf(pager, "Reading directory block %llu, phys %llu\n",
+ (unsigned long long) blk, (unsigned long long) pblk);
errcode = ext2fs_read_dir_block4(current_fs, pblk, buf, 0, ino);
if (errcode) {
com_err("htree_dump_leaf_node", errcode,
"while reading block %llu (%llu)\n",
- blk, pblk);
+ (unsigned long long) blk, (unsigned long long) pblk);
return;
}
hash_alg = rootnode->hash_version;
((rec_len % 4) != 0) ||
((unsigned) thislen + 8 > rec_len)) {
fprintf(pager, "Corrupted directory block (%llu)!\n",
- blk);
+ (unsigned long long) blk);
break;
}
strncpy(name, dirent->name, thislen);
errcode = ext2fs_bmap2(fs, ino, inode, buf, 0, blk, 0, &pblk);
if (errcode) {
com_err("htree_dump_int_block", errcode,
- "while mapping logical block %llu\n", blk);
+ "while mapping logical block %llu\n",
+ (unsigned long long) blk);
goto errout;
}
errcode = io_channel_read_blk64(current_fs->io, pblk, 1, buf);
if (errcode) {
com_err("htree_dump_int_block", errcode,
- "while reading block %llu\n", blk);
+ "while reading block %llu\n",
+ (unsigned long long) blk);
goto errout;
}
p->len) == 0) {
printf("Entry found at logical block %lld, "
"phys %llu, offset %u\n", (long long)blockcnt,
- *blocknr, offset);
+ (unsigned long long) *blocknr, offset);
printf("offset %u\n", offset);
return BLOCK_ABORT;
}
printf("Block\tInode number\n");
for (i=0, binfo = bw.barray; i < bw.num_blocks; i++, binfo++) {
if (binfo->ino == 0) {
- printf("%llu\t<block not found>\n", binfo->blk);
+ printf("%llu\t<block not found>\n",
+ (unsigned long long) binfo->blk);
continue;
}
- printf("%llu\t%u\n", binfo->blk, binfo->ino);
+ printf("%llu\t%u\n", (unsigned long long) binfo->blk,
+ binfo->ino);
}
error_out:
* sizeof(struct ext2_inode));
printf("Inode %u is at group %u, block %llu, offset %u\n",
inode_to_dump, inode_group,
- inode_block_to_dump, inode_offset_to_dump);
+ (unsigned long long) inode_block_to_dump,
+ inode_offset_to_dump);
}
if (optind == argc) {
le32_to_cpu(add_range->fc_ino),
le32_to_cpu(ex->ee_block),
le32_to_cpu(ex->ee_start) +
- (((__u64) le16_to_cpu(ex->ee_start_hi)) << 32),
+ (((unsigned long long) le16_to_cpu(ex->ee_start_hi)) << 32),
le16_to_cpu(ex->ee_len) > EXT_INIT_MAX_LEN ?
le16_to_cpu(ex->ee_len) - EXT_INIT_MAX_LEN :
le16_to_cpu(ex->ee_len));
rblock = ext2fs_be64_to_cpu(*entry);
}
if (dump_all || rblock == block_to_dump) {
- fprintf(out_file, " Revoke FS block %llu", rblock);
+ fprintf(out_file, " Revoke FS block %llu",
+ (unsigned long long) rblock);
if (dump_all)
fprintf(out_file, "\n");
else
fprintf(out_file, " (block bitmap for block %llu: "
"block is %s)\n",
- block_to_dump,
+ (unsigned long long) block_to_dump,
ext2fs_test_bit(offset, buf) ? "SET" : "CLEAR");
}
if (LINUX_S_ISDIR(inode.i_mode))
fprintf(ls->f, "/");
else
- fprintf(ls->f, "%lld/", EXT2_I_SIZE(&inode));
+ fprintf(ls->f, "%llu/",
+ (unsigned long long) EXT2_I_SIZE(&inode));
fprintf(ls->f, "\n");
} else if (options & LONG_OPT) {
if (ino) {
fprintf(ls->f, "(%d) %5d %5d ",
ext2fs_dirent_file_type(dirent),
inode_uid(inode), inode_gid(inode));
- fprintf(ls->f, "%5llu", EXT2_I_SIZE(&inode));
+ fprintf(ls->f, "%5llu",
+ (unsigned long long) EXT2_I_SIZE(&inode));
fprintf(ls->f, " %s ", datestr);
print_filename(ls->f, dirent, options);
fputc('\n', ls->f);
for (i = 0; i < num_delarray; i++) {
fprintf(out, "%6u %6d %6o %6llu %6lld/%6lld %s",
delarray[i].ino,
- delarray[i].uid, delarray[i].mode, delarray[i].size,
- delarray[i].free_blocks, delarray[i].num_blocks,
+ delarray[i].uid, delarray[i].mode,
+ (unsigned long long) delarray[i].size,
+ (long long) delarray[i].free_blocks,
+ (long long) delarray[i].num_blocks,
time_to_string(delarray[i].dtime));
}
fprintf(out, "%d deleted inodes found.\n", num_delarray);
if (i >= current_fs->blocksize)
continue;
printf("\nUnused block %llu contains non-zero data:\n\n",
- blk);
+ (unsigned long long) blk);
for (i=0; i < current_fs->blocksize; i++)
fputc(buf[i], stdout);
}
block, 0, &block);
if (errcode) {
com_err(argv[0], errcode,
- "while mapping logical block %llu\n", block);
+ "while mapping logical block %llu\n",
+ (unsigned long long) block);
return;
}
}
errcode = io_channel_read_blk64(current_fs->io, block, 1, buf);
if (errcode) {
com_err(argv[0], errcode,
- "while reading block %llu\n", block);
+ "while reading block %llu\n",
+ (unsigned long long) block);
goto errout;
}
errcode = io_channel_write_blk64(current_fs->io, block, 1, buf);
if (errcode) {
com_err(argv[0], errcode,
- "while write block %llu\n", block);
+ "while write block %llu\n",
+ (unsigned long long) block);
goto errout;
}
block, 0, &block);
if (errcode) {
com_err(argv[0], errcode,
- "while mapping logical block %llu\n", block);
+ "while mapping logical block %llu\n",
+ (unsigned long long) block);
return;
}
}
errcode = io_channel_read_blk64(current_fs->io, block, 1, buf);
if (errcode) {
com_err(argv[0], errcode,
- "while reading block %llu\n", block);
+ "while reading block %llu\n",
+ (unsigned long long) block);
goto errout;
}
sprintf(buf, "badblocks -b %d -X %s%s%s %llu", fs->blocksize,
(ctx->options & E2F_OPT_PREEN) ? "" : "-s ",
(ctx->options & E2F_OPT_WRITECHECK) ? "-n " : "",
- fs->device_name, ext2fs_blocks_count(fs->super)-1);
+ fs->device_name,
+ (unsigned long long) ext2fs_blocks_count(fs->super)-1);
f = popen(buf, "r");
if (!f) {
com_err("read_bad_blocks_file", errno,
if (refcount->list[i-1].ea_key >= refcount->list[i].ea_key) {
fprintf(out,
"%s: list[%d].ea_key=%llu, list[%d].ea_key=%llu\n",
- bad, i-1, refcount->list[i-1].ea_key, i,
- refcount->list[i].ea_key);
+ bad, i-1,
+ (unsigned long long) refcount->list[i-1].ea_key,
+ i,
+ (unsigned long long) refcount->list[i].ea_key);
ret = EXT2_ET_INVALID_ARGUMENT;
}
}
case BCODE_STORE:
ea_key = (size_t) bcode_program[i++];
arg = bcode_program[i++];
- printf("Storing ea_key %llu with value %llu\n", ea_key,
- arg);
+ printf("Storing ea_key %llu with value %llu\n",
+ (unsigned long long) ea_key,
+ (unsigned long long) arg);
retval = ea_refcount_store(refcount, ea_key, arg);
if (retval)
com_err("ea_refcount_store", retval,
- "while storing ea_key %llu", ea_key);
+ "while storing ea_key %llu",
+ (unsigned long long) ea_key);
break;
case BCODE_FETCH:
ea_key = (size_t) bcode_program[i++];
retval = ea_refcount_fetch(refcount, ea_key, &arg);
if (retval)
com_err("ea_refcount_fetch", retval,
- "while fetching ea_key %llu", ea_key);
+ "while fetching ea_key %llu",
+ (unsigned long long) ea_key);
else
printf("bcode_fetch(%llu) returns %llu\n",
- ea_key, arg);
+ (unsigned long long) ea_key,
+ (unsigned long long) arg);
break;
case BCODE_INCR:
ea_key = (size_t) bcode_program[i++];
if (retval)
com_err("ea_refcount_increment", retval,
"while incrementing ea_key %llu",
- ea_key);
+ (unsigned long long) ea_key);
else
printf("bcode_increment(%llu) returns %llu\n",
- ea_key, arg);
+ (unsigned long long) ea_key,
+ (unsigned long long) arg);
break;
case BCODE_DECR:
ea_key = (size_t) bcode_program[i++];
if (retval)
com_err("ea_refcount_decrement", retval,
"while decrementing ea_key %llu",
- ea_key);
+ (unsigned long long) ea_key);
else
printf("bcode_decrement(%llu) returns %llu\n",
- ea_key, arg);
+ (unsigned long long) ea_key,
+ (unsigned long long) arg);
break;
case BCODE_VALIDATE:
retval = ea_refcount_validate(refcount, stderr);
ea_key = ea_refcount_intr_next(refcount, &arg);
if (!ea_key)
break;
- printf("\tea_key=%llu, count=%llu\n", ea_key,
- arg);
+ printf("\tea_key=%llu, count=%llu\n",
+ (unsigned long long) ea_key,
+ (unsigned long long) arg);
}
break;
case BCODE_COLLAPSE:
switch (ch) {
case 's':
- fprintf(f, "%llu", EXT2_I_SIZE(inode));
+ fprintf(f, "%llu", (unsigned long long) EXT2_I_SIZE(inode));
break;
case 'S':
fprintf(f, "%u", large_inode->i_extra_isize);
fprintf(f, "%u", inode->i_faddr);
break;
case 'f':
- fprintf(f, "%llu", ext2fs_file_acl_block(fs, inode));
+ fprintf(f, "%llu",
+ (unsigned long long) ext2fs_file_acl_block(fs, inode));
break;
case 'd':
fprintf(f, "%u", (LINUX_S_ISDIR(inode->i_mode) ?
fprintf(f, "%*lld", width, (long long) ctx->blkcount);
break;
case 'S':
- fprintf(f, "%llu", get_backup_sb(NULL, fs, NULL, NULL));
+ fprintf(f, "%llu",
+ (unsigned long long) get_backup_sb(NULL, fs,
+ NULL, NULL));
break;
case 's':
fprintf(f, "%*s", width, ctx->str ? ctx->str : "NULL");
if (is_leaf && problem == 0 && extent.e_len > 0) {
#if 0
printf("extent_region(ino=%u, expect=%llu, "
- "lblk=%llu, len=%u)\n",
- pb->ino, pb->next_lblock,
- extent.e_lblk, extent.e_len);
+ "lblk=%llu, len=%u)\n", pb->ino,
+ (unsigned long long) pb->next_lblock,
+ (unsigned long long) extent.e_lblk,
+ extent.e_len);
#endif
if (extent.e_lblk < pb->next_lblock)
problem = PR_1_EXTENT_COLLISION;
pb.num_blocks *= EXT2FS_CLUSTER_RATIO(fs);
#if 0
printf("inode %u, i_size = %u, last_block = %llu, i_blocks=%llu, num_blocks = %llu\n",
- ino, inode->i_size, pb.last_block, ext2fs_inode_i_blocks(fs, inode),
- pb.num_blocks);
+ ino, inode->i_size, (unsigned long long) pb.last_block,
+ (unsigned long long) ext2fs_inode_i_blocks(fs, inode),
+ (unsigned long long) pb.num_blocks);
#endif
size = EXT2_I_SIZE(inode);
if (pb.is_dir) {
(unsigned long) pctx->ino, type,
(unsigned long) p->previous_block+1,
(unsigned long) blk,
- blockcnt);
+ (long long) blockcnt);
}
p->fragmented = 1;
}
} else
com_err("delete_file_block", 0,
_("internal error: can't find dup_blk for %llu\n"),
- *block_nr);
+ (unsigned long long) *block_nr);
} else {
if ((*block_nr % EXT2FS_CLUSTER_RATIO(ctx->fs)) == 0)
ext2fs_block_alloc_stats2(fs, *block_nr, -1);
if (!n) {
com_err("clone_file_block", 0,
_("internal error: can't find dup_blk for %llu\n"),
- *block_nr);
+ (unsigned long long) *block_nr);
return 0;
}
}
#if 0
printf("Cloning block #%lld from %llu to %llu\n",
- blockcnt, *block_nr, new_block);
+ blockcnt, (unsigned long long) *block_nr,
+ (unsigned long long) new_block);
#endif
retval = io_channel_read_blk64(fs->io, *block_nr, 1, cs->buf);
if (retval) {
if (!n) {
com_err("clone_file", 0,
_("internal error: couldn't lookup EA "
- "block record for %llu"), blk);
+ "block record for %llu"),
+ (unsigned long long) blk);
retval = 0; /* OK to stumble on... */
goto errout;
}
if (pctx->dir)
fprintf(f, " dir=\"%u\"", pctx->dir);
if (pctx->blk)
- fprintf(f, " blk=\"%llu\"", pctx->blk);
+ fprintf(f, " blk=\"%llu\"", (unsigned long long) pctx->blk);
if (pctx->blk2)
- fprintf(f, " blk2=\"%llu\"", pctx->blk2);
+ fprintf(f, " blk2=\"%llu\"", (unsigned long long) pctx->blk2);
if (pctx->blkcount != (e2_blkcnt_t) -1)
- fprintf(f, " blkcount=\"%lld\"", pctx->blkcount);
+ fprintf(f, " blkcount=\"%lld\"", (unsigned long long) pctx->blkcount);
if (pctx->group != (dgrp_t) -1)
fprintf(f, " group=\"%u\"", pctx->group);
if (pctx->csum1)
if (pctx->csum2)
fprintf(f, " csum2=\"%u\"", pctx->csum2);
if (pctx->num)
- fprintf(f, " num=\"%llu\"", pctx->num);
+ fprintf(f, " num=\"%llu\"", (unsigned long long) pctx->num);
if (pctx->num2)
- fprintf(f, " num2=\"%llu\"", pctx->num2);
+ fprintf(f, " num2=\"%llu\"", (unsigned long long) pctx->num2);
if (pctx->str)
fprintf(f, " str=\"%s\"", pctx->str);
fputs("/>\n", f);
struct region_el *r;
int i = 0;
- fprintf(f, "Printing region (min=%llu. max=%llu)\n\t", region->min,
- region->max);
+ fprintf(f, "Printing region (min=%llu. max=%llu)\n\t",
+ (unsigned long long) region->min,
+ (unsigned long long) region->max);
for (r = region->allocated; r; r = r->next) {
- fprintf(f, "(%llu, %llu) ", r->start, r->end);
+ fprintf(f, "(%llu, %llu) ",
+ (unsigned long long) r->start,
+ (unsigned long long) r->end);
if (++i >= 8)
fprintf(f, "\n\t");
}
start = bcode_program[pc++];
end = bcode_program[pc++];
printf("Creating region with args(%llu, %llu)\n",
- start, end);
+ (unsigned long long) start,
+ (unsigned long long) end);
r = region_create(start, end);
if (!r) {
fprintf(stderr, "Couldn't create region.\n");
end = bcode_program[pc++];
ret = region_allocate(r, start, end);
printf("Region_allocate(%llu, %llu) returns %d\n",
- start, end, ret);
+ (unsigned long long) start,
+ (unsigned long long) end, ret);
break;
case BCODE_PRINT:
region_print(r, stdout);
"%llu/%llu blocks\n"),
ctx->device_name, inodes_used, inodes,
frag_percent_total / 10, frag_percent_total % 10,
- blocks_used, blocks);
+ (unsigned long long) blocks_used,
+ (unsigned long long) blocks);
return;
}
profile_get_boolean(ctx->profile, "options", "report_features", 0, 0,
log_out(ctx, P_("%12llu block used (%2.2f%%, out of %llu)\n",
"%12llu blocks used (%2.2f%%, out of %llu)\n",
blocks_used),
- blocks_used, 100.0 * blocks_used / blocks, blocks);
+ (unsigned long long) blocks_used, 100.0 * blocks_used / blocks,
+ (unsigned long long) blocks);
log_out(ctx, P_("%12u bad block\n", "%12u bad blocks\n",
ctx->fs_badblocks_count), ctx->fs_badblocks_count);
log_out(ctx, P_("%12u large file\n", "%12u large files\n",
ctx->device_name,
fs->super->s_inodes_count - fs->super->s_free_inodes_count,
fs->super->s_inodes_count,
- ext2fs_blocks_count(fs->super) -
+ (unsigned long long) ext2fs_blocks_count(fs->super) -
ext2fs_free_blocks_count(fs->super),
- ext2fs_blocks_count(fs->super));
+ (unsigned long long) ext2fs_blocks_count(fs->super));
next_check = 100000;
if (fs->super->s_max_mnt_count > 0) {
next_check = fs->super->s_max_mnt_count - fs->super->s_mnt_count;
#ifdef CONFIG_JBD_DEBUG
char *jbd_debug;
#endif
- unsigned long long phys_mem_kb;
+ unsigned long long phys_mem_kb, blk;
retval = e2fsck_allocate_context(&ctx);
if (retval)
/* What we do by default, anyway! */
break;
case 'b':
- res = sscanf(optarg, "%llu", &ctx->use_superblock);
+ res = sscanf(optarg, "%llu", &blk);
+ ctx->use_superblock = blk;
if (res != 1)
goto sscanf_err;
ctx->flags |= E2F_FLAG_SB_SPECIFIED;
mmp->mmp_check_interval);
printf(" mmp_sequence: %08x\n", mmp->mmp_seq);
printf(" mmp_update_date: %s", ctime(&t));
- printf(" mmp_update_time: %lld\n", mmp->mmp_time);
+ printf(" mmp_update_time: %lld\n",
+ (long long) mmp->mmp_time);
printf(" mmp_node_name: %.*s\n",
EXT2_LEN_STR(mmp->mmp_nodename));
printf(" mmp_device_name: %.*s\n",
fprintf(f, "Filesystem OS type: %s\n", str);
free(str);
fprintf(f, "Inode count: %u\n", sb->s_inodes_count);
- fprintf(f, "Block count: %llu\n", e2p_blocks_count(sb));
- fprintf(f, "Reserved block count: %llu\n", e2p_r_blocks_count(sb));
+ fprintf(f, "Block count: %llu\n",
+ (unsigned long long) e2p_blocks_count(sb));
+ fprintf(f, "Reserved block count: %llu\n",
+ (unsigned long long) e2p_r_blocks_count(sb));
if (sb->s_overhead_clusters)
fprintf(f, "Overhead clusters: %u\n",
sb->s_overhead_clusters);
- fprintf(f, "Free blocks: %llu\n", e2p_free_blocks_count(sb));
+ fprintf(f, "Free blocks: %llu\n",
+ (unsigned long long) e2p_free_blocks_count(sb));
fprintf(f, "Free inodes: %u\n", sb->s_free_inodes_count);
fprintf(f, "First block: %u\n", sb->s_first_data_block);
fprintf(f, "Block size: %u\n", EXT2_BLOCK_SIZE(sb));
if (sb->s_kbytes_written) {
fprintf(f, "Lifetime writes: ");
if (sb->s_kbytes_written < POW2(13))
- fprintf(f, "%llu kB\n", sb->s_kbytes_written);
+ fprintf(f, "%llu kB\n",
+ (unsigned long long) sb->s_kbytes_written);
else if (sb->s_kbytes_written < POW2(23))
- fprintf(f, "%llu MB\n",
- (sb->s_kbytes_written + POW2(9)) >> 10);
+ fprintf(f, "%llu MB\n", (unsigned long long)
+ (sb->s_kbytes_written + POW2(9)) >> 10);
else if (sb->s_kbytes_written < POW2(33))
- fprintf(f, "%llu GB\n",
+ fprintf(f, "%llu GB\n", (unsigned long long)
(sb->s_kbytes_written + POW2(19)) >> 20);
else if (sb->s_kbytes_written < POW2(43))
- fprintf(f, "%llu TB\n",
+ fprintf(f, "%llu TB\n", (unsigned long long)
(sb->s_kbytes_written + POW2(29)) >> 30);
else
- fprintf(f, "%llu PB\n",
+ fprintf(f, "%llu PB\n", (unsigned long long)
(sb->s_kbytes_written + POW2(39)) >> 40);
}
fprintf(f, "Reserved blocks uid: ");
fprintf(f, "Snapshot ID: %u\n",
sb->s_snapshot_id);
fprintf(f, "Snapshot reserved blocks: %llu\n",
- sb->s_snapshot_r_blocks_count);
+ (unsigned long long) sb->s_snapshot_r_blocks_count);
}
if (sb->s_snapshot_list)
fprintf(f, "Snapshot list head: %u\n",
sb->s_first_error_ino);
if (sb->s_first_error_block)
fprintf(f, "First error block #: %llu\n",
- sb->s_first_error_block);
+ (unsigned long long) sb->s_first_error_block);
if (sb->s_first_error_errcode)
fprintf(f, "First error err: %s\n",
e2p_errcode2str(sb->s_first_error_errcode));
sb->s_last_error_ino);
if (sb->s_last_error_block)
fprintf(f, "Last error block #: %llu\n",
- sb->s_last_error_block);
+ (unsigned long long) sb->s_last_error_block);
if (sb->s_last_error_errcode)
fprintf(f, "Last error err: %s\n",
e2p_errcode2str(sb->s_last_error_errcode));
}
if (ext2fs_has_feature_mmp(sb)) {
fprintf(f, "MMP block number: %llu\n",
- (long long)sb->s_mmp_block);
+ (unsigned long long) sb->s_mmp_block);
fprintf(f, "MMP update interval: %u\n",
sb->s_mmp_update_interval);
}
#ifdef ENABLE_BMAP_STATS
static void ba_print_stats(ext2fs_generic_bitmap_64 bitmap)
{
- fprintf(stderr, "%16llu Bytes used by bitarray\n",
+ fprintf(stderr, "%16llu Bytes used by bitarray\n", (unsigned long long)
((bitmap->real_end - bitmap->start) >> 3) + 1 +
sizeof(struct ext2fs_ba_private_struct));
}
node = ext2fs_rb_next(node)) {
ext = node_to_extent(node);
fprintf(stderr, "\t\t\t--> (%llu -> %llu)\n",
- ext->start, ext->start + ext->count);
+ (unsigned long long) ext->start,
+ (unsigned long long) ext->start + ext->count);
}
fprintf(stderr, "\t\t\t=================================\n");
}
if (ext->count == 0) {
fprintf(stderr, "Tree Error: count is zero\n");
fprintf(stderr, "extent: %llu -> %llu (%llu)\n",
- ext->start, ext->start + ext->count,
- ext->count);
+ (unsigned long long) ext->start,
+ (unsigned long long) ext->start + ext->count,
+ (unsigned long long) ext->count);
goto err_out;
}
if (ext->start + ext->count < ext->start) {
fprintf(stderr,
"Tree Error: start or count is crazy\n");
fprintf(stderr, "extent: %llu -> %llu (%llu)\n",
- ext->start, ext->start + ext->count,
- ext->count);
+ (unsigned long long) ext->start,
+ (unsigned long long) ext->start + ext->count,
+ (unsigned long long) ext->count);
goto err_out;
}
if (old->start > ext->start) {
fprintf(stderr, "Tree Error: start is crazy\n");
fprintf(stderr, "extent: %llu -> %llu (%llu)\n",
- old->start, old->start + old->count,
- old->count);
+ (unsigned long long) old->start,
+ (unsigned long long) old->start + old->count,
+ (unsigned long long) old->count);
fprintf(stderr,
"extent next: %llu -> %llu (%llu)\n",
- ext->start, ext->start + ext->count,
- ext->count);
+ (unsigned long long) ext->start,
+ (unsigned long long) ext->start + ext->count,
+ (unsigned long long) ext->count);
goto err_out;
}
if ((old->start + old->count) >= ext->start) {
fprintf(stderr,
"Tree Error: extent is crazy\n");
fprintf(stderr, "extent: %llu -> %llu (%llu)\n",
- old->start, old->start + old->count,
- old->count);
+ (unsigned long long) old->start,
+ (unsigned long long) old->start + old->count,
+ (unsigned long long) old->count);
fprintf(stderr,
"extent next: %llu -> %llu (%llu)\n",
- ext->start, ext->start + ext->count,
- ext->count);
+ (unsigned long long) ext->start,
+ (unsigned long long) ext->start + ext->count,
+ (unsigned long long) ext->count);
goto err_out;
}
}
bp->test_hit, t_hit, bp->mark_hit, m_hit);
#endif
fprintf(stderr, "%16llu extents (%llu bytes)\n",
- count, ((count * sizeof(struct bmap_rb_extent)) +
- sizeof(struct ext2fs_rb_private)));
+ (unsigned long long) count, (unsigned long long)
+ ((count * sizeof(struct bmap_rb_extent)) +
+ sizeof(struct ext2fs_rb_private)));
fprintf(stderr, "%16llu bits minimum size\n",
- min_size);
+ (unsigned long long) min_size);
fprintf(stderr, "%16llu bits maximum size\n"
"%16llu bits average size\n",
- max_size, avg_size);
- fprintf(stderr, "%16llu bits set in bitmap (out of %llu)\n", size,
- bitmap->real_end - bitmap->start);
+ (unsigned long long) max_size, (unsigned long long) avg_size);
+ fprintf(stderr, "%16llu bits set in bitmap (out of %llu)\n",
+ (unsigned long long) size,
+ (unsigned long long) bitmap->real_end - bitmap->start);
fprintf(stderr,
"%16.4lf memory / bitmap bit memory ratio (bitarray = 1)\n",
eff);
#ifndef OMIT_COM_ERR
if (bitmap->description)
com_err(0, bitmap->base_error_code+code,
- "#%llu for %s", arg, bitmap->description);
+ "#%llu for %s", (unsigned long long) arg,
+ bitmap->description);
else
- com_err(0, bitmap->base_error_code + code, "#%llu", arg);
+ com_err(0, bitmap->base_error_code + code, "#%llu",
+ (unsigned long long) arg);
#endif
}
return;
last_update = now;
- printf("%*llu/%*llu", progress->log_max, val,
- progress->log_max, progress->max);
+ printf("%*llu/%*llu", progress->log_max, (unsigned long long) val,
+ progress->log_max, (unsigned long long) progress->max);
fprintf(stdout, "%.*s", (2*progress->log_max)+1, backspaces);
}
void *priv_data))
{
errcode_t retval;
- blk64_t blockno;
+ unsigned long long blockno;
int count;
char buf[128];
((blockno < fs->super->s_first_data_block) ||
(blockno >= ext2fs_blocks_count(fs->super)))) {
if (invalid)
- (invalid)(fs, blockno, buf, priv_data);
+ (invalid)(fs, (blk64_t) blockno, buf, priv_data);
continue;
}
- retval = ext2fs_badblocks_list_add(*bb_list, blockno);
+ retval = ext2fs_badblocks_list_add(*bb_list, (blk64_t) blockno);
if (retval)
return retval;
}
error_message(retval));
return;
}
- printf("First unmarked block is %llu\n", out);
+ printf("First unmarked block is %llu\n", (unsigned long long) out);
}
void do_ffsb(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
error_message(retval));
return;
}
- printf("First marked block is %llu\n", out);
+ printf("First marked block is %llu\n", (unsigned long long) out);
}
for (i=0; test_vec[i]; i++) {
if (ext2fs_test_block_bitmap2(touched_map, test_vec[i])) {
- printf("Bad block was touched --- %llu\n", test_vec[i]);
+ printf("Bad block was touched --- %llu\n",
+ (unsigned long long) test_vec[i]);
failed++;
first_no_comma = 1;
}
j++, blk++) {
if (!ext2fs_test_block_bitmap2(touched_map, blk) &&
!ext2fs_test_block_bitmap2(bad_block_map, blk)) {
- printf("Missing block --- %llu\n", blk);
+ printf("Missing block --- %llu\n",
+ (unsigned long long) blk);
failed++;
}
}
void *private EXT2FS_ATTR((unused)))
{
printf("%6lld %8llu (%d %llu)\n", (long long) blockcnt,
- (unsigned long long)*blocknr, ref_offset, ref_block);
+ (unsigned long long) *blocknr, ref_offset,
+ (unsigned long long) ref_block);
return 0;
}
(filesize + QT_BLKSIZE - 1) >> QT_BLKSIZE_BITS)) {
log_err("Quota inode %u corrupted: file size %llu; "
"dqi_blocks %u", h->qh_qf.ino,
- filesize, info->dqi_qtree.dqi_blocks);
+ (unsigned long long) filesize,
+ info->dqi_qtree.dqi_blocks);
return -1;
}
if (info->dqi_qtree.dqi_free_blk >= info->dqi_qtree.dqi_blocks) {
unsigned int);
int open_flag;
long sysval;
- blk64_t inblk;
+ unsigned long long inblk;
setbuf(stdout, NULL);
setbuf(stderr, NULL);
} else first_block = 0;
if (first_block >= last_block) {
com_err (program_name, 0, _("invalid starting block (%llu): must be less than %llu"),
- first_block, last_block);
+ (unsigned long long) first_block,
+ (unsigned long long) last_block);
exit (1);
}
/* ext2 badblocks file can't handle large values */
if (last_block >> 32) {
com_err(program_name, EOVERFLOW,
_("invalid end block (%llu): must be 32-bit value"),
- last_block);
+ (unsigned long long) last_block);
exit(1);
}
if (w_flag)
&old_desc_blk, &new_desc_blk, 0);
if (grp_only) {
- printf("%lu:%llu:", i, first_block);
+ printf("%lu:%llu:", i, (unsigned long long) first_block);
if (i == 0 || super_blk)
- printf("%llu:", super_blk);
+ printf("%llu:", (unsigned long long) super_blk);
else
printf("-1:");
if (old_desc_blk) {
old_desc_blk + old_desc_blocks - 1);
printf(":");
} else if (new_desc_blk)
- printf("%llu:", new_desc_blk);
+ printf("%llu:", (unsigned long long) new_desc_blk);
else
printf("-1:");
printf("%llu:%llu:%llu\n",
- ext2fs_block_bitmap_loc(fs, i),
- ext2fs_inode_bitmap_loc(fs, i),
- ext2fs_inode_table_loc(fs, i));
+ (unsigned long long) ext2fs_block_bitmap_loc(fs, i),
+ (unsigned long long) ext2fs_inode_bitmap_loc(fs, i),
+ (unsigned long long) ext2fs_inode_table_loc(fs, i));
continue;
}
if (retval) {
com_err(program_name, retval,
_("reading MMP block %llu from '%s'\n"),
- fs->super->s_mmp_block, fs->device_name);
+ (unsigned long long) fs->super->s_mmp_block,
+ fs->device_name);
return;
}
printf(" mmp_check_interval: %d\n", mmp->mmp_check_interval);
printf(" mmp_sequence: %#08x\n", mmp->mmp_seq);
printf(" mmp_update_date: %s", ctime(&mmp_time));
- printf(" mmp_update_time: %lld\n", mmp->mmp_time);
+ printf(" mmp_update_time: %llu\n",
+ (unsigned long long) mmp->mmp_time);
printf(" mmp_node_name: %.*s\n",
EXT2_LEN_STR(mmp->mmp_nodename));
printf(" mmp_device_name: %.*s\n",
int i, retval = 0;
fprintf(f, "Total blocks: %llu\nFree blocks: %llu (%0.1f%%)\n",
- ext2fs_blocks_count(fs->super),
- free_blks,
+ (unsigned long long) ext2fs_blocks_count(fs->super),
+ (unsigned long long) free_blks,
(double)free_blks * 100 /
ext2fs_blocks_count(fs->super));
if (block)
com_err(program_name, err,
- _("error writing block %llu"), block);
+ _("error writing block %llu"),
+ (unsigned long long) block);
else
com_err(program_name, err, "%s",
_("error in generic_write()"));
static int print_progress(blk64_t num, blk64_t total)
{
- return fprintf(stderr, _("%llu / %llu blocks (%d%%)"), num, total,
- calc_percent(num, total));
+ return fprintf(stderr, _("%llu / %llu blocks (%d%%)"),
+ (unsigned long long) num,
+ (unsigned long long) total,
+ calc_percent(num, total));
}
static void output_meta_data_blocks(ext2_filsys fs, int fd, int flags)
retval = io_channel_read_blk64(fs->io, blk, 1, buf);
if (retval) {
com_err(program_name, retval,
- _("error reading block %llu"), blk);
+ _("error reading block %llu"),
+ (unsigned long long) blk);
}
total_written++;
if (scramble_block_map &&
fputc('\r', stderr);
strftime(buff, 30, "%T", gmtime(&duration));
fprintf(stderr, _("Copied %llu / %llu blocks (%d%%) in %s "),
- total_written, meta_blocks_count,
+ (unsigned long long) total_written,
+ (unsigned long long) meta_blocks_count,
calc_percent(total_written, meta_blocks_count), buff);
if (duration)
fprintf(stderr, _("at %.2f MB/s"),
retval = io_channel_read_blk64(fs->io, blk, 1, buf);
if (retval) {
com_err(program_name, retval,
- _("error reading block %llu"), blk);
+ _("error reading block %llu"),
+ (unsigned long long) blk);
continue;
}
if (scramble_block_map &&
goto skip_device;
}
}
- sprintf(offset_opt, "offset=%llu", source_offset);
+ sprintf(offset_opt, "offset=%llu", (unsigned long long) source_offset);
retval = ext2fs_open2(device_name, offset_opt, open_flag,
superblock, blocksize, unix_io_manager, &fs);
if (retval) {
static void dump_header(struct undo_header *hdr)
{
- printf("nr keys:\t%llu\n", ext2fs_le64_to_cpu(hdr->num_keys));
- printf("super block:\t%llu\n", ext2fs_le64_to_cpu(hdr->super_offset));
- printf("key block:\t%llu\n", ext2fs_le64_to_cpu(hdr->key_offset));
+ printf("nr keys:\t%llu\n",
+ (unsigned long long) ext2fs_le64_to_cpu(hdr->num_keys));
+ printf("super block:\t%llu\n",
+ (unsigned long long) ext2fs_le64_to_cpu(hdr->super_offset));
+ printf("key block:\t%llu\n",
+ (unsigned long long) ext2fs_le64_to_cpu(hdr->key_offset));
printf("block size:\t%u\n", ext2fs_le32_to_cpu(hdr->block_size));
printf("fs block size:\t%u\n", ext2fs_le32_to_cpu(hdr->fs_block_size));
printf("super crc:\t0x%x\n", ext2fs_le32_to_cpu(hdr->sb_crc));
printf("incompat:\t0x%x\n", ext2fs_le32_to_cpu(hdr->f_incompat));
printf("rocompat:\t0x%x\n", ext2fs_le32_to_cpu(hdr->f_rocompat));
if (e2undo_has_feature_fs_offset(hdr))
- printf("fs offset:\t%llu\n", ext2fs_le64_to_cpu(hdr->fs_offset));
+ printf("fs offset:\t%llu\n",
+ (unsigned long long) ext2fs_le64_to_cpu(hdr->fs_offset));
printf("header crc:\t0x%x\n", ext2fs_le32_to_cpu(hdr->header_crc));
}
if (!*opt_offset_string)
offset = ext2fs_le64_to_cpu(undo_ctx.hdr.fs_offset);
retval = snprintf(opt_offset_string, sizeof(opt_offset_string),
- "offset=%llu", offset);
+ "offset=%llu", (unsigned long long) offset);
if ((size_t) retval >= sizeof(opt_offset_string)) {
/* should not happen... */
com_err(prg_name, 0, _("specified offset is too large"));
if (!force &&
ext2fs_le32_to_cpu(keyb->magic) != KEYBLOCK_MAGIC) {
fprintf(stderr, _("%s: wrong key magic at %llu\n"),
- tdb_file, lblk);
+ tdb_file, (unsigned long long) lblk);
exit(1);
}
crc = keyb->crc;
if (!force && ext2fs_le32_to_cpu(crc) != key_crc) {
fprintf(stderr,
_("%s: key block checksum error at %llu.\n"),
- tdb_file, lblk);
+ tdb_file, (unsigned long long) lblk);
exit(1);
}
ikey->size) {
com_err(prg_name, retval,
_("%s: block %llu is too long."),
- tdb_file, ikey->fsblk);
+ tdb_file,
+ (unsigned long long) ikey->fsblk);
exit(1);
}
if (retval) {
com_err(prg_name, retval,
_("while fetching block %llu."),
- ikey->fileblk);
+ (unsigned long long) ikey->fileblk);
if (!force)
exit(1);
io_error = 1;
fprintf(stderr,
_("checksum error in filesystem block "
"%llu (undo blk %llu)\n"),
- ikey->fsblk, ikey->fileblk);
+ (unsigned long long) ikey->fsblk,
+ (unsigned long long) ikey->fileblk);
if (!force)
exit(1);
csum_error = 1;
if (retval) {
com_err(prg_name, retval,
_("while fetching block %llu."),
- ikey->fileblk);
+ (unsigned long long) ikey->fileblk);
io_error = 1;
continue;
}
if (verbose)
printf("Replayed block of size %u from %llu to %llu\n",
- ikey->size, ikey->fileblk, ikey->fsblk);
+ ikey->size, (unsigned long long) ikey->fileblk,
+ (unsigned long long) ikey->fsblk);
if (dry_run)
continue;
retval = io_channel_write_blk64(channel, ikey->fsblk,
-(int)ikey->size, buf);
if (retval) {
com_err(prg_name, retval,
- _("while writing block %llu."), ikey->fsblk);
+ _("while writing block %llu."),
+ (unsigned long long) ikey->fsblk);
io_error = 1;
}
}
do {
count++;
printf("[ext %d]:\tstart %llu:\tlogical "
- "%llu:\tlen %llu\n", count,
- ext_list_tmp->data.physical,
- ext_list_tmp->data.logical,
- ext_list_tmp->data.len);
+ "%llu:\tlen %llu\n", count,
+ (unsigned long long)
+ ext_list_tmp->data.physical,
+ (unsigned long long)
+ ext_list_tmp->data.logical,
+ (unsigned long long)
+ ext_list_tmp->data.len);
ext_list_tmp = ext_list_tmp->next;
} while (ext_list_tmp != logical_list_head);
if (current_uid == ROOT_UID) {
if (strlen(file) > 40)
printf("%s\n%50d/%-10d%6llu KB\n",
- file, now_ext_count,
- best_ext_count, size_per_ext);
+ file, now_ext_count,
+ best_ext_count,
+ (unsigned long long) size_per_ext);
else
printf("%-40s%10d/%-10d%6llu KB\n",
- file, now_ext_count,
- best_ext_count, size_per_ext);
+ file, now_ext_count,
+ best_ext_count,
+ (unsigned long long) size_per_ext);
} else {
if (strlen(file) > 40)
printf("%s\n%50d/%-10s%7s\n",
if (current_uid == ROOT_UID) {
if (strlen(msg_buffer) > 40)
printf("\033[79;0H\033[K%s\n"
- "%50d/%-10d%6llu KB\n",
- msg_buffer, now_ext_count,
- best_ext_count, size_per_ext);
+ "%50d/%-10d%6llu KB\n",
+ msg_buffer, now_ext_count,
+ best_ext_count,
+ (unsigned long long) size_per_ext);
else
printf("\033[79;0H\033[K%-40s"
- "%10d/%-10d%6llu KB\n",
- msg_buffer, now_ext_count,
- best_ext_count, size_per_ext);
+ "%10d/%-10d%6llu KB\n",
+ msg_buffer, now_ext_count,
+ best_ext_count,
+ (unsigned long long) size_per_ext);
} else {
if (strlen(msg_buffer) > 40)
printf("\033[79;0H\033[K%s\n%50d/%-10s%7s\n",
frag_rank[j].msg_buffer,
frag_rank[j].now_count,
frag_rank[j].best_count,
+ (unsigned long long)
frag_rank[j].
size_per_ext);
} else if (strlen(frag_rank[j].
frag_rank[j].msg_buffer,
frag_rank[j].now_count,
frag_rank[j].best_count,
+ (unsigned long long)
frag_rank[j].
size_per_ext);
} else
100 / files_block_count;
score = CALC_SCORE(files_ratio);
printf("\n Total/best extents\t\t\t\t%d/%d\n"
- " Average size per extent"
- "\t\t\t%llu KB\n"
- " Fragmentation score\t\t\t\t%.0f\n",
- extents_before_defrag,
- extents_after_defrag,
- size_per_ext, score);
+ " Average size per extent"
+ "\t\t\t%llu KB\n"
+ " Fragmentation score\t\t\t\t%.0f\n",
+ extents_before_defrag,
+ extents_after_defrag,
+ (unsigned long long) size_per_ext, score);
printf(" [0-30 no problem:"
" 31-55 a little bit fragmented:"
" 56- needs defrag]\n");
if (verbose && expected != 0) {
printf("Discontinuity: Block %llu is at %llu "
"(was %llu)\n",
- fm_ext.fe_logical / st->st_blksize,
- fm_ext.fe_physical / st->st_blksize,
- expected / st->st_blksize);
+ (unsigned long long) (fm_ext.fe_logical / st->st_blksize),
+ (unsigned long long) (fm_ext.fe_physical / st->st_blksize),
+ (unsigned long long) (expected / st->st_blksize));
}
/* create the new extent */
fm_last = fm_ext;
__u32 state;
printf("File size of %s is %llu (%llu block%s of %d bytes)",
- filename, (unsigned long long)st.st_size,
- numblocks * blksize >> blk_shift,
+ filename, (unsigned long long) st.st_size,
+ (unsigned long long) (numblocks * blksize >> blk_shift),
numblocks == 1 ? "" : "s", 1 << blk_shift);
if (use_extent_cache &&
ioctl(fd, EXT4_IOC_GETSTATE, &state) == 0 &&
if (retval)
com_err(program_name, retval,
_("while zeroing block %llu "
- "for hugefile"), ret_blk);
+ "for hugefile"),
+ (unsigned long long) ret_blk);
}
while (n) {
fprintf(stderr,
_("Partition offset of %llu (%uk) blocks "
"not compatible with cluster size %u.\n"),
- part_offset, fs->blocksize,
+ (unsigned long long) part_offset, fs->blocksize,
EXT2_CLUSTER_SIZE(fs->super));
exit(1);
}
printf("%s", _("Huge files will be zero'ed\n"));
printf(_("Creating %lu huge file(s) "), num_files);
if (num_blocks)
- printf(_("with %llu blocks each"), num_blocks);
+ printf(_("with %llu blocks each"),
+ (unsigned long long) num_blocks);
fputs(": ", stdout);
}
for (i=0; i < num_files; i++) {
sprintf(buf, "badblocks -b %d -X %s%s%s %llu", fs->blocksize,
quiet ? "" : "-s ", (cflag > 1) ? "-w " : "",
- fs->device_name, ext2fs_blocks_count(fs->super)-1);
+ fs->device_name,
+ (unsigned long long) ext2fs_blocks_count(fs->super)-1);
if (verbose)
printf(_("Running command: %s\n"), buf);
f = popen(buf, "r");
if (retval) {
fprintf(stderr, _("\nCould not write %d "
"blocks in inode table starting at %llu: %s\n"),
- num, blk, error_message(retval));
+ num, (unsigned long long) blk,
+ error_message(retval));
exit(1);
}
}
com_err("create_journal_dev", retval,
_("while zeroing journal device "
"(block %llu, count %d)"),
- err_blk, err_count);
+ (unsigned long long) err_blk, err_count);
exit(1);
}
blk += c;
if (!verbose) {
printf(_("Creating filesystem with %llu %dk blocks and "
"%u inodes\n"),
- ext2fs_blocks_count(s), fs->blocksize >> 10,
- s->s_inodes_count);
+ (unsigned long long) ext2fs_blocks_count(s),
+ fs->blocksize >> 10, s->s_inodes_count);
goto skip_details;
}
if (ext2fs_blocks_count(&fs_param) != ext2fs_blocks_count(s))
fprintf(stderr, _("warning: %llu blocks unused.\n\n"),
- ext2fs_blocks_count(&fs_param) - ext2fs_blocks_count(s));
+ (unsigned long long) (ext2fs_blocks_count(&fs_param) -
+ ext2fs_blocks_count(s)));
printf(_("Filesystem label=%.*s\n"), EXT2_LEN_STR(s->s_volume_name));
printf(_("Stride=%u blocks, Stripe width=%u blocks\n"),
s->s_raid_stride, s->s_raid_stripe_width);
printf(_("%u inodes, %llu blocks\n"), s->s_inodes_count,
- ext2fs_blocks_count(s));
+ (unsigned long long) ext2fs_blocks_count(s));
printf(_("%llu blocks (%2.2f%%) reserved for the super user\n"),
- ext2fs_r_blocks_count(s),
+ (unsigned long long) ext2fs_r_blocks_count(s),
100.0 * ext2fs_r_blocks_count(s) / ext2fs_blocks_count(s));
printf(_("First data block=%u\n"), s->s_first_data_block);
if (root_uid != 0 || root_gid != 0)
col_left = 72;
}
col_left -= need;
- printf("%llu", group_block);
+ printf("%llu", (unsigned long long) group_block);
}
printf("\n\n");
}
fprintf(stderr, _("%s: Size of device (0x%llx blocks) %s "
"too big to be expressed\n\t"
"in 32 bits using a blocksize of %d.\n"),
- program_name, fs_blocks_count, device_name,
- EXT2_BLOCK_SIZE(&fs_param));
+ program_name, (unsigned long long) fs_blocks_count,
+ device_name, EXT2_BLOCK_SIZE(&fs_param));
exit(1);
}
/*
fprintf(stderr, _("%s: Size of device (0x%llx blocks) %s "
"too big to create\n\t"
"a filesystem using a blocksize of %d.\n"),
- program_name, fs_blocks_count, device_name,
- EXT2_BLOCK_SIZE(&fs_param));
+ program_name, (unsigned long long) fs_blocks_count,
+ device_name, EXT2_BLOCK_SIZE(&fs_param));
exit(1);
}
else {
com_err(program_name, 0,
_("too many inodes (%llu), raise "
- "inode ratio?"), n);
+ "inode ratio?"),
+ (unsigned long long) n);
exit(1);
}
}
} else if (num_inodes > MAX_32_NUM) {
com_err(program_name, 0,
_("too many inodes (%llu), specify < 2^32 inodes"),
- num_inodes);
+ (unsigned long long) num_inodes);
exit(1);
}
/*
32768 : fs->blocksize * 8);
io_channel_set_options(fs->io, opt_string);
if (offset) {
- sprintf(opt_string, "offset=%llu", offset);
+ sprintf(opt_string, "offset=%llu", (unsigned long long) offset);
io_channel_set_options(fs->io, opt_string);
}
if (retval) {
com_err(program_name, retval,
_("while zeroing block %llu at end of filesystem"),
- ret_blk);
+ (unsigned long long) ret_blk);
}
write_inode_tables(fs, lazy_itable_init, itable_zeroed);
create_root_dir(fs);
ext2fs_blocks_count(sb) / 100.0);
ext2fs_mark_super_dirty(fs);
printf (_("Setting reserved blocks percentage to %g%% (%llu blocks)\n"),
- reserved_ratio, ext2fs_r_blocks_count(sb));
+ reserved_ratio,
+ (unsigned long long) ext2fs_r_blocks_count(sb));
}
if (r_flag) {
if (reserved_blocks > ext2fs_blocks_count(sb)/2) {
com_err(program_name, 0,
_("reserved blocks count is too big (%llu)"),
- reserved_blocks);
+ (unsigned long long) reserved_blocks);
rc = 1;
goto closefs;
}
ext2fs_r_blocks_count_set(sb, reserved_blocks);
ext2fs_mark_super_dirty(fs);
printf(_("Setting reserved blocks count to %llu\n"),
- reserved_blocks);
+ (unsigned long long) reserved_blocks);
}
if (s_flag == 1) {
if (ext2fs_has_feature_sparse_super(sb)) {
fputs(_("# Extent dump:\n"), out);
fprintf(out, _("#\tNum=%llu, Size=%llu, Cursor=%llu, Sorted=%llu\n"),
- extent->num, extent->size, extent->cursor, extent->sorted);
+ (unsigned long long) extent->num,
+ (unsigned long long) extent->size,
+ (unsigned long long) extent->cursor,
+ (unsigned long long) extent->sorted);
for (i=0, ent=extent->list; i < extent->num; i++, ent++) {
- fprintf(out, "#\t\t %llu -> %llu (%llu)\n", ent->old_loc,
- ent->new_loc, ent->size);
+ fprintf(out, "#\t\t %llu -> %llu (%llu)\n",
+ (unsigned long long) ent->old_loc,
+ (unsigned long long) ent->new_loc,
+ (unsigned long long) ent->size);
}
}
if (print_min_size) {
printf(_("Estimated minimum size of the filesystem: %llu\n"),
- min_size);
+ (unsigned long long) min_size);
exit(0);
}
if (!force && new_size < min_size) {
com_err(program_name, 0,
- _("New size smaller than minimum (%llu)\n"), min_size);
+ _("New size smaller than minimum (%llu)\n"),
+ (unsigned long long) min_size);
exit(1);
}
if (use_stride >= 0) {
if (!force && (new_size > max_size)) {
fprintf(stderr, _("The containing partition (or device)"
" is only %llu (%dk) blocks.\nYou requested a new size"
- " of %llu blocks.\n\n"), max_size,
- blocksize / 1024, new_size);
+ " of %llu blocks.\n\n"), (unsigned long long) max_size,
+ blocksize / 1024, (unsigned long long) new_size);
exit(1);
}
if ((flags & RESIZE_DISABLE_64BIT) && (flags & RESIZE_ENABLE_64BIT)) {
}
} else if (new_size == ext2fs_blocks_count(fs->super)) {
fprintf(stderr, _("The filesystem is already %llu (%dk) "
- "blocks long. Nothing to do!\n\n"), new_size,
+ "blocks long. Nothing to do!\n\n"),
+ (unsigned long long) new_size,
blocksize / 1024);
exit(0);
}
else
printf(_("Resizing the filesystem on "
"%s to %llu (%dk) blocks.\n"),
- device_name, new_size, blocksize / 1024);
+ device_name, (unsigned long long) new_size,
+ blocksize / 1024);
retval = resize_fs(fs, &new_size, flags,
((flags & RESIZE_PERCENT_COMPLETE) ?
resize_progress_func : 0));
exit(1);
}
printf(_("The filesystem on %s is now %llu (%dk) blocks long.\n\n"),
- device_name, new_size, blocksize / 1024);
+ device_name, (unsigned long long) new_size, blocksize / 1024);
if ((st_buf.st_size > new_file_size) &&
(fd > 0)) {
}
printf(_("Performing an on-line resize of %s to %llu (%dk) blocks.\n"),
- fs->device_name, *new_size, fs->blocksize / 1024);
+ fs->device_name, (unsigned long long) *new_size,
+ fs->blocksize / 1024);
size = fs->group_desc_count * sb->s_blocks_per_group +
sb->s_first_data_block;
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_BMOVE)
printf("Number of free blocks: %llu/%llu, Needed: %llu\n",
- ext2fs_free_blocks_count(rfs->old_fs->super),
- ext2fs_free_blocks_count(rfs->new_fs->super),
- rfs->needed_blocks);
+ (unsigned long long) ext2fs_free_blocks_count(rfs->old_fs->super),
+ (unsigned long long) ext2fs_free_blocks_count(rfs->new_fs->super),
+ (unsigned long long) rfs->needed_blocks);
#endif
init_resource_track(&rtrack, "block_mover", fs->io);
new_inodes =(unsigned long long) fs->super->s_inodes_per_group * fs->group_desc_count;
if (new_inodes > ~0U) {
fprintf(stderr, _("inodes (%llu) must be less than %u\n"),
- new_inodes, ~0U);
+ (unsigned long long) new_inodes, ~0U);
return EXT2_ET_TOO_MANY_INODES;
}
fs->super->s_inodes_count = fs->super->s_inodes_per_group *
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & 0xF)
- printf("get_alloc_block allocating %llu\n", blk);
+ printf("get_alloc_block allocating %llu\n",
+ (unsigned long long) blk);
#endif
ext2fs_mark_block_bitmap2(rfs->old_fs->block_map, blk);
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_BMOVE)
printf("Moving %llu blocks %llu->%llu\n",
- size, old_blk, new_blk);
+ (unsigned long long) size,
+ (unsigned long long) old_blk,
+ (unsigned long long) new_blk);
#endif
do {
c = size;
#ifdef RESIZE2FS_DEBUG
if (pb->rfs->flags & RESIZE_DEBUG_BMOVE)
printf("ino=%u, blockcnt=%lld, %llu->%llu\n",
- pb->old_ino, blockcnt, block,
- new_block);
+ pb->old_ino, (long long) blockcnt,
+ (unsigned long long) block,
+ (unsigned long long) new_block);
#endif
block = new_block;
}
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_ITABLEMOVE)
printf("Itable move group %d block %llu->%llu (diff %lld)\n",
- i, old_blk, new_blk, diff);
+ i, (unsigned long long) old_blk,
+ (unsigned long long) new_blk, diff);
#endif
if (!diff)
}
#ifdef RESIZE2FS_DEBUG
if (flags & RESIZE_DEBUG_MIN_CALC)
- printf("fs requires %llu data blocks.\n", data_needed);
+ printf("fs requires %llu data blocks.\n",
+ (unsigned long long) data_needed);
#endif
/*
#ifdef RESIZE2FS_DEBUG
if (flags & RESIZE_DEBUG_MIN_CALC)
printf("With %d group(s), we have %llu blocks available.\n",
- groups, data_blocks);
+ groups, (unsigned long long) data_blocks);
#endif
/*
if (flags & RESIZE_DEBUG_MIN_CALC)
printf("Added %d extra group(s), "
"blks_needed %llu, data_blocks %llu, "
- "last_start %llu\n", extra_grps, blks_needed,
- data_blocks, last_start);
+ "last_start %llu\n", extra_grps,
+ (unsigned long long) blks_needed,
+ (unsigned long long) data_blocks,
+ (unsigned long long) last_start);
#endif
}
#ifdef RESIZE2FS_DEBUG
if (flags & RESIZE_DEBUG_MIN_CALC)
- printf("Last group's overhead is %llu\n", overhead);
+ printf("Last group's overhead is %llu\n",
+ (unsigned long long) overhead);
#endif
/*
#ifdef RESIZE2FS_DEBUG
if (flags & RESIZE_DEBUG_MIN_CALC)
printf("Need %llu data blocks in last group\n",
- remainder);
+ (unsigned long long) remainder);
#endif
/*
* 50 is a magic number that mkfs/resize uses to see if its
overhead += fs->super->s_first_data_block;
#ifdef RESIZE2FS_DEBUG
if (flags & RESIZE_DEBUG_MIN_CALC)
- printf("Final size of last group is %lld\n", overhead);
+ printf("Final size of last group is %llu\n",
+ (unsigned long long) overhead);
#endif
/* Add extra slack for bigalloc file systems */
#ifdef RESIZE2FS_DEBUG
if (flags & RESIZE_DEBUG_MIN_CALC)
- printf("Estimated blocks needed: %llu\n", blks_needed);
+ printf("Estimated blocks needed: %llu\n",
+ (unsigned long long) blks_needed);
#endif
/*
#ifdef RESIZE2FS_DEBUG
if (flags & RESIZE_DEBUG_MIN_CALC)
- printf("Extents safety margin: %llu\n", safe_margin);
+ printf("Extents safety margin: %llu\n",
+ (unsigned long long) safe_margin);
#endif
blks_needed += safe_margin;
}
goto handle_error;
} else if (!strcmp(cmd, "lookup")) {
num2 = ext2fs_extent_translate(extent, num1);
- fprintf(out, "# Answer: %llu%s\n", num2,
+ fprintf(out, "# Answer: %llu%s\n",
+ (unsigned long long) num2,
num2 ? "" : " (not found)");
} else if (!strcmp(cmd, "dump")) {
ext2fs_extent_dump(extent, out);
if (!size)
break;
fprintf(out, "# %llu -> %llu (%llu)\n",
- num1, num2, size);
+ (unsigned long long) num1,
+ (unsigned long long) num2,
+ (unsigned long long) size);
}
} else
fputs("# Syntax error\n", out);