#include <ext2fs/fiemap.h>
int verbose = 0;
- int blocksize; /* Use specified blocksize (default 1kB) */
+ unsigned int blocksize; /* Use specified blocksize (default 1kB) */
int sync_file = 0; /* fsync file before getting the mapping */
+int precache_file = 0; /* precache the file before getting the mapping */
int xattr_map = 0; /* get xattr mapping */
int force_bmap; /* force use of FIBMAP instead of FIEMAP */
int force_extent; /* print output in extent format always */
numblocks = (st.st_size + blksize - 1) / blksize;
if (blocksize != 0)
- blk_shift = int_log2(blocksize);
+ blk_shift = ulong_log2(blocksize);
else
- blk_shift = int_log2(blksize);
+ blk_shift = ulong_log2(blksize);
- width = ulong_log10(numblocks);
+ if (use_extent_cache)
+ width = 10;
+ else
- width = int_log10(numblocks);
++ width = ulong_log10(numblocks);
if (width > logical_width)
logical_width = width;
- if (verbose)
- printf("File size of %s is %llu (%llu block%s of %d bytes)\n",
+ if (verbose) {
+ __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,
numblocks == 1 ? "" : "s", 1 << blk_shift);
static void usage(const char *progname)
{
- fprintf(stderr, "Usage: %s [-b{blocksize}] [-BeEksvxX] file ...\n",
- fprintf(stderr, "Usage: %s [-b{blocksize}[KMG]] [-BeksvxX] file ...\n",
++ fprintf(stderr, "Usage: %s [-b{blocksize}[KMG]] [-BeEksvxX] file ...\n",
progname);
exit(1);
}