netatalk icon indicating copy to clipboard operation
netatalk copied to clipboard

Revisit doubly linked list implementation

Open rdmark opened this issue 1 year ago • 4 comments

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.

rdmark avatar Jul 13 '24 00:07 rdmark

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

rdmark avatar Sep 29 '24 00:09 rdmark

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

rdmark avatar Nov 07 '24 18:11 rdmark

Going even further back, this June 2002 revision is almost entirely identical.

https://github.com/tbodt/linux-history/blob/b9a78e5991e18eb4c5f93d2d58e19f1708528dae/include/linux/list.h

rdmark avatar May 09 '25 11:05 rdmark

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

rdmark avatar May 09 '25 20:05 rdmark