* [dm-devel] [PATCH] libmultipath: fix build without LIBDM_API_DEFERRED
@ 2021-05-20 19:52 mwilck
2021-05-24 15:55 ` Benjamin Marzinski
0 siblings, 1 reply; 2+ messages in thread
From: mwilck @ 2021-05-20 19:52 UTC (permalink / raw)
To: Christophe Varoqui, Benjamin Marzinski
Cc: Paul Menzel, dm-devel, Martin Wilck
From: Martin Wilck <mwilck@suse.com>
Build fails on distributions that don't support DM_DEFERRED_REMOVE
(libdevmapper < 1.02.89). Fix it.
Resolves: https://github.com/opensvc/multipath-tools/issues/7
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
libmultipath/devmapper.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index 095cbc0..47a6d60 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -49,6 +49,9 @@ static int dm_conf_verbosity;
#ifdef LIBDM_API_DEFERRED
static int dm_cancel_remove_partmaps(const char * mapname);
+#define __DR_UNUSED__ /* empty */
+#else
+#define __DR_UNUSED__ __attribute__((unused))
#endif
static int do_foreach_partmaps(const char * mapname,
@@ -384,7 +387,8 @@ libmp_dm_task_create(int task)
#define do_deferred(x) ((x) == DEFERRED_REMOVE_ON || (x) == DEFERRED_REMOVE_IN_PROGRESS)
static int
-dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags, int deferred_remove) {
+dm_simplecmd (int task, const char *name, int no_flush, int need_sync,
+ uint16_t udev_flags, int deferred_remove __DR_UNUSED__) {
int r = 0;
int udev_wait_flag = ((need_sync || udev_flags) &&
(task == DM_DEVICE_RESUME ||
@@ -1122,7 +1126,8 @@ dm_flush_map_nopaths(const char * mapname, int deferred_remove)
#else
int
-dm_flush_map_nopaths(const char * mapname, int deferred_remove)
+dm_flush_map_nopaths(const char * mapname,
+ int deferred_remove __attribute__((unused)))
{
return _dm_flush_map(mapname, 1, 0, 0, 0);
}
@@ -1573,7 +1578,7 @@ dm_cancel_deferred_remove (struct multipath *mpp)
#else
int
-dm_cancel_deferred_remove (struct multipath *mpp)
+dm_cancel_deferred_remove (struct multipath *mpp __attribute__((unused)))
{
return 0;
}
--
2.31.1
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [dm-devel] [PATCH] libmultipath: fix build without LIBDM_API_DEFERRED
2021-05-20 19:52 [dm-devel] [PATCH] libmultipath: fix build without LIBDM_API_DEFERRED mwilck
@ 2021-05-24 15:55 ` Benjamin Marzinski
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Marzinski @ 2021-05-24 15:55 UTC (permalink / raw)
To: mwilck; +Cc: dm-devel, Paul Menzel
On Thu, May 20, 2021 at 09:52:08PM +0200, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
>
> Build fails on distributions that don't support DM_DEFERRED_REMOVE
> (libdevmapper < 1.02.89). Fix it.
>
> Resolves: https://github.com/opensvc/multipath-tools/issues/7
> Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
> libmultipath/devmapper.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
> index 095cbc0..47a6d60 100644
> --- a/libmultipath/devmapper.c
> +++ b/libmultipath/devmapper.c
> @@ -49,6 +49,9 @@ static int dm_conf_verbosity;
>
> #ifdef LIBDM_API_DEFERRED
> static int dm_cancel_remove_partmaps(const char * mapname);
> +#define __DR_UNUSED__ /* empty */
> +#else
> +#define __DR_UNUSED__ __attribute__((unused))
> #endif
>
> static int do_foreach_partmaps(const char * mapname,
> @@ -384,7 +387,8 @@ libmp_dm_task_create(int task)
> #define do_deferred(x) ((x) == DEFERRED_REMOVE_ON || (x) == DEFERRED_REMOVE_IN_PROGRESS)
>
> static int
> -dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags, int deferred_remove) {
> +dm_simplecmd (int task, const char *name, int no_flush, int need_sync,
> + uint16_t udev_flags, int deferred_remove __DR_UNUSED__) {
> int r = 0;
> int udev_wait_flag = ((need_sync || udev_flags) &&
> (task == DM_DEVICE_RESUME ||
> @@ -1122,7 +1126,8 @@ dm_flush_map_nopaths(const char * mapname, int deferred_remove)
> #else
>
> int
> -dm_flush_map_nopaths(const char * mapname, int deferred_remove)
> +dm_flush_map_nopaths(const char * mapname,
> + int deferred_remove __attribute__((unused)))
> {
> return _dm_flush_map(mapname, 1, 0, 0, 0);
> }
> @@ -1573,7 +1578,7 @@ dm_cancel_deferred_remove (struct multipath *mpp)
> #else
>
> int
> -dm_cancel_deferred_remove (struct multipath *mpp)
> +dm_cancel_deferred_remove (struct multipath *mpp __attribute__((unused)))
> {
> return 0;
> }
> --
> 2.31.1
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-24 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 19:52 [dm-devel] [PATCH] libmultipath: fix build without LIBDM_API_DEFERRED mwilck
2021-05-24 15:55 ` Benjamin Marzinski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.