[NETFILTER]: nf_conntrack_expect: function naming unification
[deliverable/linux.git] / net / ipv4 / netfilter / nf_conntrack_l3proto_ipv4_compat.c
index 3b31bc64960809394da42ad275c84c3578379ec2..12d6a6327b631b3143530add12a58f17a9a3d783 100644 (file)
@@ -41,35 +41,36 @@ struct ct_iter_state {
        unsigned int bucket;
 };
 
-static struct list_head *ct_get_first(struct seq_file *seq)
+static struct hlist_node *ct_get_first(struct seq_file *seq)
 {
        struct ct_iter_state *st = seq->private;
 
        for (st->bucket = 0;
             st->bucket < nf_conntrack_htable_size;
             st->bucket++) {
-               if (!list_empty(&nf_conntrack_hash[st->bucket]))
-                       return nf_conntrack_hash[st->bucket].next;
+               if (!hlist_empty(&nf_conntrack_hash[st->bucket]))
+                       return nf_conntrack_hash[st->bucket].first;
        }
        return NULL;
 }
 
-static struct list_head *ct_get_next(struct seq_file *seq, struct list_head *head)
+static struct hlist_node *ct_get_next(struct seq_file *seq,
+                                     struct hlist_node *head)
 {
        struct ct_iter_state *st = seq->private;
 
        head = head->next;
-       while (head == &nf_conntrack_hash[st->bucket]) {
+       while (head == NULL) {
                if (++st->bucket >= nf_conntrack_htable_size)
                        return NULL;
-               head = nf_conntrack_hash[st->bucket].next;
+               head = nf_conntrack_hash[st->bucket].first;
        }
        return head;
 }
 
-static struct list_head *ct_get_idx(struct seq_file *seq, loff_t pos)
+static struct hlist_node *ct_get_idx(struct seq_file *seq, loff_t pos)
 {
-       struct list_head *head = ct_get_first(seq);
+       struct hlist_node *head = ct_get_first(seq);
 
        if (head)
                while (pos && (head = ct_get_next(seq, head)))
@@ -135,7 +136,7 @@ static int ct_seq_show(struct seq_file *s, void *v)
                        l3proto, l4proto))
                return -ENOSPC;
 
-       if (seq_print_counters(s, &ct->counters[IP_CT_DIR_ORIGINAL]))
+       if (seq_print_counters(s, &ct->counters[IP_CT_DIR_ORIGINAL]))
                return -ENOSPC;
 
        if (!(test_bit(IPS_SEEN_REPLY_BIT, &ct->status)))
@@ -146,7 +147,7 @@ static int ct_seq_show(struct seq_file *s, void *v)
                        l3proto, l4proto))
                return -ENOSPC;
 
-       if (seq_print_counters(s, &ct->counters[IP_CT_DIR_REPLY]))
+       if (seq_print_counters(s, &ct->counters[IP_CT_DIR_REPLY]))
                return -ENOSPC;
 
        if (test_bit(IPS_ASSURED_BIT, &ct->status))
@@ -197,7 +198,7 @@ out_free:
        return ret;
 }
 
-static struct file_operations ct_file_ops = {
+static const struct file_operations ct_file_ops = {
        .owner   = THIS_MODULE,
        .open    = ct_open,
        .read    = seq_read,
@@ -208,7 +209,7 @@ static struct file_operations ct_file_ops = {
 /* expects */
 static void *exp_seq_start(struct seq_file *s, loff_t *pos)
 {
-       struct list_head *e = &nf_conntrack_expect_list;
+       struct list_head *e = &nf_ct_expect_list;
        loff_t i;
 
        /* strange seq_file api calls stop even if we fail,
@@ -220,7 +221,7 @@ static void *exp_seq_start(struct seq_file *s, loff_t *pos)
 
        for (i = 0; i <= *pos; i++) {
                e = e->next;
-               if (e == &nf_conntrack_expect_list)
+               if (e == &nf_ct_expect_list)
                        return NULL;
        }
        return e;
@@ -228,12 +229,12 @@ static void *exp_seq_start(struct seq_file *s, loff_t *pos)
 
 static void *exp_seq_next(struct seq_file *s, void *v, loff_t *pos)
 {
-       struct list_head *e = v;
+       struct list_head *e = v;
 
        ++*pos;
        e = e->next;
 
-       if (e == &nf_conntrack_expect_list)
+       if (e == &nf_ct_expect_list)
                return NULL;
 
        return e;
@@ -262,7 +263,7 @@ static int exp_seq_show(struct seq_file *s, void *v)
        print_tuple(s, &exp->tuple,
                    __nf_ct_l3proto_find(exp->tuple.src.l3num),
                    __nf_ct_l4proto_find(exp->tuple.src.l3num,
-                                        exp->tuple.dst.protonum));
+                                        exp->tuple.dst.protonum));
        return seq_putc(s, '\n');
 }
 
@@ -278,7 +279,7 @@ static int exp_open(struct inode *inode, struct file *file)
        return seq_open(file, &exp_seq_ops);
 }
 
-static struct file_operations ip_exp_file_ops = {
+static const struct file_operations ip_exp_file_ops = {
        .owner   = THIS_MODULE,
        .open    = exp_open,
        .read    = seq_read,
@@ -366,7 +367,7 @@ static int ct_cpu_seq_open(struct inode *inode, struct file *file)
        return seq_open(file, &ct_cpu_seq_ops);
 }
 
-static struct file_operations ct_cpu_seq_fops = {
+static const struct file_operations ct_cpu_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = ct_cpu_seq_open,
        .read    = seq_read,
This page took 0.032713 seconds and 5 git commands to generate.