Page MenuHomeFreeBSD

zfs: only define B_FALSE/B_TRUE if NEED_SOLARIS_BOOLEAN is not set
AbandonedPublic

Authored by kp on Jun 27 2022, 8:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 31 2023, 7:51 AM
Unknown Object (File)
Dec 20 2023, 7:34 AM
Unknown Object (File)
Sep 24 2023, 7:14 PM
Unknown Object (File)
Sep 20 2023, 6:49 AM
Unknown Object (File)
Aug 16 2023, 12:22 PM
Unknown Object (File)
Jun 22 2023, 7:19 PM
Unknown Object (File)
May 27 2023, 7:16 AM
Unknown Object (File)
May 3 2023, 7:22 PM
Subscribers

Details

Reviewers
freqlabs
imp
Group Reviewers
ZFS
pfsense
Summary

If NEED_SOLARIS_BOOLEAN is defined we define an enum boolean_t, which
defines B_TRUE/B_FALSE as well. If we have both the define and the enum
things don't build (because that translates to
'enum { 0, 1 } boolean_t').

While here also remove an incorrect '#else'. With it in place we only
parse a section if the include guard is triggered. So we'd only use that
code if this file is included twice. This is clearly unintended, and
also means we don't get the 'boolean_t' definition. Fix this.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 46128
Build 43017: arc lint + arc unit

Event Timeline

kp requested review of this revision.Jun 27 2022, 8:54 AM
This revision is now accepted and ready to land.Jun 27 2022, 3:02 PM

The meat of this change is correct. I agree it should be committed upstream first if at all possible (or at least accepted first).
Add the PR to openzfs here and I'll comment there as well.
And thanks for the description of why you deleted that #else... I was having trouble matching it to anything and your description made it super clear what it was :)

sys/contrib/openzfs/include/os/freebsd/spl/sys/types.h
96

Most of the other #ifs/#else/#endif in this file have /* condition */ tags, maybe this should too?

This got merged through openzfs, so this is no longer relevant.