svn commit: r245661 - in stable/9/sys: kern sys
Konstantin Belousov
kib at FreeBSD.org
Sat Jan 19 06:27:40 UTC 2013
Author: kib
Date: Sat Jan 19 06:27:39 2013
New Revision: 245661
URL: http://svnweb.freebsd.org/changeset/base/245661
Log:
MFC r245406:
Add vfs_hash_index().
Modified:
stable/9/sys/kern/vfs_hash.c
stable/9/sys/sys/vnode.h
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/kern/vfs_hash.c
==============================================================================
--- stable/9/sys/kern/vfs_hash.c Sat Jan 19 06:24:17 2013 (r245660)
+++ stable/9/sys/kern/vfs_hash.c Sat Jan 19 06:27:39 2013 (r245661)
@@ -54,6 +54,13 @@ vfs_hashinit(void *dummy __unused)
/* Must be SI_ORDER_SECOND so desiredvnodes is available */
SYSINIT(vfs_hash, SI_SUB_VFS, SI_ORDER_SECOND, vfs_hashinit, NULL);
+u_int
+vfs_hash_index(struct vnode *vp)
+{
+
+ return (vp->v_hash + vp->v_mount->mnt_hashseed);
+}
+
static struct vfs_hash_head *
vfs_hash_bucket(const struct mount *mp, u_int hash)
{
Modified: stable/9/sys/sys/vnode.h
==============================================================================
--- stable/9/sys/sys/vnode.h Sat Jan 19 06:24:17 2013 (r245660)
+++ stable/9/sys/sys/vnode.h Sat Jan 19 06:27:39 2013 (r245661)
@@ -810,6 +810,7 @@ extern struct vop_vector default_vnodeop
typedef int vfs_hash_cmp_t(struct vnode *vp, 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);
+u_int vfs_hash_index(struct vnode *vp);
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);
More information about the svn-src-stable-9
mailing list