diff options
author | phk <phk@FreeBSD.org> | 2004-11-13 11:53:02 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-13 11:53:02 +0000 |
commit | 216166ee0de39b10ba8e60f4115d65e1251ff29f (patch) | |
tree | 15f70d195895ba0b6c385bc2892b07302db4faaa /sys/fs/fdescfs | |
parent | 32d92d3a1a6bf10d16cd48469ec464510bd8ff2f (diff) | |
download | FreeBSD-src-216166ee0de39b10ba8e60f4115d65e1251ff29f.zip FreeBSD-src-216166ee0de39b10ba8e60f4115d65e1251ff29f.tar.gz |
Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not
an issue.
The distinction will become significant once we finalize the exact
lock-type to use for this kind of case.
Diffstat (limited to 'sys/fs/fdescfs')
-rw-r--r-- | sys/fs/fdescfs/fdesc_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vnops.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 0b7e403..0e211ad 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -166,7 +166,7 @@ fdesc_statfs(mp, sbp, td) lim = lim_cur(td->td_proc, RLIMIT_NOFILE); PROC_UNLOCK(td->td_proc); fdp = td->td_proc->p_fd; - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); last = min(fdp->fd_nfiles, lim); freefd = 0; for (i = fdp->fd_freefile; i < last; i++) @@ -179,7 +179,7 @@ fdesc_statfs(mp, sbp, td) */ if (fdp->fd_nfiles < lim) freefd += (lim - fdp->fd_nfiles); - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); sbp->f_flags = 0; sbp->f_bsize = DEV_BSIZE; diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index e6c0075..b6d1eea 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -440,7 +440,7 @@ fdesc_readdir(ap) fcnt = i - 2; /* The first two nodes are `.' and `..' */ - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); while (i < fdp->fd_nfiles + 2 && uio->uio_resid >= UIO_MX) { switch (i) { case 0: /* `.' */ @@ -456,7 +456,7 @@ fdesc_readdir(ap) break; default: if (fdp->fd_ofiles[fcnt] == NULL) { - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); goto done; } @@ -470,15 +470,15 @@ fdesc_readdir(ap) /* * And ship to userland */ - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); error = uiomove(dp, UIO_MX, uio); if (error) goto done; - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); i++; fcnt++; } - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); done: uio->uio_offset = i * UIO_MX; |