mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
The description of fd_mtx is "filedesc structure."
This commit is contained in:
parent
0e93a9b535
commit
5cf4bcebbf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93384
@ -359,7 +359,7 @@ proc0_init(void *dummy __unused)
|
||||
/* Create the file descriptor table. */
|
||||
fdp = &filedesc0;
|
||||
p->p_fd = &fdp->fd_fd;
|
||||
mtx_init(&fdp->fd_fd.fd_mtx, "struct filedesc", MTX_DEF);
|
||||
mtx_init(&fdp->fd_fd.fd_mtx, FILEDESC_LOCK_DESC, MTX_DEF);
|
||||
fdp->fd_fd.fd_refcnt = 1;
|
||||
fdp->fd_fd.fd_cmask = cmask;
|
||||
fdp->fd_fd.fd_ofiles = fdp->fd_dfiles;
|
||||
|
@ -1167,7 +1167,7 @@ fdinit(td)
|
||||
|
||||
MALLOC(newfdp, struct filedesc0 *, sizeof(struct filedesc0),
|
||||
M_FILEDESC, M_WAITOK | M_ZERO);
|
||||
mtx_init(&newfdp->fd_fd.fd_mtx, "filedesc structure", MTX_DEF);
|
||||
mtx_init(&newfdp->fd_fd.fd_mtx, FILEDESC_LOCK_DESC, MTX_DEF);
|
||||
FILEDESC_LOCK(&newfdp->fd_fd);
|
||||
newfdp->fd_fd.fd_cdir = fdp->fd_cdir;
|
||||
if (newfdp->fd_fd.fd_cdir)
|
||||
@ -1228,7 +1228,7 @@ fdcopy(td)
|
||||
bcopy(fdp, newfdp, sizeof(struct filedesc));
|
||||
FILEDESC_UNLOCK(fdp);
|
||||
bzero(&newfdp->fd_mtx, sizeof(newfdp->fd_mtx));
|
||||
mtx_init(&newfdp->fd_mtx, "filedesc structure", MTX_DEF);
|
||||
mtx_init(&newfdp->fd_mtx, FILEDESC_LOCK_DESC, MTX_DEF);
|
||||
if (newfdp->fd_cdir)
|
||||
VREF(newfdp->fd_cdir);
|
||||
if (newfdp->fd_rdir)
|
||||
|
@ -132,6 +132,8 @@ SLIST_HEAD(sigiolst, sigio);
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#define FILEDESC_LOCK_DESC "filedesc structure"
|
||||
|
||||
/* Lock a file descriptor table. */
|
||||
#define FILEDESC_LOCK(fd) mtx_lock(&(fd)->fd_mtx)
|
||||
#define FILEDESC_UNLOCK(fd) mtx_unlock(&(fd)->fd_mtx)
|
||||
|
Loading…
Reference in New Issue
Block a user