freebsd-nq/sys/fs
Konstantin Belousov 82f4d64035 Implement the per-open file data for the cdev.
The patch does not change the cdevsw KBI. Management of the data is
provided by the functions
int	devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t dtr);
int	devfs_get_cdevpriv(void **datap);
void	devfs_clear_cdevpriv(void);
All of the functions are supposed to be called from the cdevsw method
contexts.

- devfs_set_cdevpriv assigns the priv as private data for the file
  descriptor which is used to initiate currently performed driver
  operation. dtr is the function that will be called when either the
  last refernce to the file goes away, the device is destroyed  or
  devfs_clear_cdevpriv is called.
- devfs_get_cdevpriv is the obvious accessor.
- devfs_clear_cdevpriv allows to clear the private data for the still
  open file.

Implementation keeps the driver-supplied pointers in the struct
cdev_privdata, that is referenced both from the struct file and struct
cdev, and cannot outlive any of the referee.

Man pages will be provided after the KPI stabilizes.

Reviewed by:	jhb
Useful suggestions from:	jeff, antoine
Debugging help and tested by:	pho
MFC after:	1 month
2008-05-21 09:31:44 +00:00
..
cd9660 Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
coda Add the support for the AT_FDCWD and fd-relative name lookups to the 2008-03-31 12:01:21 +00:00
deadfs Below is slightly edited description of the LOR by Tor Egge: 2007-01-22 11:25:22 +00:00
devfs Implement the per-open file data for the cdev. 2008-05-21 09:31:44 +00:00
fdescfs The temporary workaround for the call to the vget() without lock type in 2008-04-04 09:37:57 +00:00
fifofs Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
hpfs Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
msdosfs Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
ntfs lockinit() can't accept LK_EXCLUSIVE as an initializaiton flag, so just 2008-05-15 21:39:25 +00:00
nullfs Add the support for the AT_FDCWD and fd-relative name lookups to the 2008-03-31 12:01:21 +00:00
nwfs Replace lockmgr lock protecting nwfs vnode hash table with an sx lock. 2008-03-02 19:02:30 +00:00
portalfs vn_lock() is currently only used with the 'curthread' passed as argument. 2008-01-10 01:10:58 +00:00
procfs Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
pseudofs Introduce some functions in the vnode locks namespace and in the ffs 2008-02-24 16:38:58 +00:00
smbfs Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
tmpfs Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
udf Fix and speedup timestamp calculations which is roughly based on the patch in 2008-05-16 22:31:17 +00:00
unionfs - change function name from *_vdir to *_vnode because 2008-05-07 05:32:55 +00:00