diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-10 00:20:05 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-10 00:20:05 +0200 |
commit | c421388dcaa6adba9f2f7cda3be4537daa466355 (patch) | |
tree | 2ba7debd2b4129cbf37ec0459669aa13360c0bc6 | |
parent | 0599e0f87bcaa4b9f91652fa53bc29a3bdacfa13 (diff) | |
download | busybox-w32-c421388dcaa6adba9f2f7cda3be4537daa466355.tar.gz busybox-w32-c421388dcaa6adba9f2f7cda3be4537daa466355.tar.bz2 busybox-w32-c421388dcaa6adba9f2f7cda3be4537daa466355.zip |
blkdiscard: accept -f (force) as no-op
function old new delta
.rodata 104250 104251 +1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | util-linux/blkdiscard.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/util-linux/blkdiscard.c b/util-linux/blkdiscard.c index ff2101ed0..7ac8045f9 100644 --- a/util-linux/blkdiscard.c +++ b/util-linux/blkdiscard.c | |||
@@ -18,10 +18,12 @@ | |||
18 | //usage:#define blkdiscard_trivial_usage | 18 | //usage:#define blkdiscard_trivial_usage |
19 | //usage: "[-o OFS] [-l LEN] [-s] DEVICE" | 19 | //usage: "[-o OFS] [-l LEN] [-s] DEVICE" |
20 | //usage:#define blkdiscard_full_usage "\n\n" | 20 | //usage:#define blkdiscard_full_usage "\n\n" |
21 | //usage: "Discard sectors on DEVICE\n" | 21 | //usage: "Discard sectors on DEVICE\n" |
22 | //usage: "\n -o OFS Byte offset into device" | 22 | //usage: "\n -o OFS Byte offset into device" |
23 | //usage: "\n -l LEN Number of bytes to discard" | 23 | //usage: "\n -l LEN Number of bytes to discard" |
24 | //usage: "\n -s Perform a secure discard" | 24 | //usage: "\n -s Perform a secure discard" |
25 | ///////: "\n -f Disable check for mounted filesystem" | ||
26 | //////////////// -f: accepted but is a nop (we do no check anyway) | ||
25 | //usage: | 27 | //usage: |
26 | //usage:#define blkdiscard_example_usage | 28 | //usage:#define blkdiscard_example_usage |
27 | //usage: "$ blkdiscard -o 0 -l 1G /dev/sdb" | 29 | //usage: "$ blkdiscard -o 0 -l 1G /dev/sdb" |
@@ -51,9 +53,10 @@ int blkdiscard_main(int argc UNUSED_PARAM, char **argv) | |||
51 | OPT_OFFSET = (1 << 0), | 53 | OPT_OFFSET = (1 << 0), |
52 | OPT_LENGTH = (1 << 1), | 54 | OPT_LENGTH = (1 << 1), |
53 | OPT_SECURE = (1 << 2), | 55 | OPT_SECURE = (1 << 2), |
56 | OPT_FORCE = (1 << 3), //nop | ||
54 | }; | 57 | }; |
55 | 58 | ||
56 | opts = getopt32(argv, "^" "o:l:s" "\0" "=1", &offset_str, &length_str); | 59 | opts = getopt32(argv, "^" "o:l:sf" "\0" "=1", &offset_str, &length_str); |
57 | argv += optind; | 60 | argv += optind; |
58 | 61 | ||
59 | fd = xopen(argv[0], O_RDWR|O_EXCL); | 62 | fd = xopen(argv[0], O_RDWR|O_EXCL); |