Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Aug 2017 10:31:42 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r322219 - vendor-sys/illumos/dist/uts/common/fs/zfs/sys
Message-ID:  <201708081031.v78AVgTo023944@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Aug  8 10:31:42 2017
New Revision: 322219
URL: https://svnweb.freebsd.org/changeset/base/322219

Log:
  8416 abd.h is not C++ friendly
  
  illumos/illumos-gate@5e2a074725cb7c16ea1c6554da11ab4d6b4e7aee
  https://github.com/illumos/illumos-gate/commit/5e2a074725cb7c16ea1c6554da11ab4d6b4e7aee
  
  https://www.illumos.org/issues/8416
    A C++ compiler fails to compile abd_is_linear(), which is an inline function
    defined in abd.h, with the following error:
         error: cannot initialize return object of type 'boolean_t' with an
         rvalue of type 'bool'
    That happens because a bool can not be converted to an enum in C++.
    That's a problem because abd.h can be visible through other header files that a
    C++ program that works with ZFS can include.
  
  Reviewed by: Igor Kozhukhov <igor@dilos.org>
  Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
  Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Andriy Gapon <avg@FreeBSD.org>

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/abd.h

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/abd.h
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/abd.h	Tue Aug  8 10:30:49 2017	(r322218)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/abd.h	Tue Aug  8 10:31:42 2017	(r322219)
@@ -60,7 +60,7 @@ extern boolean_t zfs_abd_scatter_enabled;
 inline boolean_t
 abd_is_linear(abd_t *abd)
 {
-	return ((abd->abd_flags & ABD_FLAG_LINEAR) != 0);
+	return ((abd->abd_flags & ABD_FLAG_LINEAR) != 0 ? B_TRUE : B_FALSE);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708081031.v78AVgTo023944>