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 <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10470
This commit is contained in:
Arvind Sankar
2020-06-15 14:30:37 -04:00
committed by Brian Behlendorf
parent 1fa5c7af33
commit 65c7cc49bf
62 changed files with 157 additions and 176 deletions
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -443,7 +443,7 @@ safe_malloc(size_t size)
return (data);
}
void *
static void *
safe_realloc(void *data, size_t size)
{
void *newp;
+1 -1
View File
@@ -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> "
+1 -1
View File
@@ -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"};
+11 -11
View File
@@ -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;
+1 -1
View File
@@ -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;
+9 -9
View File
@@ -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;