Rich Maes
Rich Maes

Reputation: 1222

When did owner disappear from the net_device struct? 'struct net_device' has no member named 'owner'

Isn't owner supposed to be part of the net_device structure? I saw threads indicating the macro SET_MODULE_OWNER (which assigned the member) was/is/potentially being deprecated, but I thought I understood that the member would remain in the structure. Did it disappear at some version of the kernel?

Upvotes: 1

Views: 259

Answers (1)

Sam Protsenko
Sam Protsenko

Reputation: 14763

Modern kernel git repository doesn't have this change. You can use full kernel history repository to find out the change:

$ git log -S'struct module *owner;' -- include/linux/netdevice.h

shows this commit:

Author: David S. Miller <[email protected]>
Date:   Mon May 19 04:30:48 2003 -0700

    [NET]: Fix netdevice unregister races.

Wow, it was 13 years ago, pretty old stuff. Here is the commit itself: link. And the change you are looking for:

-       /* open/release and usage marking */
-       struct module *owner;

So it looks like (from the patch) that you can just forget about that owner stuff. To figure out the kernel version when this commit was done:

$ git tag --contains 558d700c48 | head -1

which shows v2.6.0. And previous tag is v2.4.0. So it was done between 2.4 and 2.6.

Actually, by googling the patch name, we can find out that it was added exactly in 2.5.70 version.

The same can be done to figure out where SET_MODULE_OWNER has gone. This patch removes it:

Author: Ralf Baechle <[email protected]>
Date:   Mon Sep 17 13:11:17 2007 -0700

    [NET]: Nuke SET_MODULE_OWNER macro.

And the whole patch can be seen here. Patch was merged in v2.6.24.

Upvotes: 1

Related Questions