summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2013-11-10 21:47:02 +0100
committerBernhard Reutner-Fischer2013-11-10 21:47:02 +0100
commit5e63776212f8fab4fba08ab2b99dd5241f0c3880 (patch)
tree16e445bd45cec7fe6e58cd0e383d6a00637316b9 /util-linux
parentb1489f97e0670fed7d450bae86a3aae38bc9156b (diff)
downloadbusybox-5e63776212f8fab4fba08ab2b99dd5241f0c3880.zip
busybox-5e63776212f8fab4fba08ab2b99dd5241f0c3880.tar.gz
fstrim: Needs to fire at the mp, not bd
It's a filesystem thing from this perspective. +1b Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fstrim.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util-linux/fstrim.c b/util-linux/fstrim.c
index 84a6410..4d90fa7 100644
--- a/util-linux/fstrim.c
+++ b/util-linux/fstrim.c
@@ -60,7 +60,7 @@ int fstrim_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int fstrim_main(int argc UNUSED_PARAM, char **argv)
{
struct fstrim_range range;
- char *arg_o, *arg_l, *arg_m, *bd;
+ char *arg_o, *arg_l, *arg_m, *mp;
unsigned opts;
int fd;
@@ -94,15 +94,15 @@ int fstrim_main(int argc UNUSED_PARAM, char **argv)
if (opts & OPT_m)
range.minlen = xatoull_sfx(arg_m, fstrim_sfx);
- bd = find_block_device(*(argv += optind));
- if (bd) {
- fd = xopen_nonblocking(bd);
+ mp = *(argv += optind);
+ if (find_block_device(mp)) {
+ fd = xopen_nonblocking(mp);
xioctl(fd, FITRIM, &range);
if (ENABLE_FEATURE_CLEAN_UP)
close(fd);
if (opts & OPT_v)
- printf("%s: %llu bytes were trimmed\n", bd, range.len);
+ printf("%s: %llu bytes were trimmed\n", mp, range.len);
return EXIT_SUCCESS;
}
return EXIT_FAILURE;