# define LF3_SCAN_PROGRAM "lipe_scan3"
#endif
+#define LF3_SCAN_BLOCK_SIZE 512
+
static const char LF3_SCAN_COMMAND[] = LF3_SCAN_PROGRAM " --script=/dev/stdin";
static const char LF3_SCM_SCAN_PROC[] = "lipe-scan";
static char *lf3_policy_body;
char cmp;
__ull val;
__ull unit;
+ __ull tmp_val;
int rc;
/* @which should be "size" or "blocks"
if (rc < 0)
LF3_FATAL_AT(begin + 1, "invalid size '%s'\n", size_str);
+ /* When the "-blocks" option comes with a size "n[bkMG]", the size
+ * should be calculated correctly. */
+ if (strcmp(which, "blocks") == 0 && unit != 1 && unit != 2) {
+ tmp_val = val * (unit / LF3_SCAN_BLOCK_SIZE);
+ unit = LF3_SCAN_BLOCK_SIZE;
+ } else {
+ tmp_val = unit * val;
+ }
+
/* From find(1): The + and - prefixes signify greater than and
* less than, as usual; i.e., an exact size of n units does
* not match. Bear in mind that the size is rounded up to the
cmp,
which,
unit,
- unit * val);
+ tmp_val);
else
return xsprintf("(%c (round-up (%s) %llu) %llu)",
cmp,
which,
unit,
- unit * val);
+ tmp_val);
}
static const struct lf3_unit lf3_time_units[] = {