datapath: linux2.7 s/pid/portid/g
authorIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 19 Dec 2012 08:43:10 +0000 (17:43 +0900)
committerJesse Gross <jesse@nicira.com>
Thu, 20 Dec 2012 22:58:01 +0000 (14:58 -0800)
the following up of 15e473046cb6e5d18a4d0057e61d76315230382b
This patch replaces pid with portid under datapath/linux/compat

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux/compat/genetlink.inc
datapath/linux/compat/include/linux/rtnetlink.h
datapath/linux/compat/include/net/genetlink.h
datapath/linux/compat/include/net/netlink.h

index bf96980..ad2630f 100644 (file)
@@ -86,33 +86,33 @@ err_out:
  * nlmsg_notify - send a notification netlink message
  * @sk: netlink socket to use
  * @skb: notification message
- * @pid: destination netlink pid for reports or 0
+ * @portid: destination netlink portid for reports or 0
  * @group: destination multicast group or 0
  * @report: 1 to report back, 0 to disable
  * @flags: allocation flags
  */
-int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 pid,
+int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 portid,
                 unsigned int group, int report, gfp_t flags)
 {
        int err = 0;
 
        if (group) {
-               int exclude_pid = 0;
+               int exclude_portid = 0;
 
                if (report) {
                        atomic_inc(&skb->users);
-                       exclude_pid = pid;
+                       exclude_portid = portid;
                }
 
                /* errors reported via destination sk->sk_err, but propagate
                 * delivery errors if NETLINK_BROADCAST_ERROR flag is set */
-               err = nlmsg_multicast(sk, skb, exclude_pid, group, flags);
+               err = nlmsg_multicast(sk, skb, exclude_portid, group, flags);
        }
 
        if (report) {
                int err2;
 
-               err2 = nlmsg_unicast(sk, skb, pid);
+               err2 = nlmsg_unicast(sk, skb, portid);
                if (!err || err == -ESRCH)
                        err = err2;
        }
@@ -124,7 +124,7 @@ int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 pid,
 /* This is analogous to rtnl_notify() but uses genl_sock instead of rtnl.
  *
  * This is not (yet) in any upstream kernel. */
-void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
+void genl_notify(struct sk_buff *skb, struct net *net, u32 portid, u32 group,
                 struct nlmsghdr *nlh, gfp_t flags)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
@@ -137,12 +137,12 @@ void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
        if (nlh)
                report = nlmsg_report(nlh);
 
-       nlmsg_notify(sk, skb, pid, group, report, flags);
+       nlmsg_notify(sk, skb, portid, group, report, flags);
 }
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
 /* This function wasn't exported before 2.6.30.  Lose! */
-void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code)
+void netlink_set_err(struct sock *ssk, u32 portid, u32 group, int code)
 {
 }
 #endif
index 0a02149..151f823 100644 (file)
@@ -6,7 +6,7 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
-static inline void rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
+static inline void rtnl_notify(struct sk_buff *skb, u32 portid, u32 group,
                               struct nlmsghdr *nlh, gfp_t flags)
 {
        BUG_ON(nlh != NULL);            /* not implemented */
@@ -23,14 +23,14 @@ static inline void rtnl_set_sk_err(u32 group, int error)
 #endif
 
 /* No 'net' parameter in these versions. */
-#define rtnl_notify(skb, net, pid, group, nlh, flags) \
-                   ((void) rtnl_notify(skb, pid, group, nlh, flags))
+#define rtnl_notify(skb, net, portid, group, nlh, flags) \
+                   ((void) rtnl_notify(skb, portid, group, nlh, flags))
 #define rtnl_set_sk_err(net, group, error) \
                        (rtnl_set_sk_err(group, error))
 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
 /* Make the return type effectively 'void' to match Linux 2.6.30+. */
-#define rtnl_notify(skb, net, pid, group, nlh, flags) \
-       ((void) rtnl_notify(skb, net, pid, group, nlh, flags))
+#define rtnl_notify(skb, net, portid, group, nlh, flags) \
+       ((void) rtnl_notify(skb, net, portid, group, nlh, flags))
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
index 31ff282..ac199ec 100644 (file)
@@ -37,7 +37,7 @@
 #define nlmsg_multicast busted_nlmsg_multicast
 #define genlmsg_multicast busted_genlmsg_multicast
 extern int busted_nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
-                                 u32 pid, unsigned int group);
+                                 u32 portid, unsigned int group);
 #endif /* linux kernel < v2.6.19 */
 
 #include_next <net/genetlink.h>
@@ -97,14 +97,14 @@ static inline int genlmsg_total_size(int payload)
 #define genlmsg_multicast(s, p, g, f) \
                genlmsg_multicast_flags((s), (p), (g), (f))
 
-static inline int genlmsg_multicast_flags(struct sk_buff *skb, u32 pid,
+static inline int genlmsg_multicast_flags(struct sk_buff *skb, u32 portid,
                unsigned int group, gfp_t flags)
 {
        int err;
 
        NETLINK_CB(skb).dst_group = group;
 
-       err = netlink_broadcast(genl_sock, skb, pid, group, flags);
+       err = netlink_broadcast(genl_sock, skb, portid, group, flags);
        if (err > 0)
                err = 0;
 
@@ -113,8 +113,8 @@ static inline int genlmsg_multicast_flags(struct sk_buff *skb, u32 pid,
 #endif /* linux kernel < 2.6.19 */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-#define genlmsg_multicast_netns(net, skb, pid, grp, flags) \
-               genlmsg_multicast(skb, pid, grp, flags)
+#define genlmsg_multicast_netns(net, skb, portid, grp, flags) \
+               genlmsg_multicast(skb, portid, grp, flags)
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
@@ -168,10 +168,10 @@ int genl_register_family_with_ops(struct genl_family *family,
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
-#define genl_notify(skb, net, pid, group, nlh, flags) \
-       genl_notify(skb, pid, group, nlh, flags)
+#define genl_notify(skb, net, portid, group, nlh, flags) \
+       genl_notify(skb, portid, group, nlh, flags)
 #endif
-extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid,
+extern void genl_notify(struct sk_buff *skb, struct net *net, u32 portid,
                        u32 group, struct nlmsghdr *nlh, gfp_t flags);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) && \
@@ -183,6 +183,6 @@ static inline struct net *genl_info_net(struct genl_info *info)
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-#define genlmsg_unicast(ignore_net, skb, pid)   genlmsg_unicast(skb, pid)
+#define genlmsg_unicast(ignore_net, skb, portid)   genlmsg_unicast(skb, portid)
 #endif
 #endif /* genetlink.h */
index 14041e2..9616ea9 100644 (file)
@@ -145,7 +145,7 @@ static inline int nlmsg_report(const struct nlmsghdr *nlh)
 }
 
 extern int             nlmsg_notify(struct sock *sk, struct sk_buff *skb,
-                                    u32 pid, unsigned int group, int report,
+                                    u32 portid, unsigned int group, int report,
                                     gfp_t flags);
 #endif /* linux kernel < 2.6.19 */
 
@@ -156,13 +156,13 @@ extern int                nlmsg_notify(struct sock *sk, struct sk_buff *skb,
  * argument. */
 #define nlmsg_multicast rpl_nlmsg_multicast
 static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
-                                 u32 pid, unsigned int group, gfp_t flags)
+                                 u32 portid, unsigned int group, gfp_t flags)
 {
        int err;
 
        NETLINK_CB(skb).dst_group = group;
 
-       err = netlink_broadcast(sk, skb, pid, group, flags);
+       err = netlink_broadcast(sk, skb, portid, group, flags);
        if (err > 0)
                err = 0;