public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: James Chapman <jchapman@katalix•com>
To: Stephen Hemminger <shemminger@vyatta•com>, Thomas Graf <tgraf@suug•ch>
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH 08/12] netlink: Export genl_lock() API for use by modules
Date: Thu, 18 Mar 2010 17:46:29 +0000	[thread overview]
Message-ID: <4BA266F5.7020101@katalix.com> (raw)
In-Reply-To: <20100318090037.69bcd073@nehalam>

Stephen Hemminger wrote:
> On Thu, 18 Mar 2010 10:22:10 +0000
> James Chapman <jchapman@katalix•com> wrote:
> 
>> This lets kernel modules which use genl netlink APIs serialize netlink
>> processing.
>>
>> Signed-off-by: James Chapman <jchapman@katalix•com>
>> ---
>>  include/linux/genetlink.h |    8 ++++++++
>>  net/netlink/genetlink.c   |    6 ++++--
>>  2 files changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
>> index b834ef6..61549b2 100644
>> --- a/include/linux/genetlink.h
>> +++ b/include/linux/genetlink.h
>> @@ -80,4 +80,12 @@ enum {
>>  
>>  #define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
>>  
>> +#ifdef __KERNEL__
>> +
>> +/* All generic netlink requests are serialized by a global lock.  */
>> +extern void genl_lock(void);
>> +extern void genl_unlock(void);
>> +
>> +#endif /* __KERNEL__ */
>> +
>>  #endif	/* __LINUX_GENERIC_NETLINK_H */
>> diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
>> index a4b6e14..a28fda7 100644
>> --- a/net/netlink/genetlink.c
>> +++ b/net/netlink/genetlink.c
>> @@ -20,15 +20,17 @@
>>  
>>  static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */
>>  
>> -static inline void genl_lock(void)
>> +void genl_lock(void)
>>  {
>>  	mutex_lock(&genl_mutex);
>>  }
>> +EXPORT_SYMBOL(genl_lock);
>>  
>> -static inline void genl_unlock(void)
>> +void genl_unlock(void)
>>  {
>>  	mutex_unlock(&genl_mutex);
>>  }
>> +EXPORT_SYMBOL(genl_unlock);
> 
> EXPORT_SYMBOL_GPL() for this?

I chose EXPORT_SYMBOL because other exported symbols in that module
aren't GPL-only. I don't mind which is used. Any preference, Thomas?


-- 
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development


  reply	other threads:[~2010-03-18 17:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18 10:21 [PATCH 00/12] l2tp: Introduce L2TPv3 support James Chapman
2010-03-18 10:21 ` [PATCH 01/12] l2tp: Relocate pppol2tp driver to new net/l2tp directory James Chapman
2010-03-18 10:21 ` [PATCH 02/12] l2tp: Split pppol2tp patch into separate l2tp and ppp parts James Chapman
2010-03-18 10:21 ` [PATCH 03/12] ppp: Add ppp_dev_name() exported function James Chapman
2010-03-18 10:21 ` [PATCH 04/12] l2tp: Add ppp device name to L2TP ppp session data James Chapman
2010-03-18 10:21 ` [PATCH 05/12] l2tp: Add L2TPv3 protocol support James Chapman
2010-03-18 10:21 ` [PATCH 06/12] l2tp: Update PPP-over-L2TP driver to work over L2TPv3 James Chapman
2010-03-18 10:22 ` [PATCH 07/12] l2tp: Add L2TPv3 IP encapsulation (no UDP) support James Chapman
2010-03-18 10:22 ` [PATCH 08/12] netlink: Export genl_lock() API for use by modules James Chapman
2010-03-18 16:00   ` Stephen Hemminger
2010-03-18 17:46     ` James Chapman [this message]
2010-03-18 10:22 ` [PATCH 09/12] l2tp: Add netlink control API for L2TP James Chapman
2010-03-18 10:22 ` [PATCH 10/12] l2tp: Add L2TP ethernet pseudowire support James Chapman
2010-03-18 10:22 ` [PATCH 11/12] l2tp: Add support for static unmanaged L2TPv3 tunnels James Chapman
2010-03-18 10:22 ` [PATCH 12/12] l2tp: Update documentation James Chapman
2010-03-18 15:52   ` Randy Dunlap
2010-03-20  6:23 ` [PATCH 00/12] l2tp: Introduce L2TPv3 support David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BA266F5.7020101@katalix.com \
    --to=jchapman@katalix$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=shemminger@vyatta$(echo .)com \
    --cc=tgraf@suug$(echo .)ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox