diff options
author | kib <kib@FreeBSD.org> | 2010-12-29 12:31:18 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-12-29 12:31:18 +0000 |
commit | d69a17ac0a884f83a0d321fb56d071796e6a1568 (patch) | |
tree | 8ab612371e7500ee1c3bac44a09208490c294417 /sbin/newfs/newfs.c | |
parent | 17dccd1898b6a0ddd49fcd77d7314ddc494cbac8 (diff) | |
download | FreeBSD-src-d69a17ac0a884f83a0d321fb56d071796e6a1568.zip FreeBSD-src-d69a17ac0a884f83a0d321fb56d071796e6a1568.tar.gz |
Add support for FS_TRIM to user-mode UFS utilities.
Reviewed by: mckusick, pjd, pho
Tested by: pho
MFC after: 1 month
Diffstat (limited to 'sbin/newfs/newfs.c')
-rw-r--r-- | sbin/newfs/newfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index b66e1ec..0e5b7da 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -91,6 +91,7 @@ int Xflag = 0; /* exit in middle of newfs for testing */ int Jflag; /* enable gjournal for file system */ int lflag; /* enable multilabel for file system */ int nflag; /* do not create .snap directory */ +int tflag; /* enable TRIM */ intmax_t fssize; /* file system size */ int sectorsize; /* bytes/sector */ int realsectorsize; /* bytes/sector in hardware */ @@ -139,7 +140,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:t")) != -1) switch (ch) { case 'E': Eflag = 1; @@ -279,6 +280,9 @@ main(int argc, char *argv[]) *cp != '\0' || fssize < 0) errx(1, "%s: bad file system size", optarg); break; + case 't': + tflag = 1; + break; case '?': default: usage(); @@ -495,6 +499,7 @@ usage() fprintf(stderr, "\t-p partition name (a..h)\n"); fprintf(stderr, "\t-r reserved sectors at the end of device\n"); fprintf(stderr, "\t-s file system size (sectors)\n"); + fprintf(stderr, "\t-t enable TRIM\n"); exit(1); } |