summaryrefslogtreecommitdiffstats
path: root/module/os
diff options
context:
space:
mode:
authorArvind Sankar <[email protected]>2020-06-15 14:30:37 -0400
committerBrian Behlendorf <[email protected]>2020-06-18 12:20:38 -0700
commit65c7cc49bfcf49d38fc84552a17d7e8a3268e58e (patch)
tree4740b896f8b5fc114ae9a96c6581776799ffeb3a /module/os
parent1fa5c7af3314b4c556bd86e3a49e3497a5ed72ed (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/os')
-rw-r--r--module/os/freebsd/spl/callb.c4
-rw-r--r--module/os/freebsd/zfs/zfs_acl.c2
-rw-r--r--module/os/freebsd/zfs/zfs_ctldir.c8
-rw-r--r--module/os/freebsd/zfs/zfs_vfsops.c2
-rw-r--r--module/os/freebsd/zfs/zfs_vnops.c16
-rw-r--r--module/os/freebsd/zfs/zfs_znode.c2
-rw-r--r--module/os/linux/spl/spl-generic.c2
-rw-r--r--module/os/linux/zfs/spa_stats.c2
-rw-r--r--module/os/linux/zfs/zfs_acl.c6
-rw-r--r--module/os/linux/zfs/zfs_vfsops.c4
-rw-r--r--module/os/linux/zfs/zfs_vnops.c2
-rw-r--r--module/os/linux/zfs/zfs_znode.c6
-rw-r--r--module/os/linux/zfs/zpl_file.c2
-rw-r--r--module/os/linux/zfs/zpl_inode.c6
-rw-r--r--module/os/linux/zfs/zpl_xattr.c5
-rw-r--r--module/os/linux/zfs/zvol_os.c2
16 files changed, 37 insertions, 34 deletions
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)
{