]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorDavid S. Miller <davem@davemloft.net>
Thu, 6 Nov 2008 23:52:00 +0000 (15:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Nov 2008 23:52:00 +0000 (15:52 -0800)
13 files changed:
include/linux/if_vlan.h
include/linux/sched.h
include/net/scm.h
net/8021q/vlan_core.c
net/9p/client.c
net/core/dev.c
net/core/scm.c
net/ipv4/tcp.c
net/ipv4/xfrm4_state.c
net/ipv6/addrconf.c
net/ipv6/xfrm6_state.c
net/netfilter/nf_conntrack_helper.c
net/netfilter/nf_conntrack_proto.c

index 9e7b49b8062d64ec5456a0d5ab3b71e97f5f16b9..a5cb0c3f6dcf263834115ef359b11f87803c23d5 100644 (file)
@@ -114,6 +114,8 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
 
 extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
                             u16 vlan_tci, int polling);
+extern int vlan_hwaccel_do_receive(struct sk_buff *skb);
+
 #else
 static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
 {
@@ -133,6 +135,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
        BUG();
        return NET_XMIT_SUCCESS;
 }
+
+static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
+{
+       return 0;
+}
 #endif
 
 /**
index b483f39a7112073e17c6ce8edc2fa0b17c9b61e1..295b7c756ca6107aee29ee4c12e3eb2f486c9f7e 100644 (file)
@@ -1349,6 +1349,8 @@ struct task_struct {
         */
        unsigned long timer_slack_ns;
        unsigned long default_timer_slack_ns;
+
+       struct list_head        *scm_work_list;
 };
 
 /*
index 06df126103cab8224d6cf7ae64c7f00e75f06e12..33e9986beb86dd95d6f3f962ca8a89281c874a9d 100644 (file)
@@ -14,8 +14,9 @@
 
 struct scm_fp_list
 {
-       int             count;
-       struct file     *fp[SCM_MAX_FD];
+       struct list_head        list;
+       int                     count;
+       struct file             *fp[SCM_MAX_FD];
 };
 
 struct scm_cookie
index 916061f681b6484a95af7900311977fca7752ebc..68ced4bf158c7558977e3c4a44ef4567157e80d5 100644 (file)
@@ -3,11 +3,20 @@
 #include <linux/if_vlan.h>
 #include "vlan.h"
 
+struct vlan_hwaccel_cb {
+       struct net_device       *dev;
+};
+
+static inline struct vlan_hwaccel_cb *vlan_hwaccel_cb(struct sk_buff *skb)
+{
+       return (struct vlan_hwaccel_cb *)skb->cb;
+}
+
 /* VLAN rx hw acceleration helper.  This acts like netif_{rx,receive_skb}(). */
 int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
                      u16 vlan_tci, int polling)
 {
-       struct net_device_stats *stats;
+       struct vlan_hwaccel_cb *cb = vlan_hwaccel_cb(skb);
 
        if (skb_bond_should_drop(skb)) {
                dev_kfree_skb_any(skb);
@@ -15,23 +24,35 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
        }
 
        skb->vlan_tci = vlan_tci;
+       cb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);
+
+       return (polling ? netif_receive_skb(skb) : netif_rx(skb));
+}
+EXPORT_SYMBOL(__vlan_hwaccel_rx);
+
+int vlan_hwaccel_do_receive(struct sk_buff *skb)
+{
+       struct vlan_hwaccel_cb *cb = vlan_hwaccel_cb(skb);
+       struct net_device *dev = cb->dev;
+       struct net_device_stats *stats;
+
        netif_nit_deliver(skb);
 
-       skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);
-       if (skb->dev == NULL) {
-               dev_kfree_skb_any(skb);
-               /* Not NET_RX_DROP, this is not being dropped
-                * due to congestion. */
-               return NET_RX_SUCCESS;
+       if (dev == NULL) {
+               kfree_skb(skb);
+               return -1;
        }
-       skb->dev->last_rx = jiffies;
+
+       skb->dev = dev;
+       skb->priority = vlan_get_ingress_priority(dev, skb->vlan_tci);
        skb->vlan_tci = 0;
 
-       stats = &skb->dev->stats;
+       dev->last_rx = jiffies;
+
+       stats = &dev->stats;
        stats->rx_packets++;
        stats->rx_bytes += skb->len;
 
-       skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tci);
        switch (skb->pkt_type) {
        case PACKET_BROADCAST:
                break;
@@ -43,13 +64,12 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
                 * This allows the VLAN to have a different MAC than the
                 * underlying device, and still route correctly. */
                if (!compare_ether_addr(eth_hdr(skb)->h_dest,
-                                       skb->dev->dev_addr))
+                                       dev->dev_addr))
                        skb->pkt_type = PACKET_HOST;
                break;
        };
-       return (polling ? netif_receive_skb(skb) : netif_rx(skb));
+       return 0;
 }
