summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_generic.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-11-17 09:09:55 +0000
committerphk <phk@FreeBSD.org>2004-11-17 09:09:55 +0000
commitd6a49a1565bec352a92f40326206665b53769de2 (patch)
tree3e96ca6c2f3203ce32ec61d3746561cf0c4bd761 /sys/kern/sys_generic.c
parent313ccfcf9e23e29fc79adcefe9b9e1b52f7643ff (diff)
downloadFreeBSD-src-d6a49a1565bec352a92f40326206665b53769de2.zip
FreeBSD-src-d6a49a1565bec352a92f40326206665b53769de2.tar.gz
Push Giant down through ioctl.
Don't grab Giant in the upper syscall/wrapper code NET_LOCK_GIANT in the socket code (sockets/fifos). mtx_lock(&Giant) in the vnode code. mtx_lock(&Giant) in the opencrypto code. (This may actually not be needed, but better safe than sorry). Devfs grabs Giant if the driver is marked as needing Giant.
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r--sys/kern/sys_generic.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index c90ce5c..fae094c 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -474,10 +474,8 @@ ioctl(struct thread *td, struct ioctl_args *uap)
if ((error = fget(td, uap->fd, &fp)) != 0)
return (error);
- mtx_lock(&Giant);
if ((fp->f_flag & (FREAD | FWRITE)) == 0) {
fdrop(fp, td);
- mtx_unlock(&Giant);
return (EBADF);
}
fdp = td->td_proc->p_fd;
@@ -487,14 +485,12 @@ ioctl(struct thread *td, struct ioctl_args *uap)
fdp->fd_ofileflags[uap->fd] &= ~UF_EXCLOSE;
FILEDESC_UNLOCK_FAST(fdp);
fdrop(fp, td);
- mtx_unlock(&Giant);
return (0);
case FIOCLEX:
FILEDESC_LOCK_FAST(fdp);
fdp->fd_ofileflags[uap->fd] |= UF_EXCLOSE;
FILEDESC_UNLOCK_FAST(fdp);
fdrop(fp, td);
- mtx_unlock(&Giant);
return (0);
}
@@ -508,7 +504,6 @@ ioctl(struct thread *td, struct ioctl_args *uap)
((com & IOC_VOID) && size > 0) ||
((com & (IOC_IN | IOC_OUT)) && size == 0)) {
fdrop(fp, td);
- mtx_unlock(&Giant);
return (ENOTTY);
}
@@ -524,7 +519,6 @@ ioctl(struct thread *td, struct ioctl_args *uap)
if (error) {
free(memp, M_IOCTLOPS);
fdrop(fp, td);
- mtx_unlock(&Giant);
return (error);
}
} else if (com & IOC_OUT) {
@@ -561,7 +555,6 @@ ioctl(struct thread *td, struct ioctl_args *uap)
if (memp != NULL)
free(memp, M_IOCTLOPS);
fdrop(fp, td);
- mtx_unlock(&Giant);
return (error);
}
OpenPOWER on IntegriCloud