From patchwork Sat Mar 6 18:17:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samir Bellabes X-Patchwork-Id: 47054 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DC380B7CEF for ; Sun, 7 Mar 2010 05:18:12 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754025Ab0CFSRp (ORCPT ); Sat, 6 Mar 2010 13:17:45 -0500 Received: from bob75-7-88-160-5-175.fbx.proxad.net ([88.160.5.175]:55536 "EHLO cerbere.dyndns.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753970Ab0CFSRo (ORCPT ); Sat, 6 Mar 2010 13:17:44 -0500 Received: by cerbere.dyndns.info (Postfix, from userid 501) id 8034E83D7; Sat, 6 Mar 2010 19:17:42 +0100 (CET) From: Samir Bellabes To: Tetsuo Handa Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, hadi@cyberus.ca, kaber@trash.net, zbr@ioremap.net, nhorman@tuxdriver.com, root@localdomain.pl, linux-security-module@vger.kernel.org Subject: Re: [RFC v2 00/10] snet: Security for NETwork syscalls References: <1267561394-13626-1-git-send-email-sam@synack.fr> <201003030156.o231udx1023055@www262.sakura.ne.jp> Date: Sat, 06 Mar 2010 19:17:42 +0100 In-Reply-To: <201003030156.o231udx1023055@www262.sakura.ne.jp> (Tetsuo Handa's message of "Wed, 03 Mar 2010 10:56:39 +0900") Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Tetsuo Handa writes: > Regarding [RFC v2 05/10] snet: introduce snet_event > +static rwlock_t snet_evh_lock = __RW_LOCK_UNLOCKED(); > > You can use "static DEFINE_RWLOCK(snet_evh_lock);". > > +int snet_event_is_registered(const enum snet_syscall syscall, const u8 protocol) > > Maybe rcu_read_lock() is better than rw spinlock because this function is > frequently called. here is the patch. thank you Tetsuo From 34715d4d900aee2d3759e3008313b65dc2f130fd Mon Sep 17 00:00:00 2001 From: Samir Bellabes Date: Sat, 6 Mar 2010 15:44:42 +0100 Subject: [PATCH 1/3] snet: use proper rwlock_t declaration Noticed by Tetsuo Handa Signed-off-by: Samir Bellabes --- security/snet/snet_event.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/security/snet/snet_event.c b/security/snet/snet_event.c index 9e3f7d2..5f708d0 100644 --- a/security/snet/snet_event.c +++ b/security/snet/snet_event.c @@ -9,7 +9,7 @@ #include "snet_utils.h" static struct list_head *snet_evh; -static rwlock_t snet_evh_lock = __RW_LOCK_UNLOCKED(); +static DEFINE_RWLOCK(snet_evh_lock); struct snet_event_entry { struct list_head list;