PERFORCE change 42174 for review
Robert Watson
rwatson at FreeBSD.org
Wed Nov 12 22:28:22 GMT 2003
http://perforce.freebsd.org/chv.cgi?CH=42174
Change 42174 by rwatson at rwatson_tislabs on 2003/11/12 14:28:05
Slide Giant a little more, whitespace synchronization to the
version committed to the main FreeBSD source tree.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#433 edit
Differences ...
==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#433 (text+ko) ====
@@ -553,6 +553,9 @@
return (0);
}
+/*
+ * MPSAFE
+ */
int
__mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap)
{
@@ -751,7 +754,6 @@
case DTYPE_FIFO:
case DTYPE_VNODE:
vp = fp->f_vnode;
-
intlabel = mac_vnode_label_alloc();
mtx_lock(&Giant); /* VFS */
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
@@ -762,9 +764,9 @@
buffer, mac.m_buflen);
mac_vnode_label_free(intlabel);
break;
+
case DTYPE_PIPE:
pipe = fp->f_data;
-
intlabel = mac_pipe_label_alloc();
PIPE_LOCK(pipe);
mac_copy_pipe_label(pipe->pipe_label, intlabel);
@@ -773,12 +775,14 @@
buffer, mac.m_buflen);
mac_pipe_label_free(intlabel);
break;
+
default:
error = EINVAL;
}
fdrop(fp, td);
if (error == 0)
error = copyout(buffer, mac.m_string, strlen(buffer)+1);
+
out:
free(buffer, M_MACTEMP);
free(elements, M_MACTEMP);
@@ -937,16 +941,14 @@
mac_vnode_label_free(intlabel);
break;
}
-
vp = fp->f_vnode;
mtx_lock(&Giant); /* VFS */
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
+ mtx_unlock(&Giant); /* VFS */
mac_vnode_label_free(intlabel);
- mtx_unlock(&Giant); /* VFS */
break;
}
-
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
error = vn_setlabel(vp, intlabel, td->td_ucred);
VOP_UNLOCK(vp, 0, td);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list