From 4207c279d473b2762e19d7d70bca9b9f6c45e7d5 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 18 Apr 2006 08:05:08 +0000 Subject: [PATCH] In vfs_hash_get(): mount point should never be changed so explicitly constify the mp parameter. Reviewed by: phk --- sys/kern/vfs_hash.c | 4 ++-- sys/sys/vnode.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_hash.c b/sys/kern/vfs_hash.c index 5523c569a66b..80c2dc5938ef 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 dd51d9200e68..ed027a7c37be 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);