Changeset View
Changeset View
Standalone View
Standalone View
sbin/mdconfig/mdconfig.c
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
" [-s size] [-S sectorsize] [-u unit] [-L label]\n" | " [-s size] [-S sectorsize] [-u unit] [-L label]\n" | ||||
" [-x sectors/track] [-y heads/cylinder]\n" | " [-x sectors/track] [-y heads/cylinder]\n" | ||||
" mdconfig -d -u unit [-o [no]force]\n" | " mdconfig -d -u unit [-o [no]force]\n" | ||||
" mdconfig -r -u unit -s size [-o [no]force]\n" | " mdconfig -r -u unit -s size [-o [no]force]\n" | ||||
" mdconfig -l [-v] [-n] [-f file] [-u unit]\n" | " mdconfig -l [-v] [-n] [-f file] [-u unit]\n" | ||||
" mdconfig file\n"); | " mdconfig file\n"); | ||||
fprintf(stderr, "\t\ttype = {malloc, vnode, swap}\n"); | fprintf(stderr, "\t\ttype = {malloc, vnode, swap}\n"); | ||||
fprintf(stderr, "\t\toption = {cache, cluster, compress, force,\n"); | fprintf(stderr, "\t\toption = {cache, cluster, compress, force,\n"); | ||||
fprintf(stderr, "\t\t readonly, reserve, ro, verify}\n"); | fprintf(stderr, "\t\t mustdealloc, readonly, reserve, ro,\n"); | ||||
fprintf(stderr, "\t\t verify}\n"); | |||||
markj: Keep them sorted? | |||||
fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n"); | fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n"); | ||||
fprintf(stderr, "\t\t %%dk (kB), %%dm (MB), %%dg (GB), \n"); | fprintf(stderr, "\t\t %%dk (kB), %%dm (MB), %%dg (GB), \n"); | ||||
fprintf(stderr, "\t\t %%dt (TB), or %%dp (PB)\n"); | fprintf(stderr, "\t\t %%dt (TB), or %%dp (PB)\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
int | int | ||||
main(int argc, char **argv) | main(int argc, char **argv) | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | case 'o': | ||||
else if (!strcmp(optarg, "compress")) | else if (!strcmp(optarg, "compress")) | ||||
mdio.md_options |= MD_COMPRESS; | mdio.md_options |= MD_COMPRESS; | ||||
else if (!strcmp(optarg, "nocompress")) | else if (!strcmp(optarg, "nocompress")) | ||||
mdio.md_options &= ~MD_COMPRESS; | mdio.md_options &= ~MD_COMPRESS; | ||||
else if (!strcmp(optarg, "force")) | else if (!strcmp(optarg, "force")) | ||||
mdio.md_options |= MD_FORCE; | mdio.md_options |= MD_FORCE; | ||||
else if (!strcmp(optarg, "noforce")) | else if (!strcmp(optarg, "noforce")) | ||||
mdio.md_options &= ~MD_FORCE; | mdio.md_options &= ~MD_FORCE; | ||||
else if (!strcmp(optarg, "mustdealloc")) | |||||
mdio.md_options |= MD_MUSTDEALLOC; | |||||
else if (!strcmp(optarg, "nomustdealloc")) | |||||
mdio.md_options &= ~MD_MUSTDEALLOC; | |||||
else if (!strcmp(optarg, "readonly")) | else if (!strcmp(optarg, "readonly")) | ||||
mdio.md_options |= MD_READONLY; | mdio.md_options |= MD_READONLY; | ||||
else if (!strcmp(optarg, "noreadonly")) | else if (!strcmp(optarg, "noreadonly")) | ||||
mdio.md_options &= ~MD_READONLY; | mdio.md_options &= ~MD_READONLY; | ||||
else if (!strcmp(optarg, "ro")) | else if (!strcmp(optarg, "ro")) | ||||
mdio.md_options |= MD_READONLY; | mdio.md_options |= MD_READONLY; | ||||
else if (!strcmp(optarg, "noro")) | else if (!strcmp(optarg, "noro")) | ||||
mdio.md_options &= ~MD_READONLY; | mdio.md_options &= ~MD_READONLY; | ||||
else if (!strcmp(optarg, "reserve")) | else if (!strcmp(optarg, "reserve")) | ||||
mdio.md_options |= MD_RESERVE; | mdio.md_options |= MD_RESERVE; | ||||
else if (!strcmp(optarg, "noreserve")) | else if (!strcmp(optarg, "noreserve")) | ||||
mdio.md_options &= ~MD_RESERVE; | mdio.md_options &= ~MD_RESERVE; | ||||
else if (!strcmp(optarg, "verify")) | else if (!strcmp(optarg, "verify")) | ||||
mdio.md_options |= MD_VERIFY; | mdio.md_options |= MD_VERIFY; | ||||
else if (!strcmp(optarg, "noverify")) | else if (!strcmp(optarg, "noverify")) | ||||
mdio.md_options &= ~MD_VERIFY; | mdio.md_options &= ~MD_VERIFY; | ||||
else | else | ||||
errx(1, "unknown option: %s", optarg); | errx(1, "unknown option: %s", optarg); | ||||
break; | break; | ||||
case 'S': | case 'S': | ||||
Not Done Inline ActionsThese should be sorted. markj: These should be sorted. | |||||
mdio.md_sectorsize = strtoul(optarg, &p, 0); | mdio.md_sectorsize = strtoul(optarg, &p, 0); | ||||
break; | break; | ||||
case 's': | case 's': | ||||
if (sflag != NULL) | if (sflag != NULL) | ||||
errx(1, "-s can be passed only once"); | errx(1, "-s can be passed only once"); | ||||
sflag = optarg; | sflag = optarg; | ||||
mdio.md_mediasize = (off_t)strtoumax(optarg, &p, 0); | mdio.md_mediasize = (off_t)strtoumax(optarg, &p, 0); | ||||
if (p == NULL || *p == '\0') | if (p == NULL || *p == '\0') | ||||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |
Keep them sorted?