aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_mqueue.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2008-03-29 23:30:40 +0000
committerJeff Roberson <jeff@FreeBSD.org>2008-03-29 23:30:40 +0000
commit069c6953a099fceaec3697e1183ff69ef6925a03 (patch)
treeb478903f2e0f3aafe8aeea8762d1890805dab320 /sys/kern/uipc_mqueue.c
parent4c65d593e20994b1ccad2c0bb6f6e1d6b52e2cd3 (diff)
downloadsrc-069c6953a099fceaec3697e1183ff69ef6925a03.tar.gz
src-069c6953a099fceaec3697e1183ff69ef6925a03.zip
- Use vget() to lock the vnode rather than refing without a lock and
locking in separate steps.
Notes
Notes: svn path=/head/; revision=177726
Diffstat (limited to 'sys/kern/uipc_mqueue.c')
-rw-r--r--sys/kern/uipc_mqueue.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c
index 0e6be8fcb641..6013fe2ba409 100644
--- a/sys/kern/uipc_mqueue.c
+++ b/sys/kern/uipc_mqueue.c
@@ -704,12 +704,9 @@ mqfs_allocv(struct mount *mp, struct vnode **vpp, struct mqfs_node *pn)
}
if (vd != NULL) {
- if (vget(vd->mv_vnode, 0, curthread) == 0) {
- *vpp = vd->mv_vnode;
- vn_lock(*vpp, LK_RETRY | LK_EXCLUSIVE);
- return (0);
- }
- /* XXX if this can happen, we're in trouble */
+ *vpp = vd->mv_vnode;
+ vget(*vpp, LK_RETRY | LK_EXCLUSIVE, curthread);
+ return (0);
}
error = getnewvnode("mqueue", mp, &mqfs_vnodeops, vpp);