/*
- * zramctl - purpose of it
+ * zramctl - control compressed block devices in RAM
*
* Copyright (c) 2014 Timofey Titovets <Nefelim4ag@gmail.com>
* Copyright (C) 2014 Karel Zak <kzak@redhat.com>
static const struct colinfo infos[] = {
[COL_NAME] = { "NAME", 0.25, 0, N_("zram device name") },
- [COL_DISKSIZE] = { "DISKSIZE", 5, SCOLS_FL_RIGHT, N_("limit on the uncompressed worth of data") },
+ [COL_DISKSIZE] = { "DISKSIZE", 5, SCOLS_FL_RIGHT, N_("limit on the uncompressed amount of data") },
[COL_ORIG_SIZE] = { "DATA", 5, SCOLS_FL_RIGHT, N_("uncompressed size of stored data") },
[COL_COMP_SIZE] = { "COMPR", 5, SCOLS_FL_RIGHT, N_("compressed size of stored data") },
- [COL_ALGORITHM] = { "ALGORITHM", 3, 0, N_("selected compression algorithms") },
+ [COL_ALGORITHM] = { "ALGORITHM", 3, 0, N_("the selected compression algorithm") },
[COL_STREAMS] = { "STREAMS", 3, SCOLS_FL_RIGHT, N_("number of concurrent compress operations") },
[COL_ZEROPAGES] = { "ZERO-PAGES", 3, SCOLS_FL_RIGHT, N_("empty pages with no allocated memory") },
[COL_MEMTOTAL] = { "TOTAL", 5, SCOLS_FL_RIGHT, N_("all memory including allocator fragmentation and metadata overhead") },
[COL_MOUNTPOINT]= { "MOUNTPOINT",0.10, SCOLS_FL_TRUNC, N_("where the device is mounted") },
-
};
static int columns[ARRAY_SIZE(infos) * 2] = {-1};
fputs(USAGE_HEADER, out);
fprintf(out, _( " %1$s [options] <device>\n"
- " %1$s -r <device> [...]\n"
+ " %1$s -r <device> [...]\n"
" %1$s [options] -f | <device> -s <size>\n"),
program_invocation_short_name);
fputs(USAGE_OPTIONS, out);
- fputs(_(" -a, --algorithm <lzo|lz4> compression algorithm\n"), out);
+ fputs(_(" -a, --algorithm lzo|lz4 compression algorithm to use\n"), out);
fputs(_(" -b, --bytes print sizes in bytes rather than in human readable format\n"), out);
- fputs(_(" -f, --find find free device\n"), out);
+ fputs(_(" -f, --find find a free device\n"), out);
fputs(_(" -n, --noheadings don't print headings\n"), out);
fputs(_(" -o, --output <list> columns to use for status output\n"), out);
+ fputs(_(" --raw use raw status output format\n"), out);
fputs(_(" -r, --reset reset all specified devices\n"), out);
fputs(_(" -s, --size <size> device size\n"), out);
- fputs(_(" --raw use raw status output format\n"), out);
fputs(_(" -t, --streams <number> number of compressoin streams\n\n"), out);
fputs(USAGE_SEPARATOR, out);
static const struct option longopts[] = {
{ "algorithm", required_argument, NULL, 'a' },
+ { "bytes", no_argument, NULL, 'b' },
{ "find", no_argument, NULL, 'f' },
{ "help", no_argument, NULL, 'h' },
- { "bytes", no_argument, NULL, 'b' },
{ "output", required_argument, NULL, 'o' },
{ "noheadings",no_argument, NULL, 'n' },
{ "reset", no_argument, NULL, 'r' },
if (find && optind < argc)
errx(EXIT_FAILURE, _("option --find is mutually exclusive "
- "with <device>."));
+ "with <device>"));
if (act == A_NONE)
act = find ? A_FINDONLY : A_STATUS;
case A_STATUS:
if (algorithm || find || nstreams)
errx(EXIT_FAILURE, _("options --algorithm, --find and "
- "--streams are mutually exclusive."));
+ "--streams are mutually exclusive"));
if (!ncolumns) { /* default columns */
columns[ncolumns++] = COL_NAME;
columns[ncolumns++] = COL_ALGORITHM;
case A_FINDONLY:
zram = find_free_zram();
if (!zram)
- errx(EXIT_FAILURE, _("no found free zram device"));
+ errx(EXIT_FAILURE, _("no free zram device found"));
printf("%s\n", zram->devname);
free_zram(zram);
break;
if (find) {
zram = find_free_zram();
if (!zram)
- errx(EXIT_FAILURE, _("no found free zram device"));
+ errx(EXIT_FAILURE, _("no free zram device found"));
} else if (optind == argc)
errx(EXIT_FAILURE, _("no device specified"));
else