diff options
author | alfred <alfred@FreeBSD.org> | 2002-01-20 22:58:08 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-01-20 22:58:08 +0000 |
commit | 1d6432ede3d9347bff05575e2e59a970c49ba052 (patch) | |
tree | 63dce2bd478a5c2c0c0942971eefa5a08844afd0 /sys/sys/file.h | |
parent | 5a34a0d3bb35b4a49c1c17b4ad15e78c968f8564 (diff) | |
download | FreeBSD-src-1d6432ede3d9347bff05575e2e59a970c49ba052.zip FreeBSD-src-1d6432ede3d9347bff05575e2e59a970c49ba052.tar.gz |
use mutex pools for "struct file" locking.
fix indentation of FILE_LOCK/UNLOCK macros while I'm here.
Diffstat (limited to 'sys/sys/file.h')
-rw-r--r-- | sys/sys/file.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/file.h b/sys/sys/file.h index 6986a38..b8a17c2 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -105,7 +105,7 @@ struct file { off_t f_offset; caddr_t f_data; /* vnode or socket */ u_int f_flag; /* see fcntl.h */ - struct mtx f_mtx; /* mutex to protect data */ + struct mtx *f_mtxp; /* mutex to protect data */ }; #ifdef MALLOC_DECLARE @@ -128,10 +128,10 @@ int fdrop __P((struct file *fp, struct thread *td)); int fdrop_locked __P((struct file *fp, struct thread *td)); /* Lock a file. */ -#define FILE_LOCK(f) mtx_lock(&(f)->f_mtx) -#define FILE_UNLOCK(f) mtx_unlock(&(f)->f_mtx) -#define FILE_LOCKED(f) mtx_owned(&(f)->f_mtx) -#define FILE_LOCK_ASSERT(f, type) mtx_assert(&(f)->f_mtx, (type)) +#define FILE_LOCK(f) mtx_lock((f)->f_mtxp) +#define FILE_UNLOCK(f) mtx_unlock((f)->f_mtxp) +#define FILE_LOCKED(f) mtx_owned((f)->f_mtxp) +#define FILE_LOCK_ASSERT(f, type) mtx_assert((f)->f_mtxp, (type)) int fgetvp __P((struct thread *td, int fd, struct vnode **vpp)); int fgetvp_read __P((struct thread *td, int fd, struct vnode **vpp)); |