From patchwork Sat Apr 16 09:01:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 938 Return-Path: Received: from contumacia.investici.org (contumacia.investici.org [178.255.144.35]) by open-mesh.org (Postfix) with ESMTPS id 871FB15440E for ; Sat, 16 Apr 2011 11:01:32 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 844F5E81E1; Sat, 16 Apr 2011 11:01:28 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.6.0 contumacia.investici.org 844F5E81E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1302944488; bh=UcNxjQdbXuAcp9+sTczNhD0lBLf1GM28tksBOh tv9cs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=u8gJqcLVi33Z9Wy56/q5Piw0Czj9Ceuq44UHBur2ye2TF0xug5CFOb8S2WCQUDQ+z TdHIplRHUVCTUR5DZlO2m8OqTUVWyWjcMQza84+l6x+8a+ZCnFdc9EfKOAUJWFQn32q /MnGXpjFklGS4eXGHIlSHeBZUcy16v56RV8Wcc0= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Sat, 16 Apr 2011 11:01:23 +0200 Message-Id: <1302944483-4386-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1302944374-2971-1-git-send-email-ordex@autistici.org> References: <1302944374-2971-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2] 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: Sat, 16 Apr 2011 09:01:33 -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 */