summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-06-26 15:53:11 +0000
committerarr <arr@FreeBSD.org>2002-06-26 15:53:11 +0000
commit614440e53d44acce999382a2a966be14f0e990aa (patch)
treefba6e1d839a1cf392605add682212ac40682f11b /sys
parentde4e8e7ae4d354a77e8b4d2a1eccc031b9094939 (diff)
downloadFreeBSD-src-614440e53d44acce999382a2a966be14f0e990aa.zip
FreeBSD-src-614440e53d44acce999382a2a966be14f0e990aa.tar.gz
- Remove the Giant acquisition from linux_socket_ioctl() as it was really
there to protect fdrop() (which in turn can call vrele()), however, fdrop_locked() grabs Giant for us, so we do not have to. Reviewed by: jhb Inspired by: alc
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linux/linux_ioctl.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index 3b97b44..77e2942 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -2027,15 +2027,10 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args)
ifp = NULL;
error = 0;
- mtx_lock(&Giant);
- if ((error = fget(td, args->fd, &fp)) != 0) {
- mtx_unlock(&Giant);
+ if ((error = fget(td, args->fd, &fp)) != 0)
return (error);
- }
type = fp->f_type;
fdrop(fp, td);
- mtx_unlock(&Giant);
-
if (type != DTYPE_SOCKET) {
/* not a socket - probably a tap / vmnet device */
switch (args->cmd) {
@@ -2243,14 +2238,10 @@ linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args)
struct file *fp;
int error, type;
- mtx_lock(&Giant);
- if ((error = fget(td, args->fd, &fp)) != 0) {
- mtx_unlock(&Giant);
+ if ((error = fget(td, args->fd, &fp)) != 0)
return (error);
- }
type = fp->f_type;
fdrop(fp, td);
- mtx_unlock(&Giant);
if (type == DTYPE_SOCKET)
return (linux_ioctl_socket(td, args));
return (ENOIOCTL);
OpenPOWER on IntegriCloud