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:
parent
c28c69ebf9
commit
b3883074cb
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user