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/kern/uipc_syscalls.c | |
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/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 54c97d5..63a3a4b 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -117,9 +117,9 @@ getsock(struct filedesc *fdp, int fd, struct file **fpp) if (fdp == NULL) error = EBADF; else { - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); fp = fget_locked(fdp, fd); - if(fp == NULL) + if (fp == NULL) error = EBADF; else if (fp->f_type != DTYPE_SOCKET) { fp = NULL; @@ -128,7 +128,7 @@ getsock(struct filedesc *fdp, int fd, struct file **fpp) fhold(fp); error = 0; } - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); } *fpp = fp; return (error); @@ -170,12 +170,12 @@ socket(td, uap) if (error) { fdclose(fdp, fp, fd, td); } else { - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); fp->f_data = so; /* already has ref count */ fp->f_flag = FREAD|FWRITE; fp->f_ops = &socketops; fp->f_type = DTYPE_SOCKET; - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); td->td_retval[0] = fd; } fdrop(fp, td); |