diff options
author | phk <phk@FreeBSD.org> | 2004-12-14 09:09:51 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-12-14 09:09:51 +0000 |
commit | 8a94ce5ea17343a8b3d2cee98003de0983f20f6c (patch) | |
tree | a124be58d8d15d3196f2e36e300b247427361e0f /sys/kern/kern_condvar.c | |
parent | 8a05c599fb4f8f27a2c63fdb3057d7500581d0f7 (diff) | |
download | FreeBSD-src-8a94ce5ea17343a8b3d2cee98003de0983f20f6c.zip FreeBSD-src-8a94ce5ea17343a8b3d2cee98003de0983f20f6c.tar.gz |
Add a new kind of reference count (fd_holdcnt) to struct filedesc
which holds on to just the data structure and the mutex. (The
existing refcount (fd_refcnt) holds onto the open files in the
descriptor.)
The fd_holdcnt is protected by fdesc_mtx, fd_refcnt by FILEDESC_LOCK.
Add fdhold(struct proc *) which gets a hold on the filedescriptors of
the specified proc..
Add fddrop(struct filedesc *) which drops the fd_holdcnt and if zero
destroys the mutex and frees the memory.
Initialize the fd_holdcnt to one in fdinit(). Normal operations on
the filedesc structure will not change it.
In fdfree() use fddrop() to dispose of the mutex and structure. Hold
the FILEDESC_LOCK() until we have cleaned out the contents and carefully
set the fields to null values during cleanup.
Use fdhold()/fddrop() in mountcheckdirs() and sysctl_kern_file().
Diffstat (limited to 'sys/kern/kern_condvar.c')
0 files changed, 0 insertions, 0 deletions