netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org, dm-devel@redhat.com,
	linux-kernel@vger.kernel.org, Alasdair G Kergon <agk@redhat.com>
Subject: Re: [2.6.23 PATCH 13/18] dm: netlink
Date: Wed, 11 Jul 2007 16:37:36 -0700	[thread overview]
Message-ID: <20070711233736.GA29241@us.ibm.com> (raw)
In-Reply-To: <20070711142712.e646995b.akpm@linux-foundation.org>

Andrew Morton <akpm@linux-foundation.org> wrote:
> On Wed, 11 Jul 2007 22:01:37 +0100
> Alasdair G Kergon <agk@redhat.com> wrote:
> 
> > From: Mike Anderson <andmike@us.ibm.com>
> > 
> > This patch adds a dm-netlink skeleton support to the Makefile, and the dm
> > directory.
> > 
> > ...
> >  
> > +config DM_NETLINK
> > +	bool "DM netlink events (EXPERIMENTAL)"
> > +	depends on BLK_DEV_DM && EXPERIMENTAL
> > +	---help---
> > +	Generate netlink events for DM events.
> 
> Need a dependency on NET there?
> 

Yes.

> > ...
> >
> > +#ifdef CONFIG_DM_NETLINK
> > +
> > +int dm_netlink_init(void);
> > +void dm_netlink_exit(void);
> > +
> > +#else	/* CONFIG_DM_NETLINK */
> > +
> > +static inline int __init dm_netlink_init(void)
> 
> The __init here isn't needed (doesn't make sense, is missing the required
> #include anyway)
> 
> > +{
> > +	return 0;
> > +}
> > +static inline void dm_netlink_exit(void)
> > +{
> > +}
> > +
> > +#endif	/* CONFIG_DM_NETLINK */
> > +
> > +#endif	/* DM_NETLINK_H */
> > Index: linux/drivers/md/dm.c
> > ===================================================================
> > --- linux.orig/drivers/md/dm.c	2007-07-11 21:37:47.000000000 +0100
> > +++ linux/drivers/md/dm.c	2007-07-11 21:37:50.000000000 +0100
> > @@ -7,6 +7,7 @@
> >  
> >  #include "dm.h"
> >  #include "dm-bio-list.h"
> > +#include "dm-netlink.h"
> >  
> >  #include <linux/init.h>
> >  #include <linux/module.h>
> > @@ -176,6 +177,7 @@ int (*_inits[])(void) __initdata = {
> >  	dm_linear_init,
> >  	dm_stripe_init,
> >  	dm_interface_init,
> > +	dm_netlink_init,
> >  };
> >  
> >  void (*_exits[])(void) = {
> > @@ -184,6 +186,7 @@ void (*_exits[])(void) = {
> >  	dm_linear_exit,
> >  	dm_stripe_exit,
> >  	dm_interface_exit,
> > +	dm_netlink_exit,
> >  };
> 
> hm, so if CONFIG_DM_NETLINK=n we end up taking the address of an inlined
> function.  So the __init above _did_ make sense, in a peculiar way.  I
> don't know that gcc will actually put that converted-to-non-inline function
> into the desired section though.
> 
> There's no way in which those inlined functions will ever get inlined.
> Perhaps all this would be better if there was no implementation of
> dm_netlink_init() and dm_netlink_exit() if CONFIG_DM_NETLINK=n and you just
> whack the requisite ifdefs into these tables here?
> 

ok, I will switch to the ifdef CONFIG_DM_NETLINK in the tables.


> >  static int __init dm_init(void)
> > Index: linux/include/linux/netlink.h
> > ===================================================================
> > --- linux.orig/include/linux/netlink.h	2007-07-11 21:37:31.000000000 +0100
> > +++ linux/include/linux/netlink.h	2007-07-11 21:37:50.000000000 +0100
> > @@ -21,7 +21,7 @@
> >  #define NETLINK_DNRTMSG		14	/* DECnet routing messages */
> >  #define NETLINK_KOBJECT_UEVENT	15	/* Kernel messages to userspace */
> >  #define NETLINK_GENERIC		16
> > -/* leave room for NETLINK_DM (DM Events) */
> > +#define NETLINK_DM		17	/* Device Mapper */
> >  #define NETLINK_SCSITRANSPORT	18	/* SCSI Transports */
> >  #define NETLINK_ECRYPTFS	19
> 
> Have the net guys checked this?  

No. The support is a derivative of the netlink support in
scsi_transport_iscsi.c.

-andmike
--
Michael Anderson
andmike@us.ibm.com

  reply	other threads:[~2007-07-11 23:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070711210137.GE24114@agk.fab.redhat.com>
2007-07-11 21:27 ` [2.6.23 PATCH 13/18] dm: netlink Andrew Morton
2007-07-11 23:37   ` Mike Anderson [this message]
2007-07-12  8:10     ` Evgeniy Polyakov
2007-07-12 10:27       ` David Miller
2007-07-12 13:42         ` Mike Anderson
2007-07-12 23:19   ` Matt Mackall
2007-07-12 23:31     ` Andrew Morton
2007-07-13  2:00       ` [dm-devel] " Mike Anderson
2007-07-13 20:12         ` Valdis.Kletnieks
2007-07-13  7:03       ` Evgeniy Polyakov
2007-07-13  7:16         ` Kay Sievers
2007-07-12 23:45     ` Mike Anderson

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=20070711233736.GA29241@us.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).