-EXPORT_SYMBOL(__vlan_hwaccel_rx);
 
 struct net_device *vlan_dev_real_dev(const struct net_device *dev)
 {
index 67717f69412e47c182f34715291ec83c979d6f73..0a04faa221160da655732e3382083a397d7ce60f 100644 (file)
@@ -818,7 +818,9 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
        }
 
        P9_DPRINTK(P9_DEBUG_9P, "<<< RATTACH qid %x.%llx.%x\n",
-                                       qid.type, qid.path, qid.version);
+                                       qid.type,
+                                       (unsigned long long)qid.path,
+                                       qid.version);
 
        memmove(&fid->qid, &qid, sizeof(struct p9_qid));
 
@@ -865,7 +867,9 @@ p9_client_auth(struct p9_client *clnt, char *uname, u32 n_uname, char *aname)
        }
 
        P9_DPRINTK(P9_DEBUG_9P, "<<< RAUTH qid %x.%llx.%x\n",
-                                       qid.type, qid.path, qid.version);
+                                       qid.type,
+                                       (unsigned long long)qid.path,
+                                       qid.version);
 
        memmove(&afid->qid, &qid, sizeof(struct p9_qid));
        p9_free_req(clnt, req);
@@ -930,7 +934,8 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames,
 
        for (count = 0; count < nwqids; count++)
                P9_DPRINTK(P9_DEBUG_9P, "<<<     [%d] %x.%llx.%x\n",
-                       count, wqids[count].type, wqids[count].path,
+                       count, wqids[count].type,
+                       (unsigned long long)wqids[count].path,
                        wqids[count].version);
 
        if (nwname)
@@ -980,7 +985,9 @@ int p9_client_open(struct p9_fid *fid, int mode)
        }
 
        P9_DPRINTK(P9_DEBUG_9P, "<<< ROPEN qid %x.%llx.%x iounit %x\n",
-                               qid.type, qid.path, qid.version, iounit);
+                               qid.type,
+                               (unsigned long long)qid.path,
+                               qid.version, iounit);
 
        fid->mode = mode;
        fid->iounit = iounit;
@@ -1023,7 +1030,9 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
        }
 
        P9_DPRINTK(P9_DEBUG_9P, "<<< RCREATE qid %x.%llx.%x iounit %x\n",
-                               qid.type, qid.path, qid.version, iounit);
+                               qid.type,
+                               (unsigned long long)qid.path,
+                               qid.version, iounit);
 
        fid->mode = mode;
        fid->iounit = iounit;
@@ -1230,9 +1239,9 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
                "<<<    name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
                "<<<    uid=%d gid=%d n_muid=%d\n",
                ret->size, ret->type, ret->dev, ret->qid.type,
-               ret->qid.path, ret->qid.version, ret->mode,
-               ret->atime, ret->mtime, ret->length, ret->name,
-               ret->uid, ret->gid, ret->muid, ret->extension,
+               (unsigned long long)ret->qid.path, ret->qid.version, ret->mode,
+               ret->atime, ret->mtime, (unsigned long long)ret->length,
+               ret->name, ret->uid, ret->gid, ret->muid, ret->extension,
                ret->n_uid, ret->n_gid, ret->n_muid);
 
 free_and_error:
@@ -1255,9 +1264,9 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst)
                "     name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
                "     uid=%d gid=%d n_muid=%d\n",
                wst->size, wst->type, wst->dev, wst->qid.type,
-               wst->qid.path, wst->qid.version, wst->mode,
-               wst->atime, wst->mtime, wst->length, wst->name,
-               wst->uid, wst->gid, wst->muid, wst->extension,
+               (unsigned long long)wst->qid.path, wst->qid.version, wst->mode,
+               wst->atime, wst->mtime, (unsigned long long)wst->length,
+               wst->name, wst->uid, wst->gid, wst->muid, wst->extension,
                wst->n_uid, wst->n_gid, wst->n_muid);
        err = 0;
        clnt = fid->clnt;
index d9038e328cc153b2257330934bacd78b12e0f3f1..9174c77d3112c65237cbbd2e063eb55b03b5c39e 100644 (file)
@@ -2218,6 +2218,9 @@ int netif_receive_skb(struct sk_buff *skb)
        int ret = NET_RX_DROP;
        __be16 type;
 
+       if (skb->vlan_tci && vlan_hwaccel_do_receive(skb))
+               return NET_RX_SUCCESS;
+
        /* if we've gotten here through NAPI, check netpoll */
        if (netpoll_receive_skb(skb))
                return NET_RX_DROP;
index 10f5c65f6a470cc914de500b43d63990e89db1b6..ab242cc1accaae7673b76784aa5838a76d9b10c4 100644 (file)
@@ -75,6 +75,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
                if (!fpl)
                        return -ENOMEM;
                *fplp = fpl;
+               INIT_LIST_HEAD(&fpl->list);
                fpl->count = 0;
        }
        fpp = &fpl->fp[fpl->count];
