Re: Where did vm_operations_struct->unmap in 2.4.0 go?

Christian Zander (phoenix@minion.de)
Fri, 12 Jan 2001 20:11:30 +0100


--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> >> I ran into this while hacking the Nvidia kernel driver to work with
> >> 2.4.0. I got the driver working but it's not 100%
> >>=20
> >> Also where did get_module_symbol() and put_module_symbol() go?
> >
> >Patches for the NVIDIA binary X drivers following all these kernel
> >changes can be gotten from IRC server irc.openprojects.net, channel
> >#nvidia. Or from http://ex.shafted.com.au/nvidia/
>=20
> And what a pile of crud those patches are!! Instead of using the clean
> replacement interface for get_module_symbol, nvidia/patch-2.4.0-PR hard
> codes the old get_module_symbol algorithm as inline code.
>=20
> This patch violates the modules interface by accessing modules.c
> internal data. It still suffers from all the problems that
> get_module_symbol had. Because it is hard coded as inline code instead
> of a common function, will be much harder to fix when it breaks.
>=20

The way I understand the inter_module mechanism, module A registers one
or several of its symbols using inter_module_register to make it or them=20
available to other modules. Module B can then request any of the symbols
with inter_module_request and get a pointer. The inter_module mechanism=20
guarantees that the symbol will be available until module B decides that=20
the symbol is no longer needed and releases it by calling inter_module_put.

Saying that I should have made use of this mechanism for the specific
code in the Nvidia driver that we are talking about clearly shows that
you didn't look at it. The module used get_module_symbol to search its
own symbol table for parameters that may have been passed to it at load
time. Arguably, this is bad practise, but it is also the reason why using
your mechanism doesn't make any sense. Obviously, the module wouldn't
want to register private data to request it later on; the information
that would have to be passed to inter_module_register is the same that
the code in question intends to retrieve in the first place.

Contrary to what you're saying, the patch does not just inline the old
get_module_symbol algorithm nor does it access any of module.c's internal
data. What is does is to browse the list of the modules's _own_ symbols=20
looking for a match. If it finds one, it returns the desired data.

> Whoever coded that patch should be taken out and shot, hung, drawn and
> quartered then forced to write COBOL for the rest of their natural
> life.

Excellent comment - it is just as appropriate as it is helpful.

--
----------------------------------------------------------------------
 christian zander              we come to bury dos, not to praise it.
 zander@hdz.uni-dortmund.de    -- paul vojta
----------------------------------------------------------------------

--mYCpIKhGyMATD0i+ Content-Type: application/pgp-signature Content-Disposition: inline

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org

iD8DBQE6X1biY28vJpqNKtcRAi05AJ9ASxjv4kxoqPXTfX2hNQSYr1TQnACfbjOc YuTNcsFbsxqrIgkm4Sqau20= =3Gmv -----END PGP SIGNATURE-----

--mYCpIKhGyMATD0i+-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/