[NET]: make seq_operations const
[powerpc.git] / net / ipv4 / fib_hash.c
index 107bb6c..9cfecf1 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/bitops.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/socket.h>
@@ -45,8 +44,8 @@
 
 #include "fib_lookup.h"
 
-static kmem_cache_t *fn_hash_kmem __read_mostly;
-static kmem_cache_t *fn_alias_kmem __read_mostly;
+static struct kmem_cache *fn_hash_kmem __read_mostly;
+static struct kmem_cache *fn_alias_kmem __read_mostly;
 
 struct fib_node {
        struct hlist_node       fn_hash;
@@ -146,7 +145,7 @@ static void fn_rehash_zone(struct fn_zone *fz)
        struct hlist_head *ht, *old_ht;
        int old_divisor, new_divisor;
        u32 new_hashmask;
-               
+
        old_divisor = fz->fz_divisor;
 
        switch (old_divisor) {
@@ -485,13 +484,13 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
                goto out;
 
        err = -ENOBUFS;
-       new_fa = kmem_cache_alloc(fn_alias_kmem, SLAB_KERNEL);
+       new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL);
        if (new_fa == NULL)
                goto out;
 
        new_f = NULL;
        if (!f) {
-               new_f = kmem_cache_alloc(fn_hash_kmem, SLAB_KERNEL);
+               new_f = kmem_cache_alloc(fn_hash_kmem, GFP_KERNEL);
                if (new_f == NULL)
                        goto out_free_new_fa;
 
@@ -911,7 +910,7 @@ static struct fib_alias *fib_get_next(struct seq_file *seq)
 
                if (!iter->zone)
                        goto out;
-               
+
                iter->bucket = 0;
                iter->hash_head = iter->zone->fz_hash;
 
@@ -932,7 +931,7 @@ static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
 {
        struct fib_iter_state *iter = seq->private;
        struct fib_alias *fa;
-       
+
        if (iter->valid && pos >= iter->pos && iter->genid == fib_hash_genid) {
                fa   = iter->fa;
                pos -= iter->pos;
@@ -981,7 +980,7 @@ static unsigned fib_flag_trans(int type, __be32 mask, struct fib_info *fi)
        return flags;
 }
 
-/* 
+/*
  *     This outputs /proc/net/route.
  *
  *     It always works in backward compatibility mode.
@@ -1028,7 +1027,7 @@ out:
        return 0;
 }
 
-static struct seq_operations fib_seq_ops = {
+static const struct seq_operations fib_seq_ops = {
        .start  = fib_seq_start,
        .next   = fib_seq_next,
        .stop   = fib_seq_stop,
@@ -1040,7 +1039,7 @@ static int fib_seq_open(struct inode *inode, struct file *file)
        struct seq_file *seq;
        int rc = -ENOMEM;
        struct fib_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
-       
+
        if (!s)
                goto out;
 
@@ -1057,7 +1056,7 @@ out_kfree:
        goto out;
 }
 
-static struct file_operations fib_seq_fops = {
+static const struct file_operations fib_seq_fops = {
        .owner          = THIS_MODULE,
        .open           = fib_seq_open,
        .read           = seq_read,