diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2015-08-08 09:57:38 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2015-08-08 09:57:38 +0000 |
commit | 445bda3f4f94cca4ff138ac04203aa0420be9126 (patch) | |
tree | 9d18ca62cd1c4a3beb0d5634d907f0f208030e8b /sbin | |
parent | 46e34470269793e5da58b001897e830a0f5de825 (diff) | |
download | src-test2-445bda3f4f94cca4ff138ac04203aa0420be9126.tar.gz src-test2-445bda3f4f94cca4ff138ac04203aa0420be9126.zip |
Notes
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/swapon/swapon.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index 033c40a8edac..ed9f5685b6bc 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -313,7 +313,7 @@ static char * swap_on_geli_args(const char *mntops) { const char *aalgo, *ealgo, *keylen_str, *sectorsize_str; - const char *aflag, *eflag, *lflag, *sflag; + const char *aflag, *eflag, *lflag, *Tflag, *sflag; char *p, *args, *token, *string, *ops; int argsize, pagesize; size_t pagesize_len; @@ -321,7 +321,7 @@ swap_on_geli_args(const char *mntops) /* Use built-in defaults for geli(8). */ aalgo = ealgo = keylen_str = ""; - aflag = eflag = lflag = ""; + aflag = eflag = lflag = Tflag = ""; /* We will always specify sectorsize. */ sflag = " -s "; @@ -365,6 +365,8 @@ swap_on_geli_args(const char *mntops) free(ops); return (NULL); } + } else if ((p = strstr(token, "notrim")) == token) { + Tflag = " -T "; } else if (strcmp(token, "sw") != 0) { warnx("Invalid option: %s", token); free(ops); @@ -387,8 +389,8 @@ swap_on_geli_args(const char *mntops) sectorsize_str = p; } - argsize = asprintf(&args, "%s%s%s%s%s%s%s%s -d", - aflag, aalgo, eflag, ealgo, lflag, keylen_str, + argsize = asprintf(&args, "%s%s%s%s%s%s%s%s%s -d", + aflag, aalgo, eflag, ealgo, lflag, keylen_str, Tflag, sflag, sectorsize_str); free(ops); |