From ebbfc2f82d330ab6e2b510077dc9e35b2000a504 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 10 Feb 2005 12:25:38 +0000 Subject: [PATCH] Make various mountpoint related functions static. --- sys/kern/vfs_export.c | 7 +++---- sys/kern/vfs_init.c | 6 ++++-- sys/kern/vfs_mount.c | 8 +++++--- sys/sys/mount.h | 6 ------ 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 523e0f33e0f..c4dcd77f912 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -58,6 +58,7 @@ static void vfs_free_addrlist(struct netexport *nep); static int vfs_free_netcred(struct radix_node *rn, void *w); static int vfs_hang_addrlist(struct mount *mp, struct netexport *nep, struct export_args *argp); +static struct netcred *vfs_export_lookup(struct mount *, struct sockaddr *); /* * Network address lookup element @@ -344,10 +345,8 @@ vfs_setpublicfs(mp, nep, argp) * to struct netcred so that the filesystem can examine it for * access rights (read/write/etc). */ -struct netcred * -vfs_export_lookup(mp, nam) - register struct mount *mp; - struct sockaddr *nam; +static struct netcred * +vfs_export_lookup(struct mount *mp, struct sockaddr *nam) { struct netexport *nep; register struct netcred *np; diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 61d26755574..77b37d92db2 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include +static int vfs_register(struct vfsconf *); +static int vfs_unregister(struct vfsconf *); MALLOC_DEFINE(M_VNODE, "vnodes", "Dynamically allocated vnodes"); @@ -138,7 +140,7 @@ vfs_byname_kld(const char *fstype, struct thread *td, int *error) /* Register a new filesystem type in the global table */ -int +static int vfs_register(struct vfsconf *vfc) { struct sysctl_oid *oidp; @@ -249,7 +251,7 @@ vfs_register(struct vfsconf *vfc) /* Remove registration of a filesystem type */ -int +static int vfs_unregister(struct vfsconf *vfc) { struct vfsconf *vfsp; diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index f204598ec5b..0d4f1018157 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -81,6 +81,8 @@ static int vfs_mountroot_ask(void); static int vfs_mountroot_try(const char *mountfrom); static int vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions); +static void free_mntarg(struct mntarg *ma); +static void vfs_mount_destroy(struct mount *, struct thread *); static int usermount = 0; SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, @@ -145,7 +147,7 @@ char *rootdevnames[2] = {NULL, NULL}; #ifndef ROOTDEVNAME # define ROOTDEVNAME NULL #endif -const char *ctrootdevname = ROOTDEVNAME; +static const char *ctrootdevname = ROOTDEVNAME; /* * --------------------------------------------------------------------- @@ -433,7 +435,7 @@ vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp, /* * Destroy the mount struct previously allocated by vfs_mount_alloc(). */ -void +static void vfs_mount_destroy(struct mount *mp, struct thread *td) { @@ -1642,7 +1644,7 @@ mount_arg(struct mntarg *ma, const char *name, const void *val, int len) /* * Free a mntarg structure */ -void +static void free_mntarg(struct mntarg *ma) { struct mntaarg *maa; diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 2c7b9b8a41f..481092b516b 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -580,7 +580,6 @@ extern char *mountrootfsname; int dounmount(struct mount *, int, struct thread *); -void free_mntarg(struct mntarg *ma); int kernel_mount(struct mntarg *ma, int flags); int kernel_vmount(int flags, ...); struct mntarg *mount_arg(struct mntarg *ma, const char *name, const void *val, int len); @@ -604,8 +603,6 @@ void vfs_unlock(struct mount *); /* unlock a vfs */ int vfs_busy(struct mount *, int, struct mtx *, struct thread *); int vfs_export /* process mount export info */ (struct mount *, struct export_args *); -struct netcred *vfs_export_lookup /* lookup host in fs export list */ - (struct mount *, struct sockaddr *); int vfs_allocate_syncvnode(struct mount *); void vfs_getnewfsid(struct mount *); struct cdev *vfs_getrootfsid(struct mount *); @@ -613,12 +610,9 @@ struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */ int vfs_modevent(module_t, int, void *); void vfs_mountroot(void); /* mount our root filesystem */ void vfs_mountedfrom(struct mount *, const char *from); -void vfs_mount_destroy(struct mount *, struct thread *); int vfs_suser(struct mount *, struct thread *); void vfs_unbusy(struct mount *, struct thread *); void vfs_unmountall(void); -int vfs_register(struct vfsconf *); -int vfs_unregister(struct vfsconf *); extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ extern struct mtx mountlist_mtx; extern struct nfs_public nfs_pub;