freebsd-skq/sys/fs/devfs
Hans Petter Selasky 07da61a6cc Streamline use of cdevpriv and correct some corner cases.
1) It is not useful to call "devfs_clear_cdevpriv()" from
"d_close" callbacks, hence for example read, write, ioctl and
so on might be sleeping at the time of "d_close" being called
and then then freed private data can still be accessed.
Examples: dtrace, linux_compat, ksyms (all fixed by this patch)

2) In sys/dev/drm* there are some cases in which memory will
be freed twice, if open fails, first by code in the open
routine, secondly by the cdevpriv destructor. Move registration
of the cdevpriv to the end of the drm open routines.

3) devfs_clear_cdevpriv() is not called if the "d_open" callback
registered cdevpriv data and the "d_open" callback function
returned an error. Fix this.

Discussed with:	phk
MFC after:	2 weeks
2012-08-15 16:19:39 +00:00
..
devfs_devs.c Merge si_name and __si_namebuf. 2012-02-10 12:40:50 +00:00
devfs_dir.c Add reference counting for devfs paths containing user created symbolic 2010-09-27 17:47:09 +00:00
devfs_int.h Format prototypes to follow style(9) more closely. 2010-10-12 15:58:52 +00:00
devfs_rule.c Introduce the "ruleset=number" option for devfs(5) mounts. 2012-02-09 10:09:12 +00:00
devfs_vfsops.c Add "export" to devfs_opts[] and return EOPNOTSUPP if called with it. 2012-02-29 16:16:36 +00:00
devfs_vnops.c Streamline use of cdevpriv and correct some corner cases. 2012-08-15 16:19:39 +00:00
devfs.h Introduce the "ruleset=number" option for devfs(5) mounts. 2012-02-09 10:09:12 +00:00