Next FILEDESC_LOCK properly around FILE_LOCK

This commit is contained in:
Poul-Henning Kamp 2004-11-15 21:26:13 +00:00
parent 6d1ab6edac
commit 718fe8e2bf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137748
2 changed files with 4 additions and 4 deletions

View file

@ -1015,8 +1015,8 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
if (fp->f_count == 1) {
KASSERT(fdp->fd_ofiles[indx] != fp,
("Open file descriptor lost all refs"));
FILEDESC_UNLOCK(fdp);
FILE_UNLOCK(fp);
FILEDESC_UNLOCK(fdp);
VOP_UNLOCK(vp, 0, td);
vn_close(vp, flags & FMASK, fp->f_cred, td);
mtx_unlock(&Giant);
@ -1032,8 +1032,8 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
fp->f_ops = &vnops;
fp->f_seqcount = 1;
fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE);
FILEDESC_UNLOCK(fdp);
FILE_UNLOCK(fp);
FILEDESC_UNLOCK(fdp);
/* assert that vn_open created a backing object if one is needed */
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,

View file

@ -1015,8 +1015,8 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
if (fp->f_count == 1) {
KASSERT(fdp->fd_ofiles[indx] != fp,
("Open file descriptor lost all refs"));
FILEDESC_UNLOCK(fdp);
FILE_UNLOCK(fp);
FILEDESC_UNLOCK(fdp);
VOP_UNLOCK(vp, 0, td);
vn_close(vp, flags & FMASK, fp->f_cred, td);
mtx_unlock(&Giant);
@ -1032,8 +1032,8 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
fp->f_ops = &vnops;
fp->f_seqcount = 1;
fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE);
FILEDESC_UNLOCK(fdp);
FILE_UNLOCK(fp);
FILEDESC_UNLOCK(fdp);
/* assert that vn_open created a backing object if one is needed */
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,