DragonFly kernel List (threaded) for 2012-07
Re: devfs_get/set_cdevpriv functions from FreeBSD
-----BEGIN PGP SIGNED MESSAGE-----
On 17/07/12 09:11, Markus Pfeiffer wrote:
> Question is now: Should we have similar functionality (i.e. per
> open filedescriptor "private" data) and if yes how to best
> implement that. I know that AlexH had made some suggestion but I
> cannot find it in the IRC logs and it would probably be more
> efficient doing this by mail.
My original suggestion, which is straight forward to implement, is to
just store the fp in each of the devfs_fo_* operations somewhere (e.g.
curthread like FreeBSD, although that isn't all that nice), and then
clean it up on devfs_fo_close.
Having that, you can easily implement the rest to set up some list or
tree or whatever inside a cdev that is also passed to the function.
the search key would then be the fp that you stored somewhere whilst
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----