hlist: drop the node parameter from iterators
[deliverable/linux.git] / net / netfilter / ipvs / ip_vs_conn.c
index 68e368a4beeda9ceb7ef610922459751a4016bcf..704e514e02abec92b4676f3747468eb76c8c68a2 100644 (file)
@@ -259,13 +259,12 @@ __ip_vs_conn_in_get(const struct ip_vs_conn_param *p)
 {
        unsigned int hash;
        struct ip_vs_conn *cp;
-       struct hlist_node *n;
 
        hash = ip_vs_conn_hashkey_param(p, false);
 
        ct_read_lock(hash);
 
-       hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
+       hlist_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
                if (cp->af == p->af &&
                    p->cport == cp->cport && p->vport == cp->vport &&
                    ip_vs_addr_equal(p->af, p->caddr, &cp->caddr) &&
@@ -344,13 +343,12 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p)
 {
        unsigned int hash;
        struct ip_vs_conn *cp;
-       struct hlist_node *n;
 
        hash = ip_vs_conn_hashkey_param(p, false);
 
        ct_read_lock(hash);
 
-       hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
+       hlist_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
                if (!ip_vs_conn_net_eq(cp, p->net))
                        continue;
                if (p->pe_data && p->pe->ct_match) {
@@ -394,7 +392,6 @@ struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p)
 {
        unsigned int hash;
        struct ip_vs_conn *cp, *ret=NULL;
-       struct hlist_node *n;
 
        /*
         *      Check for "full" addressed entries
@@ -403,7 +400,7 @@ struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p)
 
        ct_read_lock(hash);
 
-       hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
+       hlist_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
                if (cp->af == p->af &&
                    p->vport == cp->cport && p->cport == cp->dport &&
                    ip_vs_addr_equal(p->af, p->vaddr, &cp->caddr) &&
@@ -953,11 +950,10 @@ static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos)
        int idx;
        struct ip_vs_conn *cp;
        struct ip_vs_iter_state *iter = seq->private;
-       struct hlist_node *n;
 
        for (idx = 0; idx < ip_vs_conn_tab_size; idx++) {
                ct_read_lock_bh(idx);
-               hlist_for_each_entry(cp, n, &ip_vs_conn_tab[idx], c_list) {
+               hlist_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
                        if (pos-- == 0) {
                                iter->l = &ip_vs_conn_tab[idx];
                                return cp;
@@ -981,7 +977,6 @@ static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
        struct ip_vs_conn *cp = v;
        struct ip_vs_iter_state *iter = seq->private;
-       struct hlist_node *e;
        struct hlist_head *l = iter->l;
        int idx;
 
@@ -990,15 +985,15 @@ static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos)
                return ip_vs_conn_array(seq, 0);
 
        /* more on same hash chain? */
-       if ((e = cp->c_list.next))
-               return hlist_entry(e, struct ip_vs_conn, c_list);
+       if (cp->c_list.next)
+               return hlist_entry(cp->c_list.next, struct ip_vs_conn, c_list);
 
        idx = l - ip_vs_conn_tab;
        ct_read_unlock_bh(idx);
 
        while (++idx < ip_vs_conn_tab_size) {
                ct_read_lock_bh(idx);
-               hlist_for_each_entry(cp, e, &ip_vs_conn_tab[idx], c_list) {
+               hlist_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
                        iter->l = &ip_vs_conn_tab[idx];
                        return cp;
                }
@@ -1200,14 +1195,13 @@ void ip_vs_random_dropentry(struct net *net)
         */
        for (idx = 0; idx < (ip_vs_conn_tab_size>>5); idx++) {
                unsigned int hash = net_random() & ip_vs_conn_tab_mask;
-               struct hlist_node *n;
 
                /*
                 *  Lock is actually needed in this loop.
                 */
                ct_write_lock_bh(hash);
 
-               hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
+               hlist_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
                        if (cp->flags & IP_VS_CONN_F_TEMPLATE)
                                /* connection template */
                                continue;
@@ -1255,14 +1249,12 @@ static void ip_vs_conn_flush(struct net *net)
 
 flush_again:
        for (idx = 0; idx < ip_vs_conn_tab_size; idx++) {
-               struct hlist_node *n;
-
                /*
                 *  Lock is actually needed in this loop.
                 */
                ct_write_lock_bh(idx);
 
-               hlist_for_each_entry(cp, n, &ip_vs_conn_tab[idx], c_list) {
+               hlist_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
                        if (!ip_vs_conn_net_eq(cp, net))
                                continue;
                        IP_VS_DBG(4, "del connection\n");
@@ -1291,8 +1283,8 @@ int __net_init ip_vs_conn_net_init(struct net *net)
 
        atomic_set(&ipvs->conn_count, 0);
 
-       proc_net_fops_create(net, "ip_vs_conn", 0, &ip_vs_conn_fops);
-       proc_net_fops_create(net, "ip_vs_conn_sync", 0, &ip_vs_conn_sync_fops);
+       proc_create("ip_vs_conn", 0, net->proc_net, &ip_vs_conn_fops);
+       proc_create("ip_vs_conn_sync", 0, net->proc_net, &ip_vs_conn_sync_fops);
        return 0;
 }
 
@@ -1300,8 +1292,8 @@ void __net_exit ip_vs_conn_net_cleanup(struct net *net)
 {
        /* flush all the connection entries first */
        ip_vs_conn_flush(net);
-       proc_net_remove(net, "ip_vs_conn");
-       proc_net_remove(net, "ip_vs_conn_sync");
+       remove_proc_entry("ip_vs_conn", net->proc_net);
+       remove_proc_entry("ip_vs_conn_sync", net->proc_net);
 }
 
 int __init ip_vs_conn_init(void)
This page took 0.028037 seconds and 5 git commands to generate.