freebsd-dev/sys
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
..
amd64 Add age(4) to the list of drivers supported by GENERIC kernel. 2008-05-19 02:30:27 +00:00
arm Retire pmap_addr_hint(). It is no longer used. 2008-05-18 04:16:57 +00:00
boot Add an entry for the age(4) module. 2008-05-19 02:13:50 +00:00
bsm Merge OpenBSM 1.0 changes to src/sys/bsm: 2007-10-29 18:47:25 +00:00
cam Locking in the ses_ioctl handler doesn't have to be so strict because 2008-03-17 17:18:16 +00:00
cddl LO_ENROLLPEND is no more existing so just axe it (it was left out by the 2008-05-16 02:09:13 +00:00
compat Fix a panic when it occurred during initializing the ndis driver because 2008-05-15 04:29:28 +00:00
conf Hook up age(4) to the build. 2008-05-19 01:53:47 +00:00
contrib Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
crypto Make test00 compilable again. 2008-01-15 18:34:47 +00:00
ddb Rename debug.ddb.capture.bytes sysctl to debug.ddb.capture.bufoff in 2008-04-25 13:23:36 +00:00
dev Drop Giant before calling kproc_exit(), so we don't trigger assertion in 2008-05-20 12:34:30 +00:00
fs Implement the per-open file data for the cdev. 2008-05-21 09:31:44 +00:00
gdb Commit SYSINIT() ;-adding patch missed in previous pass. 2008-03-16 13:02:04 +00:00
geom - Assert that we don't send new provider event for a provider which has 2008-05-18 22:50:50 +00:00
gnu Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
i4b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
i386 Use the "options " spelling (vs. "options<TAB>") so that commented lines 2008-05-21 03:36:53 +00:00
ia64 We can call ia64_flush_dirty() when the corresponding process is 2008-05-21 05:15:27 +00:00
isa atrtc.c is a repocopy of the RTC device driver from i386/isa/clock.c 2008-04-14 07:57:15 +00:00
kern Implement the per-open file data for the cdev. 2008-05-21 09:31:44 +00:00
libkern Add prototype for __cmpd2(). 2008-02-23 22:40:05 +00:00
mips Retire pmap_addr_hint(). It is no longer used. 2008-05-18 04:16:57 +00:00
modules Hook up age(4) to the build. 2008-05-19 01:53:47 +00:00
net The if_check() function performed three actions: 2008-05-17 03:38:13 +00:00
net80211 declare ieee80211_phymode_name with an array size 2008-05-12 00:34:28 +00:00
netatalk Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
netatm Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
netgraph Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
netinet - Adds support for the multi-asconf (From Kozuka-san) 2008-05-20 13:47:46 +00:00
netinet6 - Adds support for the multi-asconf (From Kozuka-san) 2008-05-20 13:47:46 +00:00
netipsec Remove last bits of OS adaptation code from the IPSec code. 2008-05-17 04:00:11 +00:00
netipx Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
netnatm
netncp lockmgrs need to be released before to be destroyed and draining doesn't 2008-03-30 18:16:33 +00:00
netsmb Really, smb_iod_main() is not totally MPSAFE, so just acquire and drop 2008-03-27 01:23:59 +00:00
nfs Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
nfs4client Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
nfsclient Allow the block size used when booting over NFS to be overridden. It defaults 2008-05-16 06:27:03 +00:00
nfsserver Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
nlm Tighten up the error-handling in nlm_get_rpc. While I'm here, fix a 2008-04-16 09:09:50 +00:00
opencrypto Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
pc98 Resort the if_ti driver to match the PCI Network cards instead of placing 2008-05-17 23:50:00 +00:00
pccard
pci - Set sc->dev to the new-bus device_t so all the device_printf()s work. 2008-05-12 21:34:52 +00:00
powerpc Use the "options " spelling (vs. "options<TAB>") so that commented lines 2008-05-21 03:36:53 +00:00
rpc Fix some issues that showed up during Kris' testing. 2008-04-11 10:34:59 +00:00
security When testing whether to enter the audit argument gathering code, rather 2008-05-06 00:32:23 +00:00
sparc64 Retire pmap_addr_hint(). It is no longer used. 2008-05-18 04:16:57 +00:00
sun4v Use the "options " spelling (vs. "options<TAB>") so that commented lines 2008-05-21 03:36:53 +00:00
sys Implement the per-open file data for the cdev. 2008-05-21 09:31:44 +00:00
tools Introduce a standalone shell script for embedding MFS image. 2008-02-05 10:46:30 +00:00
ufs Allow VM object creation in ufs_lookup. (If vfs.vmiodirenable is set) 2008-05-20 19:05:43 +00:00
vm Allow VM object creation in ufs_lookup. (If vfs.vmiodirenable is set) 2008-05-20 19:05:43 +00:00
xdr Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
Makefile + Use the default cscope names. 2008-05-21 07:56:10 +00:00