summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2006-04-18 08:05:08 +0000
committerdelphij <delphij@FreeBSD.org>2006-04-18 08:05:08 +0000
commit0c90800cc68dbc996e5e2c5ff15d88797a7b4724 (patch)
treeab04114269242e3560b181769bb1eccd44671909
parentb591c1981835cde1d8ba2d9f053ec25c8c7656d6 (diff)
downloadFreeBSD-src-0c90800cc68dbc996e5e2c5ff15d88797a7b4724.zip
FreeBSD-src-0c90800cc68dbc996e5e2c5ff15d88797a7b4724.tar.gz
In vfs_hash_get(): mount point should never be changed
so explicitly constify the mp parameter. Reviewed by: phk
-rw-r--r--sys/kern/vfs_hash.c4
-rw-r--r--sys/sys/vnode.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_hash.c b/sys/kern/vfs_hash.c
index 5523c56..80c2dc5 100644
--- a/sys/kern/vfs_hash.c
+++ b/sys/kern/vfs_hash.c
@@ -55,14 +55,14 @@ vfs_hashinit(void *dummy __unused)
SYSINIT(vfs_hash, SI_SUB_VFS, SI_ORDER_SECOND, vfs_hashinit, NULL)
static struct vfs_hash_head *
-vfs_hash_index(struct mount *mp, u_int hash)
+vfs_hash_index(const struct mount *mp, u_int hash)
{
return(&vfs_hash_tbl[(hash + mp->mnt_hashseed) & vfs_hash_mask]);
}
int
-vfs_hash_get(struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg)
+vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg)
{
struct vnode *vp;
int error;
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index dd51d92..ed027a7 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -719,7 +719,7 @@ extern struct vop_vector default_vnodeops;
/* vfs_hash.c */
typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg);
-int vfs_hash_get(struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg);
+int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg);
int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg);
void vfs_hash_rehash(struct vnode *vp, u_int hash);
void vfs_hash_remove(struct vnode *vp);
OpenPOWER on IntegriCloud