+2005-07-05 Theodore Ts'o <tytso@mit.edu>
+
+ * tune2fs.c, mke2fs.c: Allow fractional percentages when
+ specifying the reserved ratio. (Addresses Debian Bug
+ #80205).
+
2006-06-30 Theodore Ts'o <tytso@mit.edu>
* Release of E2fsprogs 1.38
int blocksize = 0;
int inode_ratio = 0;
int inode_size = 0;
- int reserved_ratio = 5;
+ double reserved_ratio = 5.0;
int sector_size = 0;
int show_version_only = 0;
ext2_ino_t num_inodes = 0;
strcpy(bad_blocks_filename, optarg);
break;
case 'm':
- reserved_ratio = strtoul(optarg, &tmp, 0);
+ reserved_ratio = strtod(optarg, &tmp);
if (reserved_ratio > 50 || *tmp) {
com_err(program_name, 0,
_("invalid reserved blocks percent - %s"),
static time_t last_check_time;
static int print_label;
static int max_mount_count, mount_count, mount_flags;
-static unsigned long interval, reserved_ratio, reserved_blocks;
+static unsigned long interval, reserved_blocks;
+static double reserved_ratio;
static unsigned long resgid, resuid;
static unsigned short errors;
static int open_flag;
EXT2_FLAG_JOURNAL_DEV_OK;
break;
case 'm':
- reserved_ratio = strtoul (optarg, &tmp, 0);
+ reserved_ratio = strtod(optarg, &tmp);
if (*tmp || reserved_ratio > 50) {
com_err (program_name, 0,
_("bad reserved block ratio - %s"),
printf (_("Setting interval between checks to %lu seconds\n"), interval);
}
if (m_flag) {
- sb->s_r_blocks_count = (sb->s_blocks_count / 100)
- * reserved_ratio;
+ sb->s_r_blocks_count = sb->s_blocks_count * reserved_ratio /100;
ext2fs_mark_super_dirty(fs);
- printf (_("Setting reserved blocks percentage to %lu (%u blocks)\n"),
+ printf (_("Setting reserved blocks percentage to %g%% (%u blocks)\n"),
reserved_ratio, sb->s_r_blocks_count);
}
if (r_flag) {