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 /module | |
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 'module')
42 files changed, 111 insertions, 104 deletions
diff --git a/module/icp/algs/modes/ccm.c b/module/icp/algs/modes/ccm.c index ad603a32a..c927f0897 100644 --- a/module/icp/algs/modes/ccm.c +++ b/module/icp/algs/modes/ccm.c @@ -318,7 +318,7 @@ ccm_encrypt_final(ccm_ctx_t *ctx, crypto_data_t *out, size_t block_size, * This will only deal with decrypting the last block of the input that * might not be a multiple of block length. */ -void +static void ccm_decrypt_incomplete_block(ccm_ctx_t *ctx, int (*encrypt_block)(const void *, const uint8_t *, uint8_t *)) { @@ -573,7 +573,7 @@ ccm_decrypt_final(ccm_ctx_t *ctx, crypto_data_t *out, size_t block_size, return (CRYPTO_SUCCESS); } -int +static int ccm_validate_args(CK_AES_CCM_PARAMS *ccm_param, boolean_t is_encrypt_init) { size_t macSize, nonceSize; @@ -758,11 +758,7 @@ encode_adata_len(ulong_t auth_data_len, uint8_t *encoded, size_t *encoded_len) } } -/* - * The following function should be call at encrypt or decrypt init time - * for AES CCM mode. - */ -int +static int ccm_init(ccm_ctx_t *ctx, unsigned char *nonce, size_t nonce_len, unsigned char *auth_data, size_t auth_data_len, size_t block_size, int (*encrypt_block)(const void *, const uint8_t *, uint8_t *), @@ -846,6 +842,10 @@ ccm_init(ccm_ctx_t *ctx, unsigned char *nonce, size_t nonce_len, return (CRYPTO_SUCCESS); } +/* + * The following function should be call at encrypt or decrypt init time + * for AES CCM mode. + */ int ccm_init_ctx(ccm_ctx_t *ccm_ctx, char *param, int kmflag, boolean_t is_encrypt_init, size_t block_size, diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 6b732808a..5553c55e1 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -518,11 +518,7 @@ gcm_format_initial_blocks(uchar_t *iv, ulong_t iv_len, } } -/* - * The following function is called at encrypt or decrypt init time - * for AES GCM mode. - */ -int +static int gcm_init(gcm_ctx_t *ctx, unsigned char *iv, size_t iv_len, unsigned char *auth_data, size_t auth_data_len, size_t block_size, int (*encrypt_block)(const void *, const uint8_t *, uint8_t *), @@ -574,6 +570,9 @@ gcm_init(gcm_ctx_t *ctx, unsigned char *iv, size_t iv_len, } /* + * The following function is called at encrypt or decrypt init time + * for AES GCM mode. + * * Init the GCM context struct. Handle the cycle and avx implementations here. */ int diff --git a/module/icp/core/kcf_sched.c b/module/icp/core/kcf_sched.c index c8c2bbd42..40d50553d 100644 --- a/module/icp/core/kcf_sched.c +++ b/module/icp/core/kcf_sched.c @@ -872,7 +872,7 @@ kcf_free_req(kcf_areq_node_t *areq) * Utility routine to remove a request from the chain of requests * hanging off a context. */ -void +static void kcf_removereq_in_ctxchain(kcf_context_t *ictx, kcf_areq_node_t *areq) { kcf_areq_node_t *cur, *prev; @@ -909,7 +909,7 @@ kcf_removereq_in_ctxchain(kcf_context_t *ictx, kcf_areq_node_t *areq) * * The caller must hold the queue lock and request lock (an_lock). */ -void +static void kcf_remove_node(kcf_areq_node_t *node) { kcf_areq_node_t *nextp = node->an_next; diff --git a/module/os/freebsd/spl/callb.c b/module/os/freebsd/spl/callb.c index d4a0e141c..04ea396f5 100644 --- a/module/os/freebsd/spl/callb.c +++ b/module/os/freebsd/spl/callb.c @@ -94,7 +94,7 @@ callb_cpr_t callb_cprinfo_safe = { /* * Init all callb tables in the system. */ -void +static void callb_init(void *dummy __unused) { callb_table.ct_busy = 0; /* mark table open for additions */ @@ -102,7 +102,7 @@ callb_init(void *dummy __unused) mutex_init(&callb_table.ct_lock, NULL, MUTEX_DEFAULT, NULL); } -void +static void callb_fini(void *dummy __unused) { callb_t *cp; diff --git a/module/os/freebsd/zfs/zfs_acl.c b/module/os/freebsd/zfs/zfs_acl.c index c11e16437..07fa42fc8 100644 --- a/module/os/freebsd/zfs/zfs_acl.c +++ b/module/os/freebsd/zfs/zfs_acl.c @@ -648,7 +648,7 @@ zfs_ace_walk(void *datap, uint64_t cookie, int aclcnt, * While processing the ACL each ACE will be validated for correctness. * ACE FUIDs will be created later. */ -int +static int zfs_copy_ace_2_fuid(zfsvfs_t *zfsvfs, vtype_t obj_type, zfs_acl_t *aclp, void *datap, zfs_ace_t *z_acl, uint64_t aclcnt, size_t *size, zfs_fuid_info_t **fuidp, cred_t *cr) diff --git a/module/os/freebsd/zfs/zfs_ctldir.c b/module/os/freebsd/zfs/zfs_ctldir.c index fb0ffc082..2738f5399 100644 --- a/module/os/freebsd/zfs/zfs_ctldir.c +++ b/module/os/freebsd/zfs/zfs_ctldir.c @@ -602,7 +602,7 @@ zfsctl_root_getattr(struct vop_getattr_args *ap) * When we lookup "." we still can be asked to lock it * differently, can't we? */ -int +static int zfsctl_relock_dot(vnode_t *dvp, int ltype) { vref(dvp); @@ -624,7 +624,7 @@ zfsctl_relock_dot(vnode_t *dvp, int ltype) /* * Special case the handling of "..". */ -int +static int zfsctl_root_lookup(struct vop_lookup_args *ap) { struct componentname *cnp = ap->a_cnp; @@ -766,7 +766,7 @@ zfsctl_common_pathconf(struct vop_pathconf_args *ap) /* * Returns a trivial ACL */ -int +static int zfsctl_common_getacl(struct vop_getacl_args *ap) { int i; @@ -894,7 +894,7 @@ zfsctl_snapshot_vnode_setup(vnode_t *vp, void *arg) * - the snapshot vnode is not covered, because the snapshot has been unmounted * The last two states are transient and should be relatively short-lived. */ -int +static int zfsctl_snapdir_lookup(struct vop_lookup_args *ap) { vnode_t *dvp = ap->a_dvp; diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index 8a7626c86..5bd6bdfae 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -1250,7 +1250,7 @@ out: return (error); } -void +static void zfs_unregister_callbacks(zfsvfs_t *zfsvfs) { objset_t *os = zfsvfs->z_os; diff --git a/module/os/freebsd/zfs/zfs_vnops.c b/module/os/freebsd/zfs/zfs_vnops.c index ca23026be..cf684222b 100644 --- a/module/os/freebsd/zfs/zfs_vnops.c +++ b/module/os/freebsd/zfs/zfs_vnops.c @@ -1251,7 +1251,7 @@ zfs_write_simple(znode_t *zp, const void *data, size_t len, return (error); } -void +static void zfs_get_done(zgd_t *zgd, int error) { znode_t *zp = zgd->zgd_private; @@ -2052,7 +2052,7 @@ out: } -int +static int zfs_lookup_internal(znode_t *dzp, char *name, vnode_t **vpp, struct componentname *cnp, int nameiop) { @@ -4605,7 +4605,7 @@ zfs_space(znode_t *zp, int cmd, flock64_t *bfp, int flag, } /*ARGSUSED*/ -void +static void zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct) { znode_t *zp = VTOZ(vp); @@ -5043,7 +5043,7 @@ struct vop_putpages_args { }; #endif -int +static int zfs_freebsd_putpages(struct vop_putpages_args *ap) { @@ -5994,7 +5994,7 @@ struct vop_deleteextattr { /* * Vnode operation to remove a named attribute. */ -int +static int zfs_deleteextattr(struct vop_deleteextattr_args *ap) { zfsvfs_t *zfsvfs = VTOZ(ap->a_vp)->z_zfsvfs; @@ -6271,7 +6271,7 @@ struct vop_getacl_args { }; #endif -int +static int zfs_freebsd_getacl(struct vop_getacl_args *ap) { int error; @@ -6302,7 +6302,7 @@ struct vop_setacl_args { }; #endif -int +static int zfs_freebsd_setacl(struct vop_setacl_args *ap) { int error; @@ -6355,7 +6355,7 @@ struct vop_aclcheck_args { }; #endif -int +static int zfs_freebsd_aclcheck(struct vop_aclcheck_args *ap) { diff --git a/module/os/freebsd/zfs/zfs_znode.c b/module/os/freebsd/zfs/zfs_znode.c index e2f941415..8a2e55c67 100644 --- a/module/os/freebsd/zfs/zfs_znode.c +++ b/module/os/freebsd/zfs/zfs_znode.c @@ -1731,7 +1731,7 @@ zfs_grab_sa_handle(objset_t *osp, uint64_t obj, sa_handle_t **hdlp, return (0); } -void +static void zfs_release_sa_handle(sa_handle_t *hdl, dmu_buf_t *db, void *tag) { sa_handle_destroy(hdl); diff --git a/module/os/linux/spl/spl-generic.c b/module/os/linux/spl/spl-generic.c index c55ebf7c5..837447239 100644 --- a/module/os/linux/spl/spl-generic.c +++ b/module/os/linux/spl/spl-generic.c @@ -543,7 +543,7 @@ spl_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) #endif } -int +static int spl_getattr(struct file *filp, struct kstat *stat) { int rc; diff --git a/module/os/linux/zfs/spa_stats.c b/module/os/linux/zfs/spa_stats.c index 2ec32da46..86cefa6dd 100644 --- a/module/os/linux/zfs/spa_stats.c +++ b/module/os/linux/zfs/spa_stats.c @@ -952,7 +952,7 @@ spa_iostats_trim_add(spa_t *spa, trim_type_t type, } } -int +static int spa_iostats_update(kstat_t *ksp, int rw) { if (rw == KSTAT_WRITE) { diff --git a/module/os/linux/zfs/zfs_acl.c b/module/os/linux/zfs/zfs_acl.c index ff963b0a5..87547eb54 100644 --- a/module/os/linux/zfs/zfs_acl.c +++ b/module/os/linux/zfs/zfs_acl.c @@ -648,7 +648,7 @@ zfs_ace_walk(void *datap, uint64_t cookie, int aclcnt, * While processing the ACL each ACE will be validated for correctness. * ACE FUIDs will be created later. */ -int +static int zfs_copy_ace_2_fuid(zfsvfs_t *zfsvfs, umode_t obj_mode, zfs_acl_t *aclp, void *datap, zfs_ace_t *z_acl, uint64_t aclcnt, size_t *size, zfs_fuid_info_t **fuidp, cred_t *cr) @@ -1189,7 +1189,7 @@ typedef struct trivial_acl { uint32_t everyone; /* allow mask matching mode */ } trivial_acl_t; -void +static void acl_trivial_access_masks(mode_t mode, boolean_t isdir, trivial_acl_t *masks) { uint32_t read_mask = ACE_READ_DATA; @@ -1262,7 +1262,7 @@ acl_trivial_access_masks(mode_t mode, boolean_t isdir, trivial_acl_t *masks) * have read_acl denied, and write_owner/write_acl/write_attributes * can only be owner@ entry. */ -int +static int ace_trivial_common(void *acep, int aclcnt, uint64_t (*walk)(void *, uint64_t, int aclcnt, uint16_t *, uint16_t *, uint32_t *)) diff --git a/module/os/linux/zfs/zfs_vfsops.c b/module/os/linux/zfs/zfs_vfsops.c index 9561960bc..db831bf54 100644 --- a/module/os/linux/zfs/zfs_vfsops.c +++ b/module/os/linux/zfs/zfs_vfsops.c @@ -971,7 +971,7 @@ zfs_set_fuid_feature(zfsvfs_t *zfsvfs) zfsvfs->z_use_sa = USE_SA(zfsvfs->z_version, zfsvfs->z_os); } -void +static void zfs_unregister_callbacks(zfsvfs_t *zfsvfs) { objset_t *os = zfsvfs->z_os; @@ -1159,7 +1159,7 @@ zfs_statvfs(struct inode *ip, struct kstatfs *statp) return (err); } -int +static int zfs_root(zfsvfs_t *zfsvfs, struct inode **ipp) { znode_t *rootzp; diff --git a/module/os/linux/zfs/zfs_vnops.c b/module/os/linux/zfs/zfs_vnops.c index cf5d406a2..acf3aca44 100644 --- a/module/os/linux/zfs/zfs_vnops.c +++ b/module/os/linux/zfs/zfs_vnops.c @@ -1041,7 +1041,7 @@ zfs_zrele_async(znode_t *zp) } /* ARGSUSED */ -void +static void zfs_get_done(zgd_t *zgd, int error) { znode_t *zp = zgd->zgd_private; diff --git a/module/os/linux/zfs/zfs_znode.c b/module/os/linux/zfs/zfs_znode.c index 45f19785d..504dc76f9 100644 --- a/module/os/linux/zfs/zfs_znode.c +++ b/module/os/linux/zfs/zfs_znode.c @@ -249,7 +249,7 @@ zfs_znode_hold_compare(const void *a, const void *b) return (TREE_CMP(zh_a->zh_obj, zh_b->zh_obj)); } -boolean_t +static boolean_t __maybe_unused zfs_znode_held(zfsvfs_t *zfsvfs, uint64_t obj) { znode_hold_t *zh, search; @@ -451,7 +451,7 @@ zfs_inode_set_ops(zfsvfs_t *zfsvfs, struct inode *ip) } } -void +static void zfs_set_inode_flags(znode_t *zp, struct inode *ip) { /* @@ -2013,7 +2013,7 @@ zfs_grab_sa_handle(objset_t *osp, uint64_t obj, sa_handle_t **hdlp, return (0); } -void +static void zfs_release_sa_handle(sa_handle_t *hdl, dmu_buf_t *db, void *tag) { sa_handle_destroy(hdl); diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index c26ed5d09..51e189a87 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -651,7 +651,7 @@ zpl_readpages(struct file *filp, struct address_space *mapping, (filler_t *)zpl_readpage, filp)); } -int +static int zpl_putpage(struct page *pp, struct writeback_control *wbc, void *data) { struct address_space *mapping = data; diff --git a/module/os/linux/zfs/zpl_inode.c b/module/os/linux/zfs/zpl_inode.c index c1b582574..f3b97a220 100644 --- a/module/os/linux/zfs/zpl_inode.c +++ b/module/os/linux/zfs/zpl_inode.c @@ -518,7 +518,7 @@ zpl_get_link_common(struct dentry *dentry, struct inode *ip, char **link) } #if defined(HAVE_GET_LINK_DELAYED) -const char * +static const char * zpl_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *done) { @@ -537,7 +537,7 @@ zpl_get_link(struct dentry *dentry, struct inode *inode, return (link); } #elif defined(HAVE_GET_LINK_COOKIE) -const char * +static const char * zpl_get_link(struct dentry *dentry, struct inode *inode, void **cookie) { char *link = NULL; @@ -553,7 +553,7 @@ zpl_get_link(struct dentry *dentry, struct inode *inode, void **cookie) return (*cookie = link); } #elif defined(HAVE_FOLLOW_LINK_COOKIE) -const char * +static const char * zpl_follow_link(struct dentry *dentry, void **cookie) { char *link = NULL; diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index 956aed528..fa3c03640 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -148,7 +148,7 @@ zpl_xattr_filldir(xattr_filldir_t *xf, const char *name, int name_len) * Read as many directory entry names as will fit in to the provided buffer, * or when no buffer is provided calculate the required buffer size. */ -int +static int zpl_xattr_readdir(struct inode *dxip, xattr_filldir_t *xf) { zap_cursor_t zc; @@ -920,6 +920,9 @@ xattr_handler_t zpl_xattr_security_handler = { * attribute implemented by filesystems in the kernel." - xattr(7) */ #ifdef CONFIG_FS_POSIX_ACL +#ifndef HAVE_SET_ACL +static +#endif int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type) { diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c index 3d820ce56..12d448094 100644 --- a/module/os/linux/zfs/zvol_os.c +++ b/module/os/linux/zfs/zvol_os.c @@ -640,7 +640,7 @@ zvol_revalidate_disk(struct gendisk *disk) return (0); } -int +static int zvol_update_volsize(zvol_state_t *zv, uint64_t volsize) { diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 874cc02e8..a11499703 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -1696,7 +1696,7 @@ arc_buf_try_copy_decompressed_data(arc_buf_t *buf) * which circumvent the regular disk->arc->l2arc path and instead come * into being in the reverse order, i.e. l2arc->arc. */ -arc_buf_hdr_t * +static arc_buf_hdr_t * arc_buf_alloc_l2only(size_t size, arc_buf_contents_t type, l2arc_dev_t *dev, dva_t dva, uint64_t daddr, int32_t psize, uint64_t birth, enum zio_compress compress, boolean_t protected, boolean_t prefetch) @@ -7016,7 +7016,7 @@ arc_kstat_update(kstat_t *ksp, int rw) * distributed between all sublists and uses this assumption when * deciding which sublist to evict from and how much to evict from it. */ -unsigned int +static unsigned int arc_state_multilist_index_func(multilist_t *ml, void *obj) { arc_buf_hdr_t *hdr = obj; diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index be6a76830..207d59439 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -588,7 +588,7 @@ dbuf_is_metadata(dmu_buf_impl_t *db) * distributed between all sublists and uses this assumption when * deciding which sublist to evict from and how much to evict from it. */ -unsigned int +static unsigned int dbuf_cache_multilist_index_func(multilist_t *ml, void *obj) { dmu_buf_impl_t *db = obj; diff --git a/module/zfs/dbuf_stats.c b/module/zfs/dbuf_stats.c index b652d2a24..a2f3c580e 100644 --- a/module/zfs/dbuf_stats.c +++ b/module/zfs/dbuf_stats.c @@ -61,7 +61,7 @@ dbuf_stats_hash_table_headers(char *buf, size_t size) return (0); } -int +static int __dbuf_stats_hash_table_data(char *buf, size_t size, dmu_buf_impl_t *db) { arc_buf_info_t abi = { 0 }; diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 3958a6f97..5cc7bfe11 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -151,7 +151,7 @@ const dmu_object_byteswap_info_t dmu_ot_byteswap[DMU_BSWAP_NUMFUNCS] = { { zfs_acl_byteswap, "acl" } }; -int +static int dmu_buf_hold_noread_by_dnode(dnode_t *dn, uint64_t offset, void *tag, dmu_buf_t **dbp) { diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c index d305cee40..dd72a7dc2 100644 --- a/module/zfs/dmu_objset.c +++ b/module/zfs/dmu_objset.c @@ -392,7 +392,7 @@ dnode_hash(const objset_t *os, uint64_t obj) return (crc); } -unsigned int +static unsigned int dnode_multilist_index_func(multilist_t *ml, void *obj) { dnode_t *dn = obj; diff --git a/module/zfs/dsl_crypt.c b/module/zfs/dsl_crypt.c index eef4999b7..33c21e86c 100644 --- a/module/zfs/dsl_crypt.c +++ b/module/zfs/dsl_crypt.c @@ -343,7 +343,7 @@ dsl_dir_get_encryption_root_ddobj(dsl_dir_t *dd, uint64_t *rddobj) DSL_CRYPTO_KEY_ROOT_DDOBJ, 8, 1, rddobj)); } -int +static int dsl_dir_get_encryption_version(dsl_dir_t *dd, uint64_t *version) { *version = 0; @@ -2304,7 +2304,7 @@ dsl_crypto_recv_raw_key_sync(dsl_dataset_t *ds, nvlist_t *nvl, dmu_tx_t *tx) iters, tx); } -int +static int dsl_crypto_recv_key_check(void *arg, dmu_tx_t *tx) { int ret; @@ -2345,7 +2345,7 @@ out: return (ret); } -void +static void dsl_crypto_recv_key_sync(void *arg, dmu_tx_t *tx) { dsl_crypto_recv_key_arg_t *dcrka = arg; diff --git a/module/zfs/dsl_dir.c b/module/zfs/dsl_dir.c index d33d5ed93..977600116 100644 --- a/module/zfs/dsl_dir.c +++ b/module/zfs/dsl_dir.c @@ -1684,7 +1684,7 @@ dsl_dir_set_quota(const char *ddname, zprop_source_t source, uint64_t quota) ZFS_SPACE_CHECK_EXTRA_RESERVED)); } -int +static int dsl_dir_set_reservation_check(void *arg, dmu_tx_t *tx) { dsl_dir_set_qr_arg_t *ddsqra = arg; diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c index 4dd86a9fe..3a2028625 100644 --- a/module/zfs/dsl_pool.c +++ b/module/zfs/dsl_pool.c @@ -1158,7 +1158,7 @@ dsl_pool_clean_tmp_userrefs(dsl_pool_t *dp) /* * Create the pool-wide zap object for storing temporary snapshot holds. */ -void +static void dsl_pool_user_hold_create_obj(dsl_pool_t *dp, dmu_tx_t *tx) { objset_t *mos = dp->dp_meta_objset; diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index efdf5b24f..895ffbf0a 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -1598,7 +1598,7 @@ dsl_scan_prefetch_dnode(dsl_scan_t *scn, dnode_phys_t *dnp, scan_prefetch_ctx_rele(spc, FTAG); } -void +static void dsl_scan_prefetch_cb(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, arc_buf_t *buf, void *private) { diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c index 549055628..762038cb3 100644 --- a/module/zfs/metaslab.c +++ b/module/zfs/metaslab.c @@ -1480,7 +1480,7 @@ metaslab_largest_allocatable(metaslab_t *msp) * Return the maximum contiguous segment within the unflushed frees of this * metaslab. */ -uint64_t +static uint64_t metaslab_largest_unflushed_free(metaslab_t *msp) { ASSERT(MUTEX_HELD(&msp->ms_lock)); @@ -1810,7 +1810,7 @@ metaslab_ops_t *zfs_metaslab_ops = &metaslab_ndf_ops; /* * Wait for any in-progress metaslab loads to complete. */ -void +static void metaslab_load_wait(metaslab_t *msp) { ASSERT(MUTEX_HELD(&msp->ms_lock)); @@ -1824,7 +1824,7 @@ metaslab_load_wait(metaslab_t *msp) /* * Wait for any in-progress flushing to complete. */ -void +static void metaslab_flush_wait(metaslab_t *msp) { ASSERT(MUTEX_HELD(&msp->ms_lock)); @@ -3107,7 +3107,7 @@ metaslab_segment_weight(metaslab_t *msp) * allocation based on the index encoded in its value. For space-based * weights we rely on the entire weight (excluding the weight-type bit). */ -boolean_t +static boolean_t metaslab_should_allocate(metaslab_t *msp, uint64_t asize, boolean_t try_hard) { /* @@ -3376,7 +3376,7 @@ metaslab_passivate(metaslab_t *msp, uint64_t weight) * metaslab group. If we're in sync pass > 1, then we continue using this * metaslab so that we don't dirty more block and cause more sync passes. */ -void +static void metaslab_segment_may_passivate(metaslab_t *msp) { spa_t *spa = msp->ms_group->mg_vd->vdev_spa; @@ -4650,7 +4650,7 @@ find_valid_metaslab(metaslab_group_t *mg, uint64_t activation_weight, return (msp); } -void +static void metaslab_active_mask_verify(metaslab_t *msp) { ASSERT(MUTEX_HELD(&msp->ms_lock)); @@ -5360,7 +5360,7 @@ typedef struct remap_blkptr_cb_arg { void *rbca_cb_arg; } remap_blkptr_cb_arg_t; -void +static void remap_blkptr_cb(uint64_t inner_offset, vdev_t *vd, uint64_t offset, uint64_t size, void *arg) { diff --git a/module/zfs/sa.c b/module/zfs/sa.c index ed531892e..977e729fe 100644 --- a/module/zfs/sa.c +++ b/module/zfs/sa.c @@ -268,7 +268,7 @@ layout_hash_compare(const void *arg1, const void *arg2) return (TREE_CMP(node1->lot_instance, node2->lot_instance)); } -boolean_t +static boolean_t sa_layout_equal(sa_lot_t *tbf, sa_attr_type_t *attrs, int count) { int i; @@ -318,7 +318,7 @@ sa_get_spill(sa_handle_t *hdl) * * Operates on bulk array, first failure will abort further processing */ -int +static int sa_attr_op(sa_handle_t *hdl, sa_bulk_attr_t *bulk, int count, sa_data_op_t data_op, dmu_tx_t *tx) { @@ -1156,7 +1156,7 @@ sa_tear_down(objset_t *os) os->os_sa = NULL; } -void +static void sa_build_idx_tab(void *hdr, void *attr_addr, sa_attr_type_t attr, uint16_t length, int length_idx, boolean_t var_length, void *userp) { @@ -1220,7 +1220,7 @@ sa_attr_iter(objset_t *os, sa_hdr_phys_t *hdr, dmu_object_type_t type, } /*ARGSUSED*/ -void +static void sa_byteswap_cb(void *hdr, void *attr_addr, sa_attr_type_t attr, uint16_t length, int length_idx, boolean_t variable_length, void *userp) { @@ -1230,7 +1230,7 @@ sa_byteswap_cb(void *hdr, void *attr_addr, sa_attr_type_t attr, sa_bswap_table[sa->sa_attr_table[attr].sa_byteswap](attr_addr, length); } -void +static void sa_byteswap(sa_handle_t *hdl, sa_buf_type_t buftype) { sa_hdr_phys_t *sa_hdr_phys = SA_GET_HDR(hdl, buftype); @@ -1462,7 +1462,7 @@ sa_buf_rele(dmu_buf_t *db, void *tag) dmu_buf_rele(db, tag); } -int +static int sa_lookup_impl(sa_handle_t *hdl, sa_bulk_attr_t *bulk, int count) { ASSERT(hdl); diff --git a/module/zfs/spa.c b/module/zfs/spa.c index ba9a0dce3..943330886 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -2264,7 +2264,7 @@ spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, } /* ARGSUSED */ -int +static int verify_dataset_name_len(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) { if (dsl_dataset_namelen(ds) >= ZFS_MAX_DATASET_NAME_LEN) @@ -2492,7 +2492,7 @@ livelist_delete_sync(void *arg, dmu_tx_t *tx) * the pool-wide livelist data. */ /* ARGSUSED */ -void +static void spa_livelist_delete_cb(void *arg, zthr_t *z) { spa_t *spa = arg; @@ -2546,7 +2546,7 @@ spa_livelist_delete_cb(void *arg, zthr_t *z) } } -void +static void spa_start_livelist_destroy_thread(spa_t *spa) { ASSERT3P(spa->spa_livelist_delete_zthr, ==, NULL); @@ -2652,7 +2652,7 @@ out: spa->spa_to_condense.syncing = B_FALSE; } -void +static void spa_livelist_condense_cb(void *arg, zthr_t *t) { while (zfs_livelist_condense_zthr_pause && @@ -2747,7 +2747,7 @@ spa_livelist_condense_cb_check(void *arg, zthr_t *z) return (B_FALSE); } -void +static void spa_start_livelist_condensing_thread(spa_t *spa) { spa->spa_to_condense.ds = NULL; @@ -7733,7 +7733,7 @@ spa_vdev_resilver_done(spa_t *spa) /* * Update the stored path or FRU for this vdev. */ -int +static int spa_vdev_set_common(spa_t *spa, uint64_t guid, const char *value, boolean_t ispath) { diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c index 6a4307111..61cefa3dd 100644 --- a/module/zfs/spa_misc.c +++ b/module/zfs/spa_misc.c @@ -615,7 +615,7 @@ spa_deadman(void *arg) MSEC_TO_TICK(zfs_deadman_checktime_ms)); } -int +static int spa_log_sm_sort_by_txg(const void *va, const void *vb) { const spa_log_sm_t *a = va; @@ -944,7 +944,7 @@ spa_aux_compare(const void *a, const void *b) return (TREE_CMP(sa->aux_guid, sb->aux_guid)); } -void +static void spa_aux_add(vdev_t *vd, avl_tree_t *avl) { avl_index_t where; @@ -962,7 +962,7 @@ spa_aux_add(vdev_t *vd, avl_tree_t *avl) } } -void +static void spa_aux_remove(vdev_t *vd, avl_tree_t *avl) { spa_aux_t search; @@ -982,7 +982,7 @@ spa_aux_remove(vdev_t *vd, avl_tree_t *avl) } } -boolean_t +static boolean_t spa_aux_exists(uint64_t guid, uint64_t *pool, int *refcnt, avl_tree_t *avl) { spa_aux_t search, *found; @@ -1007,7 +1007,7 @@ spa_aux_exists(uint64_t guid, uint64_t *pool, int *refcnt, avl_tree_t *avl) return (found != NULL); } -void +static void spa_aux_activate(vdev_t *vd, avl_tree_t *avl) { spa_aux_t search, *found; diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 83c39d119..03360120a 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -2857,7 +2857,7 @@ vdev_construct_zaps(vdev_t *vd, dmu_tx_t *tx) } } -void +static void vdev_dtl_sync(vdev_t *vd, uint64_t txg) { spa_t *spa = vd->vdev_spa; diff --git a/module/zfs/vdev_indirect.c b/module/zfs/vdev_indirect.c index bfae40b6d..ac3e13d37 100644 --- a/module/zfs/vdev_indirect.c +++ b/module/zfs/vdev_indirect.c @@ -966,7 +966,7 @@ typedef struct remap_segment { list_node_t rs_node; } remap_segment_t; -remap_segment_t * +static remap_segment_t * rs_alloc(vdev_t *vd, uint64_t offset, uint64_t asize, uint64_t split_offset) { remap_segment_t *rs = kmem_alloc(sizeof (remap_segment_t), KM_SLEEP); @@ -990,7 +990,7 @@ rs_alloc(vdev_t *vd, uint64_t offset, uint64_t asize, uint64_t split_offset) * Finally, since we are doing an allocation, it is up to the caller to * free the array allocated in this function. */ -vdev_indirect_mapping_entry_phys_t * +static vdev_indirect_mapping_entry_phys_t * vdev_indirect_mapping_duplicate_adjacent_entries(vdev_t *vd, uint64_t offset, uint64_t asize, uint64_t *copied_entries) { @@ -1858,7 +1858,6 @@ vdev_ops_t vdev_indirect_ops = { .vdev_op_leaf = B_FALSE /* leaf vdev */ }; -EXPORT_SYMBOL(rs_alloc); EXPORT_SYMBOL(spa_condense_fini); EXPORT_SYMBOL(spa_start_indirect_condensing_thread); EXPORT_SYMBOL(spa_condense_indirect_start_sync); diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c index 844bca79c..81cfd5cce 100644 --- a/module/zfs/vdev_label.c +++ b/module/zfs/vdev_label.c @@ -1588,7 +1588,7 @@ vdev_uberblock_sync(zio_t *zio, uint64_t *good_writes, } /* Sync the uberblocks to all vdevs in svd[] */ -int +static int vdev_uberblock_sync_list(vdev_t **svd, int svdcount, uberblock_t *ub, int flags) { spa_t *spa = svd[0]->vdev_spa; @@ -1705,7 +1705,7 @@ vdev_label_sync(zio_t *zio, uint64_t *good_writes, nvlist_free(label); } -int +static int vdev_label_sync_list(spa_t *spa, int l, uint64_t txg, int flags) { list_t *dl = &spa->spa_config_dirty_list; diff --git a/module/zfs/vdev_queue.c b/module/zfs/vdev_queue.c index b61ba39d7..e31271dcb 100644 --- a/module/zfs/vdev_queue.c +++ b/module/zfs/vdev_queue.c @@ -212,7 +212,7 @@ int zfs_vdev_def_queue_depth = 32; */ int zfs_vdev_aggregate_trim = 0; -int +static int vdev_queue_offset_compare(const void *x1, const void *x2) { const zio_t *z1 = (const zio_t *)x1; @@ -244,7 +244,7 @@ vdev_queue_type_tree(vdev_queue_t *vq, zio_type_t t) return (&vq->vq_trim_offset_tree); } -int +static int vdev_queue_timestamp_compare(const void *x1, const void *x2) { const zio_t *z1 = (const zio_t *)x1; diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c index 33e951afc..644f4bab1 100644 --- a/module/zfs/zap_micro.c +++ b/module/zfs/zap_micro.c @@ -230,7 +230,7 @@ zap_name_alloc(zap_t *zap, const char *key, matchtype_t mt) return (zn); } -zap_name_t * +static zap_name_t * zap_name_alloc_uint64(zap_t *zap, const uint64_t *key, int numints) { zap_name_t *zn = kmem_alloc(sizeof (zap_name_t), KM_SLEEP); diff --git a/module/zfs/zfs_byteswap.c b/module/zfs/zfs_byteswap.c index 1b8bb82c3..cd35849c3 100644 --- a/module/zfs/zfs_byteswap.c +++ b/module/zfs/zfs_byteswap.c @@ -30,6 +30,9 @@ #include <sys/zfs_sa.h> #include <sys/zfs_acl.h> +#ifndef _KERNEL +static +#endif void zfs_oldace_byteswap(ace_t *ace, int ace_cnt) { @@ -46,6 +49,9 @@ zfs_oldace_byteswap(ace_t *ace, int ace_cnt) /* * swap ace_t and ace_object_t */ +#ifndef _KERNEL +static +#endif void zfs_ace_byteswap(void *buf, size_t size, boolean_t zfs_layout) { diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index e98e7af15..8debed924 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -735,13 +735,13 @@ zfs_secpolicy_send_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) ZFS_DELEG_PERM_SEND, cr)); } -int +static int zfs_secpolicy_share(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { return (SET_ERROR(ENOTSUP)); } -int +static int zfs_secpolicy_smb_acl(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { return (SET_ERROR(ENOTSUP)); @@ -6421,7 +6421,7 @@ zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) } /* ARGSUSED */ -int +static int send_space_sum(objset_t *os, void *buf, int len, void *arg) { uint64_t *size = arg; @@ -6876,7 +6876,7 @@ zfs_ioctl_register_dataset_modify(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func, DATASET_NAME, B_TRUE, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); } -void +static void zfs_ioctl_init(void) { zfs_ioctl_register("snapshot", ZFS_IOC_SNAPSHOT, @@ -7259,7 +7259,7 @@ zfs_check_input_nvpairs(nvlist_t *innvl, const zfs_ioc_vec_t *vec) return (0); } -int +static int pool_status_check(const char *name, zfs_ioc_namecheck_t type, zfs_ioc_poolcheck_t check) { diff --git a/module/zfs/zil.c b/module/zfs/zil.c index 50b3b1434..9dc20ba14 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -602,7 +602,7 @@ zil_free_lwb(zilog_t *zilog, lwb_t *lwb) * Called when we create in-memory log transactions so that we know * to cleanup the itxs at the end of spa_sync(). */ -void +static void zilog_dirty(zilog_t *zilog, uint64_t txg) { dsl_pool_t *dp = zilog->zl_dmu_pool; @@ -628,7 +628,7 @@ zilog_dirty(zilog_t *zilog, uint64_t txg) * dirtied (zil_itx_assign) or cleaned (zil_clean) while we check its current * state. */ -boolean_t +static boolean_t __maybe_unused zilog_is_dirty_in_txg(zilog_t *zilog, uint64_t txg) { dsl_pool_t *dp = zilog->zl_dmu_pool; @@ -642,7 +642,7 @@ zilog_is_dirty_in_txg(zilog_t *zilog, uint64_t txg) * Determine if the zil is dirty. The zil is considered dirty if it has * any pending itx records that have not been cleaned by zil_clean(). */ -boolean_t +static boolean_t zilog_is_dirty(zilog_t *zilog) { dsl_pool_t *dp = zilog->zl_dmu_pool; diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 0de502cee..93d6b115c 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -2083,7 +2083,7 @@ zio_execute(zio_t *zio) * enough to allow zio_execute() to be called recursively. A minimum * stack size of 16K is required to avoid needing to re-dispatch the zio. */ -boolean_t +static boolean_t zio_execute_stack_check(zio_t *zio) { #if !defined(HAVE_LARGE_STACKS) diff --git a/module/zfs/zio_checksum.c b/module/zfs/zio_checksum.c index ab1e9494e..f8fee78c6 100644 --- a/module/zfs/zio_checksum.c +++ b/module/zfs/zio_checksum.c @@ -100,7 +100,7 @@ abd_checksum_off(abd_t *abd, uint64_t size, } /*ARGSUSED*/ -void +static void abd_fletcher_2_native(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { @@ -110,7 +110,7 @@ abd_fletcher_2_native(abd_t *abd, uint64_t size, } /*ARGSUSED*/ -void +static void abd_fletcher_2_byteswap(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { |