Poul-Henning Kamp d986dbb448 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().
2004-12-14 09:09:51 +00:00
..
2004-11-25 12:08:16 +00:00
2004-11-08 18:22:22 +00:00
2004-11-04 07:59:57 +00:00
2004-11-30 12:18:53 +00:00
2004-12-13 12:57:21 +00:00
2004-11-30 03:23:35 +00:00
2004-07-10 21:43:23 +00:00
2004-08-19 20:16:09 +00:00
2004-10-25 12:27:03 +00:00
2004-11-17 09:09:55 +00:00
2004-11-17 09:09:55 +00:00
2004-11-25 12:08:16 +00:00
2004-06-17 17:16:53 +00:00
2004-05-30 20:34:58 +00:00
2004-11-04 07:59:57 +00:00
2004-11-16 08:22:06 +00:00
2004-11-16 08:22:06 +00:00