# include "fsmap.h"
#endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
static void usage(const char *prog)
{
fprintf(stderr, "usage: %s [-c chunksize in kb] [-h] "
int mount_flags;
int fd;
int ret;
- int i;
+ unsigned int i;
/* Try to open the mountpoint for a live query. */
retval = ext2fs_check_mount_point(fs->device_name, &mount_flags,
com_err(fs->device_name, retval, "while checking mount status");
return 0;
}
- if (!mount_flags & EXT2_MF_MOUNTED)
+ if (!(mount_flags & EXT2_MF_MOUNTED))
return 0;
fd = open(mntpoint, O_RDONLY);
if (fd < 0) {
unsigned long start = 0, end;
int i, retval = 0;
- fprintf(f, "Total blocks: %llu\nFree blocks: %u (%0.1f%%)\n",
- ext2fs_blocks_count(fs->super), fs->super->s_free_blocks_count,
- (double)fs->super->s_free_blocks_count * 100 /
+ fprintf(f, "Total blocks: %llu\nFree blocks: %llu (%0.1f%%)\n",
+ ext2fs_blocks_count(fs->super),
+ ext2fs_free_blocks_count(fs->super),
+ (double)ext2fs_free_blocks_count(fs->super) * 100 /
ext2fs_blocks_count(fs->super));
if (info->chunkbytes) {
info->histogram.fc_chunks[i],
info->histogram.fc_blocks[i],
(double)info->histogram.fc_blocks[i] * 100 /
- fs->super->s_free_blocks_count);
+ ext2fs_free_blocks_count(fs->super));
}
start = end;
if (start == 1<<10) {