vfs_hash_rehash(): require the vnode to be exclusively locked
Rehash updates v_hash. Also, rehash moves the vnode to different hash bucket, which should be noticed in vfs_hash_get() after sleeping for the vnode lock. Reviewed by: mckusick, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31464
This commit is contained in:
parent
7c1e4aab79
commit
f19063ab02
@ -196,6 +196,7 @@ vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td,
|
||||
void
|
||||
vfs_hash_rehash(struct vnode *vp, u_int hash)
|
||||
{
|
||||
ASSERT_VOP_ELOCKED(vp, "rehash requires excl lock");
|
||||
|
||||
rw_wlock(&vfs_hash_lock);
|
||||
LIST_REMOVE(vp, v_hashlist);
|
||||
|
Loading…
Reference in New Issue
Block a user