diff options
author | Arvind Sankar <[email protected]> | 2020-06-15 14:30:37 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-06-18 12:20:38 -0700 |
commit | 65c7cc49bfcf49d38fc84552a17d7e8a3268e58e (patch) | |
tree | 4740b896f8b5fc114ae9a96c6581776799ffeb3a /cmd | |
parent | 1fa5c7af3314b4c556bd86e3a49e3497a5ed72ed (diff) |
Mark functions as static
Mark functions used only in the same translation unit as static. This
only includes functions that do not have a prototype in a header file
either.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Arvind Sankar <[email protected]>
Closes #10470
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/raidz_test/raidz_bench.c | 4 | ||||
-rw-r--r-- | cmd/zed/agents/zfs_mod.c | 2 | ||||
-rw-r--r-- | cmd/zed/zed_strings.c | 2 | ||||
-rw-r--r-- | cmd/zfs/zfs_main.c | 2 | ||||
-rw-r--r-- | cmd/zfs_ids_to_path/zfs_ids_to_path.c | 2 | ||||
-rw-r--r-- | cmd/zinject/zinject.c | 2 | ||||
-rw-r--r-- | cmd/zpool/zpool_main.c | 22 | ||||
-rw-r--r-- | cmd/zpool/zpool_vdev.c | 2 | ||||
-rw-r--r-- | cmd/ztest/ztest.c | 18 |
9 files changed, 28 insertions, 28 deletions
diff --git a/cmd/raidz_test/raidz_bench.c b/cmd/raidz_test/raidz_bench.c index 4863b8d97..8a2cec4ca 100644 --- a/cmd/raidz_test/raidz_bench.c +++ b/cmd/raidz_test/raidz_bench.c @@ -113,7 +113,7 @@ run_gen_bench_impl(const char *impl) } } -void +static void run_gen_bench(void) { char **impl_name; @@ -197,7 +197,7 @@ run_rec_bench_impl(const char *impl) } } -void +static void run_rec_bench(void) { char **impl_name; diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c index 39ddd8140..1094d25dd 100644 --- a/cmd/zed/agents/zfs_mod.c +++ b/cmd/zed/agents/zfs_mod.c @@ -533,7 +533,7 @@ zfs_iter_vdev(zpool_handle_t *zhp, nvlist_t *nvl, void *data) (dp->dd_func)(zhp, nvl, dp->dd_islabeled); } -void +static void zfs_enable_ds(void *arg) { unavailpool_t *pool = (unavailpool_t *)arg; diff --git a/cmd/zed/zed_strings.c b/cmd/zed/zed_strings.c index 51b872ac7..6b1c669d7 100644 --- a/cmd/zed/zed_strings.c +++ b/cmd/zed/zed_strings.c @@ -108,7 +108,7 @@ _zed_strings_node_destroy(zed_strings_node_t *np) * If [key] is specified, it will be used to index the node; otherwise, * the string [val] will be used. */ -zed_strings_node_t * +static zed_strings_node_t * _zed_strings_node_create(const char *key, const char *val) { zed_strings_node_t *np; diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 07086a351..5e7ee0f5b 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -443,7 +443,7 @@ safe_malloc(size_t size) return (data); } -void * +static void * safe_realloc(void *data, size_t size) { void *newp; diff --git a/cmd/zfs_ids_to_path/zfs_ids_to_path.c b/cmd/zfs_ids_to_path/zfs_ids_to_path.c index 48e42bb24..6cfaa6f41 100644 --- a/cmd/zfs_ids_to_path/zfs_ids_to_path.c +++ b/cmd/zfs_ids_to_path/zfs_ids_to_path.c @@ -32,7 +32,7 @@ libzfs_handle_t *g_zfs; -void +static void usage(int err) { fprintf(stderr, "Usage: [-v] zfs_ids_to_path <pool> <objset id> " diff --git a/cmd/zinject/zinject.c b/cmd/zinject/zinject.c index 01b4f0ce7..bf97b0d68 100644 --- a/cmd/zinject/zinject.c +++ b/cmd/zinject/zinject.c @@ -613,7 +613,7 @@ register_handler(const char *pool, int flags, zinject_record_t *record, return (0); } -int +static int perform_action(const char *pool, zinject_record_t *record, int cmd) { zfs_cmd_t zc = {"\0"}; diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index f13916f40..ee6c479eb 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -485,7 +485,7 @@ print_prop_cb(int prop, void *cb) * that command. Otherwise, iterate over the entire command table and display * a complete usage message. */ -void +static void usage(boolean_t requested) { FILE *fp = requested ? stdout : stderr; @@ -1689,7 +1689,7 @@ typedef struct export_cbdata { /* * Export one pool */ -int +static int zpool_export_one(zpool_handle_t *zhp, void *data) { export_cbdata_t *cb = data; @@ -3711,7 +3711,7 @@ default_column_width(iostat_cbdata_t *cb, enum iostat_type type) * If force_column_width is set, use it for the column width. If not set, use * the default column width. */ -void +static void print_iostat_labels(iostat_cbdata_t *cb, unsigned int force_column_width, const name_and_columns_t labels[][IOSTAT_MAX_LABELS]) { @@ -3783,7 +3783,7 @@ print_iostat_labels(iostat_cbdata_t *cb, unsigned int force_column_width, * sdc - - 0 0 5 473 val1 val2 * ---------- ----- ----- ----- ----- ----- ----- ---- ---- */ -void +static void print_cmd_columns(vdev_cmd_data_list_t *vcdl, int use_dashes) { int i, j; @@ -4633,7 +4633,7 @@ refresh_iostat(zpool_handle_t *zhp, void *data) /* * Callback to print out the iostats for the given pool. */ -int +static int print_iostat(zpool_handle_t *zhp, void *data) { iostat_cbdata_t *cb = data; @@ -5787,7 +5787,7 @@ print_one_column(zpool_prop_t prop, uint64_t value, const char *str, * print static default line per vdev * not compatible with '-o' <proplist> option */ -void +static void print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv, list_cbdata_t *cb, int depth, boolean_t isspare) { @@ -5954,7 +5954,7 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv, /* * Generic callback function to list a pool. */ -int +static int list_callback(zpool_handle_t *zhp, void *data) { list_cbdata_t *cbp = data; @@ -6858,7 +6858,7 @@ zpool_has_checkpoint(zpool_handle_t *zhp) return (B_FALSE); } -int +static int scrub_callback(zpool_handle_t *zhp, void *data) { scrub_cbdata_t *cb = data; @@ -7583,7 +7583,7 @@ print_dedup_stats(nvlist_t *config) * When given the '-v' option, we print out the complete config. If the '-e' * option is specified, then we print out error rate information as well. */ -int +static int status_callback(zpool_handle_t *zhp, void *data) { status_cbdata_t *cbp = data; @@ -9448,7 +9448,7 @@ typedef struct set_cbdata { boolean_t cb_any_successful; } set_cbdata_t; -int +static int set_callback(zpool_handle_t *zhp, void *data) { int error; @@ -9698,7 +9698,7 @@ print_wait_status_row(wait_data_t *wd, zpool_handle_t *zhp, int row) (void) fflush(stdout); } -void * +static void * wait_status_thread(void *arg) { wait_data_t *wd = (wait_data_t *)arg; diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index a11fdd33c..9b5f4972f 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -1173,7 +1173,7 @@ is_grouping(const char *type, int *mindev, int *maxdev) * Note: we don't bother freeing anything in the error paths * because the program is just going to exit anyway. */ -nvlist_t * +static nvlist_t * construct_spec(nvlist_t *props, int argc, char **argv) { nvlist_t *nvroot, *nv, **top, **spares, **l2cache; diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index c0379caca..dd5bf9894 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -1584,7 +1584,7 @@ ztest_bt_bonus(dmu_buf_t *db) * helps ensure that all dnode traversal code properly skips the * interior regions of large dnodes. */ -void +static void ztest_fill_unused_bonus(dmu_buf_t *db, void *end, uint64_t obj, objset_t *os, uint64_t gen) { @@ -1603,7 +1603,7 @@ ztest_fill_unused_bonus(dmu_buf_t *db, void *end, uint64_t obj, * Verify that the unused area of a bonus buffer is filled with the * expected tokens. */ -void +static void ztest_verify_unused_bonus(dmu_buf_t *db, void *end, uint64_t obj, objset_t *os, uint64_t gen) { @@ -2259,7 +2259,7 @@ ztest_lr_alloc(size_t lrsize, char *name) return (lr); } -void +static void ztest_lr_free(void *lr, size_t lrsize, char *name) { size_t namesize = name ? strlen(name) + 1 : 0; @@ -3609,7 +3609,7 @@ ztest_device_removal(ztest_ds_t *zd, uint64_t id) /* * Callback function which expands the physical size of the vdev. */ -vdev_t * +static vdev_t * grow_vdev(vdev_t *vd, void *arg) { spa_t *spa __maybe_unused = vd->vdev_spa; @@ -3638,7 +3638,7 @@ grow_vdev(vdev_t *vd, void *arg) * Callback function which expands a given vdev by calling vdev_online(). */ /* ARGSUSED */ -vdev_t * +static vdev_t * online_vdev(vdev_t *vd, void *arg) { spa_t *spa = vd->vdev_spa; @@ -3698,7 +3698,7 @@ online_vdev(vdev_t *vd, void *arg) * If a NULL callback is passed, then we just return back the first * leaf vdev we encounter. */ -vdev_t * +static vdev_t * vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg) { uint_t c; @@ -4151,7 +4151,7 @@ ztest_dmu_snapshot_create_destroy(ztest_ds_t *zd, uint64_t id) /* * Cleanup non-standard snapshots and clones. */ -void +static void ztest_dsl_dataset_cleanup(char *osname, uint64_t id) { char *snap1name; @@ -4605,7 +4605,7 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id) umem_free(od, size); } -void +static void compare_and_update_pbbufs(uint64_t s, bufwad_t *packbuf, bufwad_t *bigbuf, uint64_t bigsize, uint64_t n, uint64_t chunksize, uint64_t txg) { @@ -7269,7 +7269,7 @@ ztest_run(ztest_shared_t *zs) mutex_destroy(&ztest_checkpoint_lock); } -void +static void print_time(hrtime_t t, char *timebuf) { hrtime_t s = t / NANOSEC; |