]> granicus.if.org Git - zfs/commitdiff
gcc build error: -Wbool-compare in metaslab.c
authorDHE <git@dehacked.net>
Sun, 27 Mar 2016 19:58:27 +0000 (15:58 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 30 Mar 2016 16:36:51 +0000 (09:36 -0700)
When debugging is enabled on a very recent version of gcc
(tested with 5.3.0), DVA_SET_GANG(dva, !!(flags)) fails
because an assertion causes a comparison between what is
technically a boolean and an integer.

Signed-off-by: DHE <git@dehacked.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4465

module/zfs/metaslab.c

index 19323cdb8ce5f654038d47cf498d9d9eb4bf0569..c2c1d2dfc385d0488a4997b93c6e8826cd7cf4ce 100644 (file)
@@ -2390,7 +2390,8 @@ top:
 
                        DVA_SET_VDEV(&dva[d], vd->vdev_id);
                        DVA_SET_OFFSET(&dva[d], offset);
-                       DVA_SET_GANG(&dva[d], !!(flags & METASLAB_GANG_HEADER));
+                       DVA_SET_GANG(&dva[d],
+                           ((flags & METASLAB_GANG_HEADER) ? 1 : 0));
                        DVA_SET_ASIZE(&dva[d], asize);
 
                        if (flags & METASLAB_FASTWRITE) {