From: Luis R. Rodriguez Date: Wed, 12 Sep 2012 00:39:59 +0000 (-0700) Subject: compat: backport netlink pid to portid rename X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=22e6331ef33f90c28f5b299d82983fdca12645b7;p=openwrt%2Fstaging%2Fblogic.git compat: backport netlink pid to portid rename The patch: commit 15e473046cb6e5d18a4d0057e61d76315230382b Author: Eric W. Biederman Date: Fri Sep 7 20:12:54 2012 +0000 netlink: Rename pid to portid to avoid confusion It is a frequent mistake to confuse the netlink port identifier with a process identifier. Try to reduce this confusion by renaming fields that hold port identifiers portid instead of pid. I have carefully avoided changing the structures exported to userspace to avoid changing the userspace API. I have successfully built an allyesconfig kernel with this change. Signed-off-by: "Eric W. Biederman" Acked-by: Stephen Hemminger Signed-off-by: David S. Miller Changed the struct members: struct netlink_notify->pid to struct netlink_notify->portid struct genl_info->snd_pid to struct genl_info->snd_portid This adds helpers to help reduce the overhead cost to backport this collateral evolution. mcgrof@garbanzo ~/compat (git::master)$ time ckmake Trying kernel 3.5.0-030500-generic [OK] Trying kernel 3.4.4-030404-generic [OK] Trying kernel 3.3.7-030307-generic [OK] Trying kernel 3.2.2-030202-generic [OK] Trying kernel 3.1.10-030110-generic [OK] Trying kernel 3.0.18-030018-generic [OK] Trying kernel 2.6.39-02063904-generic [OK] Trying kernel 2.6.38-02063808-generic [OK] Trying kernel 2.6.37-02063706-generic [OK] Trying kernel 2.6.36-02063604-generic [OK] Trying kernel 2.6.35-02063512-generic [OK] Trying kernel 2.6.34-02063410-generic [OK] Trying kernel 2.6.33-02063305-generic [OK] Trying kernel 2.6.32-02063255-generic [OK] Trying kernel 2.6.31-02063113-generic [OK] Trying kernel 2.6.30-02063010-generic [OK] Trying kernel 2.6.29-02062906-generic [OK] Trying kernel 2.6.28-02062810-generic [OK] Trying kernel 2.6.27-020627-generic [OK] Trying kernel 2.6.26-020626-generic [OK] Trying kernel 2.6.25-020625-generic [OK] Trying kernel 2.6.24-020624-generic [OK] real 1m0.017s user 3m12.748s sys 0m30.274s Cc: Eric W. Biederman Cc: Stephen Hemminger Cc: David S. Miller Signed-off-by: Luis R. Rodriguez --- diff --git a/include/linux/compat-3.7.h b/include/linux/compat-3.7.h index 6cee78794b4e..e4e126cad435 100644 --- a/include/linux/compat-3.7.h +++ b/include/linux/compat-3.7.h @@ -10,6 +10,10 @@ #include #include +#define netlink_notify_portid(__notify) (__notify->pid) +#define genl_info_snd_portid(__genl_info) (__genl_info->snd_pid) +#define NETLINK_CB_PORTID(__skb) NETLINK_CB(cb->skb).pid + bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork, unsigned long delay); @@ -55,6 +59,10 @@ static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos, #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ +#else /* (LINUX_VERSION_CODE > KERNEL_VERSION(3,7,0)) */ +#define netlink_notify_portid(__notify) (__notify->portid) +#define genl_info_snd_portid(__genl_info) (__genl_info->snd_portid) +#define NETLINK_CB_PORTID(__skb) NETLINK_CB(cb->skb).portid #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) */ #endif /* LINUX_3_7_COMPAT_H */