summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_mqueue.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-03-29 23:30:40 +0000
committerjeff <jeff@FreeBSD.org>2008-03-29 23:30:40 +0000
commit26629f5add30a8592d5c987266c9944bce79c21e (patch)
treeb478903f2e0f3aafe8aeea8762d1890805dab320 /sys/kern/uipc_mqueue.c
parent30e699e8852300dba60327530f0eef6f31687243 (diff)
downloadFreeBSD-src-26629f5add30a8592d5c987266c9944bce79c21e.zip
FreeBSD-src-26629f5add30a8592d5c987266c9944bce79c21e.tar.gz
- Use vget() to lock the vnode rather than refing without a lock and
locking in separate steps.
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 0e6be8f..6013fe2 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);
OpenPOWER on IntegriCloud