#include <sys/statfs.h>
#include <sys/vfs.h>
+#include "../version.h"
+
/* A relatively new ioctl interface ... */
#ifndef EXT4_IOC_MOVE_EXT
#define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
int ret;
unsigned int flex_bg_num;
- /* Calcuate best extents count */
+ /* Calculate best extents count */
if (feature_incompat & EXT4_FEATURE_INCOMPAT_FLEX_BG) {
flex_bg_num = 1 << log_groups_per_flex;
ret = ((block_count - 1) /
goto out;
}
- /* Calcuate donor inode's continuous physical region */
+ /* Calculate donor inode's continuous physical region */
donor_physical_cnt = get_physical_count(donor_list_physical);
/* Change donor extent list from physical to logical */
int i, j, ret = 0;
int flags = FTW_PHYS | FTW_MOUNT;
int arg_type = -1;
+ int mount_dir_len = 0;
int success_flag = 0;
char dir_name[PATH_MAX + 1];
char dev_name[PATH_MAX + 1];
struct stat64 buf;
ext2_filsys fs = NULL;
+ printf("e4defrag %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE);
+
/* Parse arguments */
if (argc == 1)
goto out;
}
switch (arg_type) {
- int mount_dir_len = 0;
case DIRNAME:
if (!(mode_flag & STATISTIC))
strncat(lost_found_dir, "/lost+found",
PATH_MAX - strnlen(lost_found_dir, PATH_MAX));
- /* Not the case("e4defrag mount_piont_dir") */
+ /* Not the case("e4defrag mount_point_dir") */
if (dir_name[mount_dir_len] != '\0') {
/*
- * "e4defrag mount_piont_dir/lost+found"
- * or "e4defrag mount_piont_dir/lost+found/"
+ * "e4defrag mount_point_dir/lost+found"
+ * or "e4defrag mount_point_dir/lost+found/"
*/
if (strncmp(lost_found_dir, dir_name,
strnlen(lost_found_dir,
continue;
}
- /* "e4defrag mount_piont_dir/else_dir" */
+ /* "e4defrag mount_point_dir/else_dir" */
memset(lost_found_dir, 0, PATH_MAX + 1);
}
+ /* fall through */
case DEVNAME:
if (arg_type == DEVNAME) {
strncpy(lost_found_dir, dir_name,