summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/init_sysent.c8
-rw-r--r--sys/kern/syscalls.c2
-rw-r--r--sys/kern/vfs_extattr.c20
-rw-r--r--sys/kern/vfs_syscalls.c20
-rw-r--r--sys/sys/syscall.h2
-rw-r--r--sys/sys/syscall.mk2
-rw-r--r--sys/sys/sysproto.h2
7 files changed, 30 insertions, 26 deletions
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index e72f77b..a5728e2 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.168 2004/03/15 18:48:28 jhb Exp
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.169 2004/03/16 10:41:23 dwmalone Exp
*/
#include "opt_compat.h"
@@ -28,15 +28,15 @@
/* The casts are bogus but will do for now. */
struct sysent sysent[] = {
- { 0, (sy_call_t *)nosys }, /* 0 = syscall */
+ { SYF_MPSAFE | 0, (sy_call_t *)nosys }, /* 0 = syscall */
{ SYF_MPSAFE | AS(sys_exit_args), (sy_call_t *)sys_exit }, /* 1 = exit */
{ SYF_MPSAFE | 0, (sy_call_t *)fork }, /* 2 = fork */
{ SYF_MPSAFE | AS(read_args), (sy_call_t *)read }, /* 3 = read */
{ SYF_MPSAFE | AS(write_args), (sy_call_t *)write }, /* 4 = write */
- { AS(open_args), (sy_call_t *)open }, /* 5 = open */
+ { SYF_MPSAFE | AS(open_args), (sy_call_t *)open }, /* 5 = open */
{ SYF_MPSAFE | AS(close_args), (sy_call_t *)close }, /* 6 = close */
{ SYF_MPSAFE | AS(wait_args), (sy_call_t *)wait4 }, /* 7 = wait4 */
- { compat(AS(ocreat_args),creat) }, /* 8 = old creat */
+ { compat(SYF_MPSAFE | AS(ocreat_args),creat) }, /* 8 = old creat */
{ AS(link_args), (sy_call_t *)link }, /* 9 = link */
{ AS(unlink_args), (sy_call_t *)unlink }, /* 10 = unlink */
{ 0, (sy_call_t *)nosys }, /* 11 = obsolete execv */
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index 46a836e..81f7720 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.168 2004/03/15 18:48:28 jhb Exp
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.169 2004/03/16 10:41:23 dwmalone Exp
*/
const char *syscallnames[] = {
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index d06ba27..98e2b69 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -920,6 +920,8 @@ change_root(vp, td)
/*
* Check permissions, allocate an open file structure,
* and call the device open routine if any.
+ *
+ * MP SAFE
*/
#ifndef _SYS_SYSPROTO_H_
struct open_args {
@@ -968,8 +970,10 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT;
NDINIT(&nd, LOOKUP, FOLLOW, pathseg, path, td);
td->td_dupfd = -1; /* XXX check for fdopen */
+ mtx_lock(&Giant);
error = vn_open(&nd, &flags, cmode, indx);
if (error) {
+ mtx_unlock(&Giant);
/*
* If the vn_open replaced the method vector, something
@@ -1040,6 +1044,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
FILE_UNLOCK(fp);
VOP_UNLOCK(vp, 0, td);
vn_close(vp, flags & FMASK, fp->f_cred, td);
+ mtx_unlock(&Giant);
fdrop(fp, td);
td->td_retval[0] = indx;
return (0);
@@ -1091,6 +1096,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
if (error)
goto bad;
}
+ mtx_unlock(&Giant);
/*
* Release our private reference, leaving the one associated with
* the descriptor table intact.
@@ -1099,6 +1105,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
td->td_retval[0] = indx;
return (0);
bad:
+ mtx_unlock(&Giant);
FILEDESC_LOCK(fdp);
if (fdp->fd_ofiles[indx] == fp) {
fdp->fd_ofiles[indx] = NULL;
@@ -1115,6 +1122,8 @@ bad:
#ifdef COMPAT_43
/*
* Create a file.
+ *
+ * MP SAFE
*/
#ifndef _SYS_SYSPROTO_H_
struct ocreat_args {
@@ -1130,16 +1139,9 @@ ocreat(td, uap)
int mode;
} */ *uap;
{
- struct open_args /* {
- char *path;
- int flags;
- int mode;
- } */ nuap;
- nuap.path = uap->path;
- nuap.mode = uap->mode;
- nuap.flags = O_WRONLY | O_CREAT | O_TRUNC;
- return (open(td, &nuap));
+ return (kern_open(td, uap->path, UIO_USERSPACE,
+ O_WRONLY | O_CREAT | O_TRUNC, uap->mode));
}
#endif /* COMPAT_43 */
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index d06ba27..98e2b69 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -920,6 +920,8 @@ change_root(vp, td)
/*
* Check permissions, allocate an open file structure,
* and call the device open routine if any.
+ *
+ * MP SAFE
*/
#ifndef _SYS_SYSPROTO_H_
struct open_args {
@@ -968,8 +970,10 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT;
NDINIT(&nd, LOOKUP, FOLLOW, pathseg, path, td);
td->td_dupfd = -1; /* XXX check for fdopen */
+ mtx_lock(&Giant);
error = vn_open(&nd, &flags, cmode, indx);
if (error) {
+ mtx_unlock(&Giant);
/*
* If the vn_open replaced the method vector, something
@@ -1040,6 +1044,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
FILE_UNLOCK(fp);
VOP_UNLOCK(vp, 0, td);
vn_close(vp, flags & FMASK, fp->f_cred, td);
+ mtx_unlock(&Giant);
fdrop(fp, td);
td->td_retval[0] = indx;
return (0);
@@ -1091,6 +1096,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
if (error)
goto bad;
}
+ mtx_unlock(&Giant);
/*
* Release our private reference, leaving the one associated with
* the descriptor table intact.
@@ -1099,6 +1105,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
td->td_retval[0] = indx;
return (0);
bad:
+ mtx_unlock(&Giant);
FILEDESC_LOCK(fdp);
if (fdp->fd_ofiles[indx] == fp) {
fdp->fd_ofiles[indx] = NULL;
@@ -1115,6 +1122,8 @@ bad:
#ifdef COMPAT_43
/*
* Create a file.
+ *
+ * MP SAFE
*/
#ifndef _SYS_SYSPROTO_H_
struct ocreat_args {
@@ -1130,16 +1139,9 @@ ocreat(td, uap)
int mode;
} */ *uap;
{
- struct open_args /* {
- char *path;
- int flags;
- int mode;
- } */ nuap;
- nuap.path = uap->path;
- nuap.mode = uap->mode;
- nuap.flags = O_WRONLY | O_CREAT | O_TRUNC;
- return (open(td, &nuap));
+ return (kern_open(td, uap->path, UIO_USERSPACE,
+ O_WRONLY | O_CREAT | O_TRUNC, uap->mode));
}
#endif /* COMPAT_43 */
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index e484319..7420b08 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.168 2004/03/15 18:48:28 jhb Exp
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.169 2004/03/16 10:41:23 dwmalone Exp
*/
#define SYS_syscall 0
diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk
index 10b653b..ddb4d4c 100644
--- a/sys/sys/syscall.mk
+++ b/sys/sys/syscall.mk
@@ -1,7 +1,7 @@
# FreeBSD system call names.
# DO NOT EDIT-- this file is automatically generated.
# $FreeBSD$
-# created from FreeBSD: src/sys/kern/syscalls.master,v 1.168 2004/03/15 18:48:28 jhb Exp
+# created from FreeBSD: src/sys/kern/syscalls.master,v 1.169 2004/03/16 10:41:23 dwmalone Exp
MIASM = \
syscall.o \
exit.o \
diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h
index 067b787..775beee 100644
--- a/sys/sys/sysproto.h
+++ b/sys/sys/sysproto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.168 2004/03/15 18:48:28 jhb Exp
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.169 2004/03/16 10:41:23 dwmalone Exp
*/
#ifndef _SYS_SYSPROTO_H_
OpenPOWER on IntegriCloud