@@ -106,9 +107,25 @@ void __scm_destroy(struct scm_cookie *scm)
 
        if (fpl) {
                scm->fp = NULL;
-               for (i=fpl->count-1; i>=0; i--)
-                       fput(fpl->fp[i]);
-               kfree(fpl);
+               if (current->scm_work_list) {
+                       list_add_tail(&fpl->list, current->scm_work_list);
+               } else {
+                       LIST_HEAD(work_list);
+
+                       current->scm_work_list = &work_list;
+
+                       list_add(&fpl->list, &work_list);
+                       while (!list_empty(&work_list)) {
+                               fpl = list_first_entry(&work_list, struct scm_fp_list, list);
+
+                               list_del(&fpl->list);
+                               for (i=fpl->count-1; i>=0; i--)
+                                       fput(fpl->fp[i]);
+                               kfree(fpl);
+                       }
+
+                       current->scm_work_list = NULL;
+               }
        }
 }
 
@@ -284,6 +301,7 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl)
 
        new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL);
        if (new_fpl) {
+               INIT_LIST_HEAD(&new_fpl->list);
                for (i=fpl->count-1; i>=0; i--)
                        get_file(fpl->fp[i]);
                memcpy(new_fpl, fpl, sizeof(*fpl));
index eccb7165a80c180f56c42a1261597b361966396d..c5aca0bb116ae36ead0a824236ab4a5df9162d74 100644 (file)
@@ -1374,8 +1374,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                            sk->sk_state == TCP_CLOSE ||
                            (sk->sk_shutdown & RCV_SHUTDOWN) ||
                            !timeo ||
-                           signal_pending(current) ||
-                           (flags & MSG_PEEK))
+                           signal_pending(current))
                                break;
                } else {
                        if (sock_flag(sk, SOCK_DONE))
index 07735ed280d720f32ac7269c5099c1e840d866d7..55dc6beab9aa5344629021d04c526870fddd1fe4 100644 (file)
@@ -33,6 +33,7 @@ __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl,
        x->sel.dport_mask = htons(0xffff);
        x->sel.sport = xfrm_flowi_sport(fl);
        x->sel.sport_mask = htons(0xffff);
+       x->sel.family = AF_INET;
        x->sel.prefixlen_d = 32;
        x->sel.prefixlen_s = 32;
        x->sel.proto = fl->proto;
index eea9542728ca79b76b3c20427f74f9a5cad95079..d9da5eb9dcb20c81f9b04619b6b2f9c73c7f0ca7 100644 (file)
@@ -2483,8 +2483,10 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
                        if (!idev && dev->mtu >= IPV6_MIN_MTU)
                                idev = ipv6_add_dev(dev);
 
-                       if (idev)
+                       if (idev) {
                                idev->if_flags |= IF_READY;
+                               run_pending = 1;
+                       }
                } else {
                        if (!addrconf_qdisc_ok(dev)) {
                                /* device is still not ready. */
index 89884a4f23aa27992e006846bf14dd5673fea675..60c78cfc273797247312c6846727fc7b10b9db21 100644 (file)
@@ -34,6 +34,7 @@ __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl,
        x->sel.dport_mask = htons(0xffff);
        x->sel.sport = xfrm_flowi_sport(fl);
        x->sel.sport_mask = htons(0xffff);
+       x->sel.family = AF_INET6;
        x->sel.prefixlen_d = 128;
        x->sel.prefixlen_s = 128;
        x->sel.proto = fl->proto;
index 9c06b9f86ad45a524c2b3e2fe1b522930ca70af0..c39b6a9941331c8fe6c6fe2a80130f04bd1b1129 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/rculist.h>
+#include <linux/rtnetlink.h>
 
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_l3proto.h>
@@ -167,10 +168,12 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
         */
        synchronize_rcu();
 
+       rtnl_lock();
        spin_lock_bh(&nf_conntrack_lock);
        for_each_net(net)
                __nf_conntrack_helper_unregister(me, net);
        spin_unlock_bh(&nf_conntrack_lock);
+       rtnl_unlock();
 }
 EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);
 
index a59a307e685d2b67393344168fb1253cb9aa9d61..592d73344d46b09e02162ee5653e436f890d4c28 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/notifier.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
 
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_l3proto.h>
@@ -221,8 +222,10 @@ void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto)
        synchronize_rcu();
 
        /* Remove all contrack entries for this protocol */
+       rtnl_lock();
        for_each_net(net)
                nf_ct_iterate_cleanup(net, kill_l3proto, proto);
+       rtnl_unlock();
 }
 EXPORT_SYMBOL_GPL(nf_conntrack_l3proto_unregister);
 
@@ -333,8 +336,10 @@ void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *l4proto)
        synchronize_rcu();
 
        /* Remove all contrack entries for this protocol */
+       rtnl_lock();
        for_each_net(net)
                nf_ct_iterate_cleanup(net, kill_l4proto, l4proto);
+       rtnl_unlock();
 }
 EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_unregister);