diff options
Diffstat (limited to 'usr/src/cmd/format/prompts.c')
-rw-r--r-- | usr/src/cmd/format/prompts.c | 99 |
1 files changed, 40 insertions, 59 deletions
diff --git a/usr/src/cmd/format/prompts.c b/usr/src/cmd/format/prompts.c index e6ef368bbb..06607bec66 100644 --- a/usr/src/cmd/format/prompts.c +++ b/usr/src/cmd/format/prompts.c @@ -43,7 +43,7 @@ * Prompt for max number of LBA */ uint64_t -get_mlba() +get_mlba(void) { u_ioparam_t ioparam; @@ -51,29 +51,28 @@ get_mlba() ioparam.io_bounds.upper = UINT_MAX64; return (input(FIO_INT64, "Enter maximum number of LBAs", - ':', &ioparam, (int *)NULL, DATA_INPUT)); + ':', &ioparam, NULL, DATA_INPUT)); } /* * Prompt for number of cylinders */ int -get_ncyl() +get_ncyl(void) { u_ioparam_t ioparam; ioparam.io_bounds.lower = 1; ioparam.io_bounds.upper = MAX_CYLS; return (input(FIO_INT, "Enter number of data cylinders", - ':', &ioparam, (int *)NULL, DATA_INPUT)); + ':', &ioparam, NULL, DATA_INPUT)); } /* * Prompt for number of alternate cylinders */ int -get_acyl(n_cyls) - int n_cyls; +get_acyl(int n_cyls) { u_ioparam_t ioparam; int deflt; @@ -89,9 +88,7 @@ get_acyl(n_cyls) * Prompt for number of physical cylinders */ int -get_pcyl(n_cyls, a_cyls) - int n_cyls; - int a_cyls; +get_pcyl(int n_cyls, int a_cyls) { u_ioparam_t ioparam; int deflt; @@ -107,23 +104,21 @@ get_pcyl(n_cyls, a_cyls) * Prompt for number of heads */ int -get_nhead() +get_nhead(void) { u_ioparam_t ioparam; ioparam.io_bounds.lower = 1; ioparam.io_bounds.upper = MAX_HEADS; return (input(FIO_INT, "Enter number of heads", ':', - &ioparam, (int *)NULL, DATA_INPUT)); + &ioparam, NULL, DATA_INPUT)); } /* * Prompt for number of physical heads */ int -get_phead(n_heads, options) - int n_heads; - ulong_t *options; +get_phead(int n_heads, ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -132,7 +127,7 @@ get_phead(n_heads, options) ioparam.io_bounds.lower = n_heads; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter physical number of heads", - ':', &ioparam, &deflt, DATA_INPUT)) { + ':', &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_PHEAD; return (deflt); } @@ -145,7 +140,7 @@ get_phead(n_heads, options) * Prompt for number of sectors per track */ int -get_nsect() +get_nsect(void) { u_ioparam_t ioparam; @@ -153,15 +148,14 @@ get_nsect() ioparam.io_bounds.upper = MAX_SECTS; return (input(FIO_INT, "Enter number of data sectors/track", ':', - &ioparam, (int *)NULL, DATA_INPUT)); + &ioparam, NULL, DATA_INPUT)); } /* * Prompt for number of physical sectors per track */ int -get_psect(options) - ulong_t *options; +get_psect(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -170,7 +164,7 @@ get_psect(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter number of physical sectors/track", - ':', &ioparam, &deflt, DATA_INPUT)) { + ':', &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_PSECT; return (deflt); } @@ -182,9 +176,7 @@ get_psect(options) * Prompt for bytes per track */ int -get_bpt(n_sects, options) - int n_sects; - ulong_t *options; +get_bpt(int n_sects, ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -195,7 +187,7 @@ get_bpt(n_sects, options) ioparam.io_bounds.upper = INFINITY; deflt = n_sects * cur_blksz; return (input(FIO_INT, "Enter number of bytes/track", - ':', &ioparam, &deflt, DATA_INPUT)); + ':', &ioparam, &deflt, DATA_INPUT)); } return (0); @@ -205,7 +197,7 @@ get_bpt(n_sects, options) * Prompt for rpm */ int -get_rpm() +get_rpm(void) { u_ioparam_t ioparam; int deflt; @@ -221,8 +213,7 @@ get_rpm() * Prompt for formatting time */ int -get_fmt_time(options) - ulong_t *options; +get_fmt_time(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -230,7 +221,7 @@ get_fmt_time(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter format time", ':', - &ioparam, &deflt, DATA_INPUT)) { + &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_FMTTIME; return (deflt); } @@ -241,8 +232,7 @@ get_fmt_time(options) * Prompt for cylinder skew */ int -get_cyl_skew(options) - ulong_t *options; +get_cyl_skew(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -250,7 +240,7 @@ get_cyl_skew(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter cylinder skew", ':', - &ioparam, &deflt, DATA_INPUT)) { + &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_CYLSKEW; return (deflt); } @@ -261,8 +251,7 @@ get_cyl_skew(options) * Prompt for track skew */ int -get_trk_skew(options) - ulong_t *options; +get_trk_skew(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -270,7 +259,7 @@ get_trk_skew(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter track skew", ':', - &ioparam, &deflt, DATA_INPUT)) { + &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_TRKSKEW; return (deflt); } @@ -281,8 +270,7 @@ get_trk_skew(options) * Prompt for tracks per zone */ int -get_trks_zone(options) - ulong_t *options; +get_trks_zone(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -290,7 +278,7 @@ get_trks_zone(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter tracks per zone", ':', - &ioparam, &deflt, DATA_INPUT)) { + &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_TRKS_ZONE; return (deflt); } @@ -301,8 +289,7 @@ get_trks_zone(options) * Prompt for alternate tracks */ int -get_atrks(options) - ulong_t *options; +get_atrks(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -310,7 +297,7 @@ get_atrks(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter alternate tracks", ':', - &ioparam, &deflt, DATA_INPUT)) { + &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_ATRKS; return (deflt); } @@ -321,8 +308,7 @@ get_atrks(options) * Prompt for alternate sectors */ int -get_asect(options) - ulong_t *options; +get_asect(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -330,7 +316,7 @@ get_asect(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter alternate sectors", ':', - &ioparam, &deflt, DATA_INPUT)) { + &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_ASECT; return (deflt); } @@ -341,8 +327,7 @@ get_asect(options) * Prompt for cache setting */ int -get_cache(options) - ulong_t *options; +get_cache(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -350,7 +335,7 @@ get_cache(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = 0xff; if (input(FIO_OPINT, "Enter cache control", ':', - &ioparam, &deflt, DATA_INPUT)) { + &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_CACHE; return (deflt); } @@ -361,8 +346,7 @@ get_cache(options) * Prompt for prefetch threshold */ int -get_threshold(options) - ulong_t *options; +get_threshold(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -370,7 +354,7 @@ get_threshold(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter prefetch threshold", - ':', &ioparam, &deflt, DATA_INPUT)) { + ':', &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_PREFETCH; return (deflt); } @@ -381,8 +365,7 @@ get_threshold(options) * Prompt for minimum prefetch */ int -get_min_prefetch(options) - ulong_t *options; +get_min_prefetch(ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -390,7 +373,7 @@ get_min_prefetch(options) ioparam.io_bounds.lower = 0; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter minimum prefetch", - ':', &ioparam, &deflt, DATA_INPUT)) { + ':', &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_CACHE_MIN; return (deflt); } @@ -401,9 +384,7 @@ get_min_prefetch(options) * Prompt for maximum prefetch */ int -get_max_prefetch(min_prefetch, options) - int min_prefetch; - ulong_t *options; +get_max_prefetch(int min_prefetch, ulong_t *options) { u_ioparam_t ioparam; int deflt; @@ -411,7 +392,7 @@ get_max_prefetch(min_prefetch, options) ioparam.io_bounds.lower = min_prefetch; ioparam.io_bounds.upper = INFINITY; if (input(FIO_OPINT, "Enter maximum prefetch", - ':', &ioparam, &deflt, DATA_INPUT)) { + ':', &ioparam, &deflt, DATA_INPUT)) { *options |= SUP_CACHE_MAX; return (deflt); } @@ -422,7 +403,7 @@ get_max_prefetch(min_prefetch, options) * Prompt for bytes per sector */ int -get_bps() +get_bps(void) { u_ioparam_t ioparam; int deflt; @@ -442,9 +423,9 @@ get_bps() * Prompt for ascii label */ char * -get_asciilabel() +get_asciilabel(void) { return ((char *)(uintptr_t)input(FIO_OSTR, "Enter disk type name (remember quotes)", ':', - (u_ioparam_t *)NULL, (int *)NULL, DATA_INPUT)); + NULL, NULL, DATA_INPUT)); } |