netatalk
netatalk copied to clipboard
Revisit doubly linked list implementation
There is a doubly linked list implementation in include/atalk/list.h ostensibly borrowed from the Linux kernel and lacking proper attribution. At a glance only a few functions are used in only a few spots: in cnid.c and the Spotlight code.
This is to look into other libraries or perhaps rewriting the essential functions.
There are strong similarities to this early version of include/linux/list.h from the Linux kernel:
https://elixir.bootlin.com/linux/2.1.45/source/include/linux/list.h
Even better comparison is this very first revision (April 2005) of list.h from the official kernel git mirror:
https://github.com/torvalds/linux/blob/1da177e4c3f41524e886b7f1b8a0c1fc7321cac2/include/linux/list.h
The logic is practically identical to our version, albeit with slightly different interfaces. Ours has less features too.
Discarding for now. I feel more comfortable now that the code we're using is indeed originating with the Linux kernel and can be redistributed under the GNU GPL v2
Going even further back, this June 2002 revision is almost entirely identical.
https://github.com/tbodt/linux-history/blob/b9a78e5991e18eb4c5f93d2d58e19f1708528dae/include/linux/list.h
For future consideration: util-linux has a mostly compatible reimplementation which has clearer attribution, and seeing active development. This could be an option for forking.
https://github.com/util-linux/util-linux/blob/master/include/list.h