fdinit() does not need to lock the filedesc it is creating as no one

besideds itself has access until the function returns.
This commit is contained in:
alfred 2003-01-01 00:35:46 +00:00
parent c28c69ebf9
commit b3883074cb

View File

@ -1214,7 +1214,6 @@ fdinit(td)
MALLOC(newfdp, struct filedesc0 *, sizeof(struct filedesc0),
M_FILEDESC, M_WAITOK | M_ZERO);
mtx_init(&newfdp->fd_fd.fd_mtx, FILEDESC_LOCK_DESC, NULL, MTX_DEF);
FILEDESC_LOCK(&newfdp->fd_fd);
newfdp->fd_fd.fd_cdir = fdp->fd_cdir;
if (newfdp->fd_fd.fd_cdir)
VREF(newfdp->fd_fd.fd_cdir);
@ -1232,8 +1231,6 @@ fdinit(td)
newfdp->fd_fd.fd_ofileflags = newfdp->fd_dfileflags;
newfdp->fd_fd.fd_nfiles = NDFILE;
newfdp->fd_fd.fd_knlistsize = -1;
FILEDESC_UNLOCK(&newfdp->fd_fd);
return (&newfdp->fd_fd);
}