Deleted Added
full compact
uipc_mqueue.c (175140) uipc_mqueue.c (175202)
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 29 unchanged lines hidden (view full) ---

38 * times at different mount points but shows same contents.
39 *
40 * 2) Standard POSIX message queue API. The syscalls do not use vfs layer,
41 * but directly operate on internal data structure, this allows user to
42 * use the IPC facility without having to mount mqueue file system.
43 */
44
45#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 29 unchanged lines hidden (view full) ---

38 * times at different mount points but shows same contents.
39 *
40 * 2) Standard POSIX message queue API. The syscalls do not use vfs layer,
41 * but directly operate on internal data structure, this allows user to
42 * use the IPC facility without having to mount mqueue file system.
43 */
44
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: head/sys/kern/uipc_mqueue.c 175140 2008-01-07 20:05:19Z jhb $");
46__FBSDID("$FreeBSD: head/sys/kern/uipc_mqueue.c 175202 2008-01-10 01:10:58Z attilio $");
47
48#include <sys/param.h>
49#include <sys/kernel.h>
50#include <sys/systm.h>
51#include <sys/limits.h>
52#include <sys/buf.h>
53#include <sys/dirent.h>
54#include <sys/event.h>

--- 646 unchanged lines hidden (view full) ---

701 LIST_FOREACH(vd, &pn->mn_vnodes, mv_link) {
702 if (vd->mv_vnode->v_mount == mp)
703 break;
704 }
705
706 if (vd != NULL) {
707 if (vget(vd->mv_vnode, 0, curthread) == 0) {
708 *vpp = vd->mv_vnode;
47
48#include <sys/param.h>
49#include <sys/kernel.h>
50#include <sys/systm.h>
51#include <sys/limits.h>
52#include <sys/buf.h>
53#include <sys/dirent.h>
54#include <sys/event.h>

--- 646 unchanged lines hidden (view full) ---

701 LIST_FOREACH(vd, &pn->mn_vnodes, mv_link) {
702 if (vd->mv_vnode->v_mount == mp)
703 break;
704 }
705
706 if (vd != NULL) {
707 if (vget(vd->mv_vnode, 0, curthread) == 0) {
708 *vpp = vd->mv_vnode;
709 vn_lock(*vpp, LK_RETRY | LK_EXCLUSIVE,
710 curthread);
709 vn_lock(*vpp, LK_RETRY | LK_EXCLUSIVE);
711 return (0);
712 }
713 /* XXX if this can happen, we're in trouble */
714 }
715
716 error = getnewvnode("mqueue", mp, &mqfs_vnodeops, vpp);
717 if (error)
718 return (error);
710 return (0);
711 }
712 /* XXX if this can happen, we're in trouble */
713 }
714
715 error = getnewvnode("mqueue", mp, &mqfs_vnodeops, vpp);
716 if (error)
717 return (error);
719 vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread);
718 vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
720 error = insmntque(*vpp, mp);
721 if (error != 0) {
722 *vpp = NULLVP;
723 return (error);
724 }
725 vd = uma_zalloc(mvdata_zone, M_WAITOK);
726 (*vpp)->v_data = vd;
727 vd->mv_vnode = *vpp;

--- 91 unchanged lines hidden (view full) ---

819 if (dvp->v_vflag & VV_ROOT)
820 return (EIO);
821 if ((flags & ISLASTCN) && nameiop != LOOKUP)
822 return (EINVAL);
823 VOP_UNLOCK(dvp, 0, cnp->cn_thread);
824 KASSERT(pd->mn_parent, ("non-root directory has no parent"));
825 pn = pd->mn_parent;
826 error = mqfs_allocv(dvp->v_mount, vpp, pn);
719 error = insmntque(*vpp, mp);
720 if (error != 0) {
721 *vpp = NULLVP;
722 return (error);
723 }
724 vd = uma_zalloc(mvdata_zone, M_WAITOK);
725 (*vpp)->v_data = vd;
726 vd->mv_vnode = *vpp;

--- 91 unchanged lines hidden (view full) ---

818 if (dvp->v_vflag & VV_ROOT)
819 return (EIO);
820 if ((flags & ISLASTCN) && nameiop != LOOKUP)
821 return (EINVAL);
822 VOP_UNLOCK(dvp, 0, cnp->cn_thread);
823 KASSERT(pd->mn_parent, ("non-root directory has no parent"));
824 pn = pd->mn_parent;
825 error = mqfs_allocv(dvp->v_mount, vpp, pn);
827 vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
826 vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
828 return (error);
829 }
830
831 /* named node */
832 pn = mqfs_search(pd, pname, namelen);
833
834 /* found */
835 if (pn != NULL) {

--- 1654 unchanged lines hidden ---
827 return (error);
828 }
829
830 /* named node */
831 pn = mqfs_search(pd, pname, namelen);
832
833 /* found */
834 if (pn != NULL) {

--- 1654 unchanged lines hidden ---