The description of fd_mtx is "filedesc structure."

This commit is contained in:
Seigo Tanimura 2002-03-29 11:26:05 +00:00
parent 0e93a9b535
commit 5cf4bcebbf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93384
3 changed files with 5 additions and 3 deletions

View file

@ -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;

View file

@ -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)

View file

@ -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)