DragonFly users List (threaded) for 2012-10
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: Replacing FBSD mutexes
--nVMJ2NtxeReIH9PS
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Dear Petr,
On Fri, Oct 26, 2012 at 09:21:48AM +1100, elekktretterr@exemail.com.au wrot=
e:
> Thanks Markus.
>=20
> I'm not sure what's the reasoning behind using those functions to set and
> retreive a pointer in the first place?
>=20
The functions store per-fd data for the driver. As far as I understand this=
is
used to handle multiple opens of a device.=20
> I have nvidia_ctl_open which uses devfs_set_cdevpri(struct filep)
>=20
> and then nvidia_ctl_close retrieves the pointer to filep via
> devfs_get_cdevpri.
>=20
>
Are you sure it is not used in an ioctl or read/write somewhere?
> Is it OK to store filep in the compilation-unit scope and access it when
> needed?
I think in usb4bsd I stored the pointer for one open in the device structur=
e.
Obviously that is not per-fd, but for testing purposes where you only do one
open it was enough.
At the moment I am busy chasing down a bug in the xhci driver of usb4bsd. T=
he
patch implmenting per-fd data is a little bit more involved since it requir=
es
passing the fp down the whole device stack as far as I recall.
Markus
--=20
Markus Pfeiffer, University Manchester
email: markus.pfeiffer@morphism.de | xmpp: markus.pfeiffer@jabber.morphism.=
de
--nVMJ2NtxeReIH9PS
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)
iQIcBAEBAgAGBQJQikCxAAoJEEYIAIuHgtZG0X8P/0qx/QDm15oYpNQlmYQOJCTu
wKzZCsaCiIpx5qWZBibpDbvlXh1VayR9ey5PKfxHvIwjuIFqpK9tGnESb4GBJrWi
WzEaPDHiKFa/+m1sYJbGEaxMpbtIvMg0iEBiCTjiR+sOxdPnV/77fgtnvD9qeyGn
kd5NK5tkhTbRllMEAs91z+dtgOiCDajLp6m7BqDmhfcIDqvtOa+GuV3rWFO5FEyk
846PBjrZ2w43R3X12nDu9+WUYxcbAOmsXcV+FiVTH9fHvytBNidBMHxp+yYfFmdr
pYFOZOmBPJA39SACUZWhZtqQahj6ztK+s8ruTzbgPNluW8gd+zLD8ARhXbKr2EWU
9UOjwqNcpMkXpjZEAvKM7dZe8RKeoHlzXnAJolcZpitJ/PTr/MqwvjThbVzxS2WT
fnpTAb15MobfkgxkeOwtLUWjjQDfyReGTS1MvZZsUwhf2/hSrvJ76Wn4W38H/eH8
a9PPooYYmlLLjVskQT/W47vjdjyaSUJzAE8TwSfUThUvc3o+/RKX8t+lPNZiD6LU
uCURsF6xNYozu7XJcNnoFkIXDWX3UdwNvFdpJDbS20QA/1L8UFPODKPrU5sKph5H
LOlNs1LXOL2qL+bbuuA5jjIKp5V3htGMCEn2z0uXxsmWWX56IQJVZ7unL8LuNzoj
zNBLLurt8XpHGM6T6TSE
=GBfi
-----END PGP SIGNATURE-----
--nVMJ2NtxeReIH9PS--
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]