diff options
author | David Malone <dwmalone@FreeBSD.org> | 2003-08-04 21:28:57 +0000 |
---|---|---|
committer | David Malone <dwmalone@FreeBSD.org> | 2003-08-04 21:28:57 +0000 |
commit | d2cce3d6e83a62ef982fb2fccf30d49b8559212e (patch) | |
tree | c9a9c08ec8d172189d451bf5f992b882c5108b89 /sys/kern/kern_descrip.c | |
parent | 35f9ba02ce4d2e28dea913845b6e39e12fc26001 (diff) | |
download | src-d2cce3d6e83a62ef982fb2fccf30d49b8559212e.tar.gz src-d2cce3d6e83a62ef982fb2fccf30d49b8559212e.zip |
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.
Notes
Notes:
svn path=/head/; revision=118448
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index be1a30fead70..c2a6eea5066c 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); } |