]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv6/ip6_fib.c
[NET] IPV6: Fix whitespace errors.
[net-next-2.6.git] / net / ipv6 / ip6_fib.c
index f98ca30d7c1f300377daf7f51d49afc2e4af5c21..f90ab52333263fb15bc345156f41842b4e75edbe 100644 (file)
@@ -1,9 +1,9 @@
 /*
- *     Linux INET6 implementation 
+ *     Linux INET6 implementation
  *     Forwarding Information Database
  *
  *     Authors:
- *     Pedro Roque             <roque@di.fc.ul.pt>     
+ *     Pedro Roque             <roque@di.fc.ul.pt>
  *
  *     $Id: ip6_fib.c,v 1.25 2001/10/31 21:55:55 davem Exp $
  *
@@ -50,7 +50,7 @@
 
 struct rt6_statistics  rt6_stats;
 
-static kmem_cache_t * fib6_node_kmem __read_mostly;
+static struct kmem_cache * fib6_node_kmem __read_mostly;
 
 enum fib_walk_state_t
 {
@@ -97,7 +97,7 @@ static DEFINE_TIMER(ip6_fib_timer, fib6_run_gc, 0, 0);
 
 static struct fib6_walker_t fib6_walker_list = {
        .prev   = &fib6_walker_list,
-       .next   = &fib6_walker_list, 
+       .next   = &fib6_walker_list,
 };
 
 #define FOR_WALKERS(w) for ((w)=fib6_walker_list.next; (w) != &fib6_walker_list; (w)=(w)->next)
@@ -131,7 +131,7 @@ static __inline__ u32 fib6_new_sernum(void)
 /*
  *     Auxiliary address test functions for the radix tree.
  *
- *     These assume a 32bit processor (although it will work on 
+ *     These assume a 32bit processor (although it will work on
  *     64bit processors)
  */
 
@@ -139,9 +139,9 @@ static __inline__ u32 fib6_new_sernum(void)
  *     test bit
  */
 
-static __inline__ int addr_bit_set(void *token, int fn_bit)
+static __inline__ __be32 addr_bit_set(void *token, int fn_bit)
 {
-       __u32 *addr = token;
+       __be32 *addr = token;
 
        return htonl(1 << ((~fn_bit)&0x1F)) & addr[fn_bit>>5];
 }
@@ -150,7 +150,7 @@ static __inline__ struct fib6_node * node_alloc(void)
 {
        struct fib6_node *fn;
 
-       if ((fn = kmem_cache_alloc(fib6_node_kmem, SLAB_ATOMIC)) != NULL)
+       if ((fn = kmem_cache_alloc(fib6_node_kmem, GFP_ATOMIC)) != NULL)
                memset(fn, 0, sizeof(struct fib6_node));
 
        return fn;
@@ -434,7 +434,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
        struct fib6_node *pn = NULL;
        struct rt6key *key;
        int     bit;
-               int     dir = 0;
+       __be32  dir = 0;
        __u32   sernum = fib6_new_sernum();
 
        RT6_TRACE("fib6_add_1\n");
@@ -452,27 +452,27 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
                if (plen < fn->fn_bit ||
                    !ipv6_prefix_equal(&key->addr, addr, fn->fn_bit))
                        goto insert_above;
-               
+
                /*
                 *      Exact match ?
                 */
-                        
+
                if (plen == fn->fn_bit) {
                        /* clean up an intermediate node */
                        if ((fn->fn_flags & RTN_RTINFO) == 0) {
                                rt6_release(fn->leaf);
                                fn->leaf = NULL;
                        }
-                       
+
                        fn->fn_sernum = sernum;
-                               
+
                        return fn;
                }
 
                /*
                 *      We have more bits to go
                 */
-                        
+
                /* Try to walk down on tree. */
                fn->fn_sernum = sernum;
                dir = addr_bit_set(addr, fn->fn_bit);
@@ -490,7 +490,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
        if (ln == NULL)
                return NULL;
        ln->fn_bit = plen;
-                       
+
        ln->parent = pn;
        ln->fn_sernum = sernum;
 
@@ -504,7 +504,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
 
 insert_above:
        /*
-        * split since we don't have a common prefix anymore or 
+        * split since we don't have a common prefix anymore or
         * we have a less significant route.
         * we've to insert an intermediate node on the list
         * this new node will point to the one we need to create
@@ -518,18 +518,18 @@ insert_above:
           See comment in __ipv6_addr_diff: bit may be an invalid value,
           but if it is >= plen, the value is ignored in any case.
         */
-       
+
        bit = __ipv6_addr_diff(addr, &key->addr, addrlen);
 
-       /* 
-        *              (intermediate)[in]      
+       /*
+        *              (intermediate)[in]
         *                /        \
         *      (new leaf node)[ln] (old node)[fn]
         */
        if (plen > bit) {
                in = node_alloc();
                ln = node_alloc();
-               
+
                if (in == NULL || ln == NULL) {
                        if (in)
                                node_free(in);
@@ -538,8 +538,8 @@ insert_above:
                        return NULL;
                }
 
-               /* 
-                * new intermediate node. 
+               /*
+                * new intermediate node.
                 * RTN_RTINFO will
                 * be off since that an address that chooses one of
                 * the branches would not match less specific routes
@@ -576,7 +576,7 @@ insert_above:
                }
        } else { /* plen <= bit */
 
-               /* 
+               /*
                 *              (new leaf node)[ln]
                 *                /        \
                 *           (old node)[fn] NULL
@@ -592,7 +592,7 @@ insert_above:
                ln->parent = pn;
 
                ln->fn_sernum = sernum;
-               
+
                if (dir)
                        pn->right = ln;
                else
@@ -829,7 +829,7 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
                                        struct lookup_args *args)
 {
        struct fib6_node *fn;
-       int dir;
+       __be32 dir;
 
        if (unlikely(args->offset == 0))
                return NULL;
@@ -1206,7 +1206,7 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)
  *     However, it is internally reenterable wrt itself and fib6_add/fib6_del.
  *     It means, that we can modify tree during walking
  *     and use this function for garbage collection, clone pruning,
- *     cleaning tree when a device goes down etc. etc. 
+ *     cleaning tree when a device goes down etc. etc.
  *
  *     It guarantees that every node will be traversed,
  *     and that it will be traversed only once.
@@ -1245,7 +1245,7 @@ static int fib6_walk_continue(struct fib6_walker_t *w)
                                continue;
                        }
                        w->state = FWS_L;
-#endif 
+#endif
                case FWS_L:
                        if (fn->left) {
                                w->node = fn->left;
@@ -1338,7 +1338,7 @@ static int fib6_clean_node(struct fib6_walker_t *w)
 
 /*
  *     Convenient frontend to tree walker.
- *     
+ *
  *     func is called on each route.
  *             It may return -1 -> delete this route.
  *                           0  -> continue walking