summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2021-02-15 13:15:50 -0500
committerGitHub <[email protected]>2021-02-15 10:15:50 -0800
commit436ab35a53bad83c3dc4b8f1dc2b6ad00bd5e9ec (patch)
treea38ec2f4bf741b06a7505a9f1fceaf82726a1d5c
parentc1c31a835a7c57dac7d9a6026f075c0bd7f43fa6 (diff)
Make inline ABD predicates compatible with C++
FreeBSD's zfsd fails to build after e2af2acce3 due to strict type checking errors from the implicit conversion between bool and boolean_t in the inline predicate definitions in abd.h. Use conditionals to return the correct value type from these functions. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11592
-rw-r--r--include/sys/abd.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sys/abd.h b/include/sys/abd.h
index 55db8c1a0..a7eee89ca 100644
--- a/include/sys/abd.h
+++ b/include/sys/abd.h
@@ -177,19 +177,19 @@ abd_zero(abd_t *abd, size_t size)
static inline boolean_t
abd_is_linear(abd_t *abd)
{
- return ((abd->abd_flags & ABD_FLAG_LINEAR) != 0);
+ return ((abd->abd_flags & ABD_FLAG_LINEAR) ? B_TRUE : B_FALSE);
}
static inline boolean_t
abd_is_linear_page(abd_t *abd)
{
- return ((abd->abd_flags & ABD_FLAG_LINEAR_PAGE) != 0);
+ return ((abd->abd_flags & ABD_FLAG_LINEAR_PAGE) ? B_TRUE : B_FALSE);
}
static inline boolean_t
abd_is_gang(abd_t *abd)
{
- return ((abd->abd_flags & ABD_FLAG_GANG) != 0);
+ return ((abd->abd_flags & ABD_FLAG_GANG) ? B_TRUE : B_FALSE);
}
static inline uint_t