[lttng-dev] [PATCH urcu] cds_lfht_is_node_deleted parameter can be marked const

2019-10-28 Thread Jérémie Galarneau
Mark the cds_lfht_node pointer parameter of cds_lfht_is_node_deleted
as const. The fact that this parameter is mutable makes it harder to
use liburcu in const-correct code.

Signed-off-by: Jérémie Galarneau 
---
 include/urcu/rculfhash.h | 2 +-
 src/rculfhash.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/urcu/rculfhash.h b/include/urcu/rculfhash.h
index cbf513e..20b822f 100644
--- a/include/urcu/rculfhash.h
+++ b/include/urcu/rculfhash.h
@@ -499,7 +499,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node 
*node);
  * This function does not issue any memory barrier.
  */
 extern
-int cds_lfht_is_node_deleted(struct cds_lfht_node *node);
+int cds_lfht_is_node_deleted(const struct cds_lfht_node *node);
 
 /*
  * cds_lfht_resize - Force a hash table resize
diff --git a/src/rculfhash.c b/src/rculfhash.c
index ff42df0..8e60f19 100644
--- a/src/rculfhash.c
+++ b/src/rculfhash.c
@@ -825,7 +825,7 @@ struct cds_lfht_node *clear_flag(struct cds_lfht_node *node)
 }
 
 static
-int is_removed(struct cds_lfht_node *node)
+int is_removed(const struct cds_lfht_node *node)
 {
return ((unsigned long) node) & REMOVED_FLAG;
 }
@@ -1829,7 +1829,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct 
cds_lfht_node *node)
return ret;
 }
 
-int cds_lfht_is_node_deleted(struct cds_lfht_node *node)
+int cds_lfht_is_node_deleted(const struct cds_lfht_node *node)
 {
return is_removed(CMM_LOAD_SHARED(node->next));
 }
-- 
2.23.0

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [PATCH urcu] cds_lfht_is_node_deleted parameter can be marked const

2019-10-28 Thread Mathieu Desnoyers
Merged into liburcu master, thanks!

Mathieu

- On Oct 28, 2019, at 3:24 PM, Jeremie Galarneau 
jeremie.galarn...@efficios.com wrote:

> Mark the cds_lfht_node pointer parameter of cds_lfht_is_node_deleted
> as const. The fact that this parameter is mutable makes it harder to
> use liburcu in const-correct code.
> 
> Signed-off-by: Jérémie Galarneau 
> ---
> include/urcu/rculfhash.h | 2 +-
> src/rculfhash.c  | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/urcu/rculfhash.h b/include/urcu/rculfhash.h
> index cbf513e..20b822f 100644
> --- a/include/urcu/rculfhash.h
> +++ b/include/urcu/rculfhash.h
> @@ -499,7 +499,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node
> *node);
>  * This function does not issue any memory barrier.
>  */
> extern
> -int cds_lfht_is_node_deleted(struct cds_lfht_node *node);
> +int cds_lfht_is_node_deleted(const struct cds_lfht_node *node);
> 
> /*
>  * cds_lfht_resize - Force a hash table resize
> diff --git a/src/rculfhash.c b/src/rculfhash.c
> index ff42df0..8e60f19 100644
> --- a/src/rculfhash.c
> +++ b/src/rculfhash.c
> @@ -825,7 +825,7 @@ struct cds_lfht_node *clear_flag(struct cds_lfht_node 
> *node)
> }
> 
> static
> -int is_removed(struct cds_lfht_node *node)
> +int is_removed(const struct cds_lfht_node *node)
> {
>   return ((unsigned long) node) & REMOVED_FLAG;
> }
> @@ -1829,7 +1829,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct 
> cds_lfht_node
> *node)
>   return ret;
> }
> 
> -int cds_lfht_is_node_deleted(struct cds_lfht_node *node)
> +int cds_lfht_is_node_deleted(const struct cds_lfht_node *node)
> {
>   return is_removed(CMM_LOAD_SHARED(node->next));
> }
> --
> 2.23.0

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] [PATCH lttng-modules] Add missing include for kernels between 3.8 and 3.15

2019-10-28 Thread Michael Jeanson
This is required at least for:
 v3.13.x
 v3.11.x
 v3.9.x
 v3.8.x

Signed-off-by: Michael Jeanson 
---
 lttng-context-mnt-ns.c | 1 +
 lttng-context-net-ns.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lttng-context-mnt-ns.c b/lttng-context-mnt-ns.c
index 98d5b8e..b5bb955 100644
--- a/lttng-context-mnt-ns.c
+++ b/lttng-context-mnt-ns.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/lttng-context-net-ns.c b/lttng-context-net-ns.c
index 24d7ae3..6694037 100644
--- a/lttng-context-net-ns.c
+++ b/lttng-context-net-ns.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.17.1

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [PATCH lttng-modules] Add missing include for kernels between 3.8 and 3.15

2019-10-28 Thread Mathieu Desnoyers
Merged into master, thanks!

Mathieu

- On Oct 28, 2019, at 4:28 PM, Michael Jeanson mjean...@efficios.com wrote:

> This is required at least for:
> v3.13.x
> v3.11.x
> v3.9.x
> v3.8.x
> 
> Signed-off-by: Michael Jeanson 
> ---
> lttng-context-mnt-ns.c | 1 +
> lttng-context-net-ns.c | 1 +
> 2 files changed, 2 insertions(+)
> 
> diff --git a/lttng-context-mnt-ns.c b/lttng-context-mnt-ns.c
> index 98d5b8e..b5bb955 100644
> --- a/lttng-context-mnt-ns.c
> +++ b/lttng-context-mnt-ns.c
> @@ -13,6 +13,7 @@
> #include 
> #include 
> #include 
> +#include 
> #include 
> #include 
> #include 
> diff --git a/lttng-context-net-ns.c b/lttng-context-net-ns.c
> index 24d7ae3..6694037 100644
> --- a/lttng-context-net-ns.c
> +++ b/lttng-context-net-ns.c
> @@ -12,6 +12,7 @@
> #include 
> #include 
> #include 
> +#include 
> #include 
> #include 
> #include 
> --
> 2.17.1

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev