diff options
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/fstrim.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/util-linux/fstrim.c b/util-linux/fstrim.c index 51400ef0b..fc51878b6 100644 --- a/util-linux/fstrim.c +++ b/util-linux/fstrim.c | |||
| @@ -47,25 +47,6 @@ struct fstrim_range { | |||
| 47 | #define FITRIM _IOWR('X', 121, struct fstrim_range) | 47 | #define FITRIM _IOWR('X', 121, struct fstrim_range) |
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
| 50 | static const struct suffix_mult fstrim_sfx[] = { | ||
| 51 | { "KiB", 1024 }, | ||
| 52 | { "kiB", 1024 }, | ||
| 53 | { "K", 1024 }, | ||
| 54 | { "k", 1024 }, | ||
| 55 | { "MiB", 1048576 }, | ||
| 56 | { "miB", 1048576 }, | ||
| 57 | { "M", 1048576 }, | ||
| 58 | { "m", 1048576 }, | ||
| 59 | { "GiB", 1073741824 }, | ||
| 60 | { "giB", 1073741824 }, | ||
| 61 | { "G", 1073741824 }, | ||
| 62 | { "g", 1073741824 }, | ||
| 63 | { "KB", 1000 }, | ||
| 64 | { "MB", 1000000 }, | ||
| 65 | { "GB", 1000000000 }, | ||
| 66 | { "", 0 } | ||
| 67 | }; | ||
| 68 | |||
| 69 | int fstrim_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 50 | int fstrim_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 70 | int fstrim_main(int argc UNUSED_PARAM, char **argv) | 51 | int fstrim_main(int argc UNUSED_PARAM, char **argv) |
| 71 | { | 52 | { |
| @@ -98,11 +79,11 @@ int fstrim_main(int argc UNUSED_PARAM, char **argv) | |||
| 98 | range.len = ULLONG_MAX; | 79 | range.len = ULLONG_MAX; |
| 99 | 80 | ||
| 100 | if (opts & OPT_o) | 81 | if (opts & OPT_o) |
| 101 | range.start = xatoull_sfx(arg_o, fstrim_sfx); | 82 | range.start = xatoull_sfx(arg_o, kmg_i_suffixes); |
| 102 | if (opts & OPT_l) | 83 | if (opts & OPT_l) |
| 103 | range.len = xatoull_sfx(arg_l, fstrim_sfx); | 84 | range.len = xatoull_sfx(arg_l, kmg_i_suffixes); |
| 104 | if (opts & OPT_m) | 85 | if (opts & OPT_m) |
| 105 | range.minlen = xatoull_sfx(arg_m, fstrim_sfx); | 86 | range.minlen = xatoull_sfx(arg_m, kmg_i_suffixes); |
| 106 | 87 | ||
| 107 | mp = argv[optind]; | 88 | mp = argv[optind]; |
| 108 | if (find_block_device(mp)) { | 89 | if (find_block_device(mp)) { |
