Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d354c5782dc352cec187845d17eedc2c2bfcf67
Commit:     4d354c5782dc352cec187845d17eedc2c2bfcf67
Parent:     c88130bcd546e73e66165f9c29113dae9facf1ec
Author:     Patrick McHardy <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 31 04:42:37 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 19:28:00 2008 -0800

    [NETFILTER]: nf_nat: use RCU for bysource hash
    
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/netfilter/nf_nat_core.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index c07575d..c7a985f 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -154,8 +154,8 @@ find_appropriate_src(const struct nf_conntrack_tuple *tuple,
        struct nf_conn *ct;
        struct hlist_node *n;
 
-       read_lock_bh(&nf_nat_lock);
-       hlist_for_each_entry(nat, n, &bysource[h], bysource) {
+       rcu_read_lock();
+       hlist_for_each_entry_rcu(nat, n, &bysource[h], bysource) {
                ct = nat->ct;
                if (same_src(ct, tuple)) {
                        /* Copy source part from reply tuple. */
@@ -164,12 +164,12 @@ find_appropriate_src(const struct nf_conntrack_tuple 
*tuple,
                        result->dst = tuple->dst;
 
                        if (in_range(result, range)) {
-                               read_unlock_bh(&nf_nat_lock);
+                               rcu_read_unlock();
                                return 1;
                        }
                }
        }
-       read_unlock_bh(&nf_nat_lock);
+       rcu_read_unlock();
        return 0;
 }
 
@@ -334,7 +334,7 @@ nf_nat_setup_info(struct nf_conn *ct,
                /* nf_conntrack_alter_reply might re-allocate exntension aera */
                nat = nfct_nat(ct);
                nat->ct = ct;
-               hlist_add_head(&nat->bysource, &bysource[srchash]);
+               hlist_add_head_rcu(&nat->bysource, &bysource[srchash]);
                write_unlock_bh(&nf_nat_lock);
        }
 
@@ -595,7 +595,7 @@ static void nf_nat_cleanup_conntrack(struct nf_conn *ct)
        NF_CT_ASSERT(nat->ct->status & IPS_NAT_DONE_MASK);
 
        write_lock_bh(&nf_nat_lock);
-       hlist_del(&nat->bysource);
+       hlist_del_rcu(&nat->bysource);
        nat->ct = NULL;
        write_unlock_bh(&nf_nat_lock);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to