From patchwork Fri Apr 15 18:16:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 947 Return-Path: Received: from espatrio.investici.org (espatrio.investici.org [204.13.164.67]) by open-mesh.org (Postfix) with ESMTPS id F2585154105 for ; Fri, 15 Apr 2011 20:17:10 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [204.13.164.67] (espatrio [204.13.164.67]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id C297B49A5E; Fri, 15 Apr 2011 18:17:05 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 espatrio.investici.org C297B49A5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1302891427; bh=UcNxjQdbXuAcp9+sTczNhD0lBLf1GM28tksBOhtv9cs=; h=From:To:Cc:Subject:Date:Message-Id; b=eDpjvwrymJpmIz98ldcGqTpkjscPpIYF/LkWyGO+lcCoG+idIpsfjw0ec93Xt3q1g r6A6KRsLT2DS+hHERki0uyuDcoITcS354VrKXZ/aNVpLpPZaG4GpGEheiB5eLqg+Pz LcsQiMtlBVOA85g16nDUlf/mVxdJ3BF0X45nwVg0= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Fri, 15 Apr 2011 20:16:56 +0200 Message-Id: <1302891416-31451-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: orig_hash_find() manages rcu_lock/unlock internally X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 18:17:11 -0000 orig_hash_find() manages rcu_lock/unlock internally and doesn't need to be surrounded by rcu_read_lock() / rcu_read_unlock() anymore Signed-off-by: Antonio Quartulli --- routing.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/routing.c b/routing.c index f6c6422..634a44d 100644 --- a/routing.c +++ b/routing.c @@ -1310,14 +1310,11 @@ int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) } /* get routing information */ - rcu_read_lock(); orig_node = orig_hash_find(bat_priv, unicast_packet->dest); if (!orig_node) goto unlock; - rcu_read_unlock(); - /* find_router() increases neigh_nodes refcount if found. */ neigh_node = find_router(bat_priv, orig_node, recv_if); @@ -1464,14 +1461,11 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) if (bcast_packet->ttl < 2) goto out; - rcu_read_lock(); orig_node = orig_hash_find(bat_priv, bcast_packet->orig); if (!orig_node) goto rcu_unlock; - rcu_read_unlock(); - spin_lock_bh(&orig_node->bcast_seqno_lock); /* check whether the packet is a duplicate */