inet: frag: remove lru list
[deliverable/linux.git] / net / ieee802154 / reassembly.c
index b85bd3f7048e7bdb7e44d06c0b49b4d2a22724f5..b4bc7a50eccfdda2e4a8e1fdfe7288882fe40a12 100644 (file)
@@ -50,29 +50,25 @@ static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size,
                                     const struct ieee802154_addr *saddr,
                                     const struct ieee802154_addr *daddr)
 {
-       u32 c;
-
        net_get_random_once(&lowpan_frags.rnd, sizeof(lowpan_frags.rnd));
-       c = jhash_3words(ieee802154_addr_hash(saddr),
-                        ieee802154_addr_hash(daddr),
-                        (__force u32)(tag + (d_size << 16)),
-                        lowpan_frags.rnd);
-
-       return c & (INETFRAGS_HASHSZ - 1);
+       return jhash_3words(ieee802154_addr_hash(saddr),
+                           ieee802154_addr_hash(daddr),
+                           (__force u32)(tag + (d_size << 16)),
+                           lowpan_frags.rnd);
 }
 
-static unsigned int lowpan_hashfn(struct inet_frag_queue *q)
+static unsigned int lowpan_hashfn(const struct inet_frag_queue *q)
 {
-       struct lowpan_frag_queue *fq;
+       const struct lowpan_frag_queue *fq;
 
        fq = container_of(q, struct lowpan_frag_queue, q);
        return lowpan_hash_frag(fq->tag, fq->d_size, &fq->saddr, &fq->daddr);
 }
 
-static bool lowpan_frag_match(struct inet_frag_queue *q, void *a)
+static bool lowpan_frag_match(const struct inet_frag_queue *q, const void *a)
 {
-       struct lowpan_frag_queue *fq;
-       struct lowpan_create_arg *arg = a;
+       const struct lowpan_frag_queue *fq;
+       const struct lowpan_create_arg *arg = a;
 
        fq = container_of(q, struct lowpan_frag_queue, q);
        return  fq->tag == arg->tag && fq->d_size == arg->d_size &&
@@ -80,10 +76,10 @@ static bool lowpan_frag_match(struct inet_frag_queue *q, void *a)
                ieee802154_addr_equal(&fq->daddr, arg->dst);
 }
 
-static void lowpan_frag_init(struct inet_frag_queue *q, void *a)
+static void lowpan_frag_init(struct inet_frag_queue *q, const void *a)
 {
+       const struct lowpan_create_arg *arg = a;
        struct lowpan_frag_queue *fq;
-       struct lowpan_create_arg *arg = a;
 
        fq = container_of(q, struct lowpan_frag_queue, q);
 
@@ -223,7 +219,6 @@ found:
                return res;
        }
 
-       inet_frag_lru_move(&fq->q);
        return -1;
 err:
        kfree_skb(skb);
@@ -373,8 +368,6 @@ int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type)
        if (frag_info->d_size > ieee802154_lowpan->max_dsize)
                goto err;
 
-       inet_frag_evictor(&ieee802154_lowpan->frags, &lowpan_frags, false);
-
        fq = fq_find(net, frag_info, &source, &dest);
        if (fq != NULL) {
                int ret;
This page took 0.02953 seconds and 5 git commands to generate.