mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Allow to disable BIO_DELETE passthru in fstab for swap-on-geli devices by
passing 'notrim' option. PR: 198863 Submitted by: Matthew D. Fuller fullermd at over-yonder dot net
This commit is contained in:
parent
46e3447026
commit
445bda3f4f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286445
@ -313,7 +313,7 @@ static char *
|
|||||||
swap_on_geli_args(const char *mntops)
|
swap_on_geli_args(const char *mntops)
|
||||||
{
|
{
|
||||||
const char *aalgo, *ealgo, *keylen_str, *sectorsize_str;
|
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;
|
char *p, *args, *token, *string, *ops;
|
||||||
int argsize, pagesize;
|
int argsize, pagesize;
|
||||||
size_t pagesize_len;
|
size_t pagesize_len;
|
||||||
@ -321,7 +321,7 @@ swap_on_geli_args(const char *mntops)
|
|||||||
|
|
||||||
/* Use built-in defaults for geli(8). */
|
/* Use built-in defaults for geli(8). */
|
||||||
aalgo = ealgo = keylen_str = "";
|
aalgo = ealgo = keylen_str = "";
|
||||||
aflag = eflag = lflag = "";
|
aflag = eflag = lflag = Tflag = "";
|
||||||
|
|
||||||
/* We will always specify sectorsize. */
|
/* We will always specify sectorsize. */
|
||||||
sflag = " -s ";
|
sflag = " -s ";
|
||||||
@ -365,6 +365,8 @@ swap_on_geli_args(const char *mntops)
|
|||||||
free(ops);
|
free(ops);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
} else if ((p = strstr(token, "notrim")) == token) {
|
||||||
|
Tflag = " -T ";
|
||||||
} else if (strcmp(token, "sw") != 0) {
|
} else if (strcmp(token, "sw") != 0) {
|
||||||
warnx("Invalid option: %s", token);
|
warnx("Invalid option: %s", token);
|
||||||
free(ops);
|
free(ops);
|
||||||
@ -387,8 +389,8 @@ swap_on_geli_args(const char *mntops)
|
|||||||
sectorsize_str = p;
|
sectorsize_str = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
argsize = asprintf(&args, "%s%s%s%s%s%s%s%s -d",
|
argsize = asprintf(&args, "%s%s%s%s%s%s%s%s%s -d",
|
||||||
aflag, aalgo, eflag, ealgo, lflag, keylen_str,
|
aflag, aalgo, eflag, ealgo, lflag, keylen_str, Tflag,
|
||||||
sflag, sectorsize_str);
|
sflag, sectorsize_str);
|
||||||
|
|
||||||
free(ops);
|
free(ops);
|
||||||
|
@ -242,6 +242,7 @@ The
|
|||||||
.Dq ealgo ,
|
.Dq ealgo ,
|
||||||
.Dq aalgo ,
|
.Dq aalgo ,
|
||||||
.Dq keylen ,
|
.Dq keylen ,
|
||||||
|
.Dq notrim ,
|
||||||
and
|
and
|
||||||
.Dq sectorsize
|
.Dq sectorsize
|
||||||
options may be passed to control those
|
options may be passed to control those
|
||||||
|
Loading…
Reference in New Issue
Block a user