summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2003-08-04 21:28:57 +0000
committerdwmalone <dwmalone@FreeBSD.org>2003-08-04 21:28:57 +0000
commitcb188056e62a5c06bc394877c8f8de9d7aaab12a (patch)
treec9a9c08ec8d172189d451bf5f992b882c5108b89 /sys/kern/kern_descrip.c
parent86595fbca8000280383d4bc1addea14e37231afe (diff)
downloadFreeBSD-src-cb188056e62a5c06bc394877c8f8de9d7aaab12a.zip
FreeBSD-src-cb188056e62a5c06bc394877c8f8de9d7aaab12a.tar.gz
Do some minor Giant pushdown made possible by copyin, fget, fdrop,
malloc and mbuf allocation all not requiring Giant. 1) ostat, fstat and nfstat don't need Giant until they call fo_stat. 2) accept can copyin the address length without grabbing Giant. 3) sendit doesn't need Giant, so don't bother grabbing it until kern_sendit. 4) move Giant grabbing from each indivitual recv* syscall to recvit.
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index be1a30f..c2a6eea 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -900,17 +900,17 @@ ofstat(td, uap)
struct ostat oub;
int error;
- mtx_lock(&Giant);
if ((error = fget(td, uap->fd, &fp)) != 0)
goto done2;
+ mtx_lock(&Giant);
error = fo_stat(fp, &ub, td->td_ucred, td);
+ mtx_unlock(&Giant);
if (error == 0) {
cvtstat(&ub, &oub);
error = copyout(&oub, uap->sb, sizeof(oub));
}
fdrop(fp, td);
done2:
- mtx_unlock(&Giant);
return (error);
}
#endif /* COMPAT_43 || COMPAT_SUNOS */
@@ -937,15 +937,15 @@ fstat(td, uap)
struct stat ub;
int error;
- mtx_lock(&Giant);
if ((error = fget(td, uap->fd, &fp)) != 0)
goto done2;
+ mtx_lock(&Giant);
error = fo_stat(fp, &ub, td->td_ucred, td);
+ mtx_unlock(&Giant);
if (error == 0)
error = copyout(&ub, uap->sb, sizeof(ub));
fdrop(fp, td);
done2:
- mtx_unlock(&Giant);
return (error);
}
@@ -972,17 +972,17 @@ nfstat(td, uap)
struct nstat nub;
int error;
- mtx_lock(&Giant);
if ((error = fget(td, uap->fd, &fp)) != 0)
goto done2;
+ mtx_lock(&Giant);
error = fo_stat(fp, &ub, td->td_ucred, td);
+ mtx_unlock(&Giant);
if (error == 0) {
cvtnstat(&ub, &nub);
error = copyout(&nub, uap->sb, sizeof(nub));
}
fdrop(fp, td);
done2:
- mtx_unlock(&Giant);
return (error);
}
OpenPOWER on IntegriCloud