DEVFS - Use v_associate_rdev; fix vcount/count_dev
authorAlex Hornung <ahornung@gmail.com>
Wed, 5 Aug 2009 22:41:54 +0000 (23:41 +0100)
committerAlex Hornung <ahornung@gmail.com>
Thu, 6 Aug 2009 00:40:58 +0000 (01:40 +0100)
commit9b8235015ece1ea902691f71bb66952cc76b85a9
tree73eed06bde28a078dba3c2e49d6a9768699ff73d
parent2c27251623f3bc3271e9339c3fd8e63a1b3a32cf
DEVFS - Use v_associate_rdev; fix vcount/count_dev

to avoid trouble with both vrevoke() and the drm code which calls
vm_mmap, which in turn expects a vnode as handle, but drm only has
a cdev. If associate_rdev is used, the cdev will have a list of
vnodes currently in use  associated with it.

- This fixes a problem with drm which caused a panic when used.

- count_dev, which is used by vcount, now returns the vnodes'
opencount instead of the number of references.

Reported-By: Johannes Hofmann
sys/kern/vfs_subr.c
sys/vfs/devfs/devfs_core.c
sys/vfs/devfs/devfs_vnops.c