]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/nf_conntrack_standalone.c
Use WARN() in fs/
[linux-2.6-omap-h63xx.git] / net / netfilter / nf_conntrack_standalone.c
index b59871f6bdda3b6bcfddfcd24925df64e70e15f2..869ef9349d0f1c748e3ec7a4619827c9759ccef7 100644 (file)
@@ -25,6 +25,7 @@
 #include <net/netfilter/nf_conntrack_l4proto.h>
 #include <net/netfilter/nf_conntrack_expect.h>
 #include <net/netfilter/nf_conntrack_helper.h>
+#include <net/netfilter/nf_conntrack_acct.h>
 
 MODULE_LICENSE("GPL");
 
@@ -38,19 +39,6 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
 }
 EXPORT_SYMBOL_GPL(print_tuple);
 
-#ifdef CONFIG_NF_CT_ACCT
-static unsigned int
-seq_print_counters(struct seq_file *s,
-                  const struct ip_conntrack_counter *counter)
-{
-       return seq_printf(s, "packets=%llu bytes=%llu ",
-                         (unsigned long long)counter->packets,
-                         (unsigned long long)counter->bytes);
-}
-#else
-#define seq_print_counters(x, y)       0
-#endif
-
 struct ct_iter_state {
        unsigned int bucket;
 };
@@ -146,7 +134,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_acct(s, ct, IP_CT_DIR_ORIGINAL))
                return -ENOSPC;
 
        if (!(test_bit(IPS_SEEN_REPLY_BIT, &ct->status)))
@@ -157,7 +145,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_acct(s, ct, IP_CT_DIR_REPLY))
                return -ENOSPC;
 
        if (test_bit(IPS_ASSURED_BIT, &ct->status))
@@ -296,11 +284,11 @@ static int nf_conntrack_standalone_init_proc(void)
        pde = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops);
        if (!pde)
                goto out_nf_conntrack;
-       pde = create_proc_entry("nf_conntrack", S_IRUGO, init_net.proc_net_stat);
+
+       pde = proc_create("nf_conntrack", S_IRUGO, init_net.proc_net_stat,
+                         &ct_cpu_seq_fops);
        if (!pde)
                goto out_stat_nf_conntrack;
-       pde->proc_fops = &ct_cpu_seq_fops;
-       pde->owner = THIS_MODULE;
        return 0;
 
 out_stat_nf_conntrack: