[PATCH 2.6.22-rc6-mm1] compile error when CONFIG_DM_NETLINK is not defined

Dave Kleikamp
2007-06-28T14:49:59Z

On Thu, 2007-06-28 at 03:43 -0700, Andrew Morton wrote:
> -agk-dm-dm-use-singlethread-workqueues.patch
> +agk-dm-dm-use-singlethread-workqueues.patch
> +agk-dm-dm-snapshot-fix-invalidation-deadlock.patch
> +agk-dm-dm-snapshot-permit-invalid-activation.patch
> +agk-dm-dm-raid1-clear-region-outside-spinlock.patch
> +agk-dm-dm-netlink.patch
> +agk-dm-dm-netlink-add-to-core.patch
> +agk-dm-dm-netlink-mpath.patch
> +agk-dm-dm-mpath-rdac.patch
>
> device mapper tree updates

I got this compile error:

LD drivers/md/built-in.o
drivers/md/dm-multipath.o: In function `dm_path_event':
drivers/md/dm-netlink.h:56: multiple definition of `dm_path_event'
drivers/md/dm-mod.o:drivers/md/dm-netlink.h:56: first defined here
drivers/md/dm-multipath.o: In function `dm_netlink_send_events':
drivers/md/dm-netlink.h:51: multiple definition of `dm_netlink_send_events'
drivers/md/dm-mod.o:drivers/md/dm-netlink.h:51: first defined here
make[2]: *** [drivers/md/built-in.o] Error 1

I was able to fix it by making the dummy inline functions static.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

diff -Nurp linux-2.6.22-rc6-mm1/drivers/md/dm-netlink.h linux/drivers/md/dm-netlink.h
--- linux-2.6.22-rc6-mm1/drivers/md/dm-netlink.h 2007-06-28 05:50:38.000000000 -0500
+++ linux/drivers/md/dm-netlink.h 2007-06-28 09:10:15.000000000 -0500
@@ -47,10 +47,10 @@ static inline int __init dm_netlink_init
static inline void dm_netlink_exit(void)
{
}
-void inline dm_netlink_send_events(struct list_head *events)
+static void inline dm_netlink_send_events(struct list_head *events)
{
}
-void inline dm_path_event(enum dm_netlink_event_type evt_type,
+static void inline dm_path_event(enum dm_netlink_event_type evt_type,
struct dm_table *t, const char *path,
int nr_valid_paths)
{

--
David Kleikamp
IBM Linux Technology Center