#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <libgen.h>
#include <unistd.h>
if (verbose) {
printf("Found filesystem with parameters:\n");
- printf(" Size: %llu\n", info.len);
+ printf(" Size: %"PRIu64"\n", info.len);
printf(" Block size: %d\n", info.block_size);
printf(" Blocks per group: %d\n", info.blocks_per_group);
printf(" Inodes per group: %d\n", info.inodes_per_group);
printf(" Inode size: %d\n", info.inode_size);
printf(" Label: %s\n", info.label);
- printf(" Blocks: %llu\n", aux_info.len_blocks);
+ printf(" Blocks: %"PRIu64"\n", aux_info.len_blocks);
printf(" Block groups: %d\n", aux_info.groups);
printf(" Reserved block group size: %d\n", info.bg_desc_reserve_blocks);
printf(" Used %d/%d inodes and %d/%d blocks\n",
#define le32_to_cpu(x) (x)
#define le16_to_cpu(x) (x)
+#ifdef __LP64__
+typedef unsigned long u64;
+typedef signed long s64;
+#else
typedef unsigned long long u64;
typedef signed long long s64;
+#endif
typedef unsigned int u32;
typedef unsigned short int u16;
typedef unsigned char u8;
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <unistd.h>
#ifndef USE_MINGW
if (verbose) {
printf("Found filesystem with parameters:\n");
- printf(" Size: %llu\n", info.len);
+ printf(" Size: %"PRIu64"\n", info.len);
printf(" Block size: %d\n", info.block_size);
printf(" Blocks per group: %d\n", info.blocks_per_group);
printf(" Inodes per group: %d\n", info.inodes_per_group);
printf(" Inode size: %d\n", info.inode_size);
printf(" Label: %s\n", info.label);
- printf(" Blocks: %llu\n", aux_info.len_blocks);
+ printf(" Blocks: %"PRIu64"\n", aux_info.len_blocks);
printf(" Block groups: %d\n", aux_info.groups);
printf(" Reserved block group size: %d\n", info.bg_desc_reserve_blocks);
printf(" Used %d/%d inodes and %d/%d blocks\n",
#include <sparse/sparse.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
if (((int)(info.block_size - sizeof(struct ext4_extent_header) /
sizeof(struct ext4_extent))) < allocation_len) {
- error("File size %llu is too big to fit in a single extent block\n",
+ error("File size %"PRIu64" is too big to fit in a single extent block\n",
len);
return NULL;
}
alloc = do_inode_allocate_extents(inode, len);
if (alloc == NULL) {
- error("failed to allocate extents for %llu bytes", len);
+ error("failed to allocate extents for %"PRIu64" bytes", len);
return NULL;
}
if (backing_len) {
data = extent_create_backing(alloc, backing_len);
if (!data)
- error("failed to create backing for %llu bytes", backing_len);
+ error("failed to create backing for %"PRIu64" bytes", backing_len);
}
free_alloc(alloc);
alloc = do_inode_allocate_extents(inode, len);
if (alloc == NULL) {
- error("failed to allocate extents for %llu bytes", len);
+ error("failed to allocate extents for %"PRIu64" bytes", len);
return;
}
alloc = do_inode_allocate_extents(inode, len);
if (alloc == NULL) {
- error("failed to allocate extents for %llu bytes", len);
+ error("failed to allocate extents for %"PRIu64" bytes", len);
return;
}
#include <assert.h>
#include <dirent.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
info.bg_desc_reserve_blocks = compute_bg_desc_reserve_blocks();
printf("Creating filesystem with parameters:\n");
- printf(" Size: %llu\n", info.len);
+ printf(" Size: %"PRIu64"\n", info.len);
printf(" Block size: %d\n", info.block_size);
printf(" Blocks per group: %d\n", info.blocks_per_group);
printf(" Inodes per group: %d\n", info.inodes_per_group);
ext4_create_fs_aux_info();
- printf(" Blocks: %llu\n", aux_info.len_blocks);
+ printf(" Blocks: %"PRIu64"\n", aux_info.len_blocks);
printf(" Block groups: %d\n", aux_info.groups);
printf(" Reserved block group size: %d\n", info.bg_desc_reserve_blocks);