Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD: fix compilation of FreeBSD world after 29274c9f6 #12282

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

mmatuska
Copy link
Contributor

Motivation and Context

When compiling world on FreeBSD HEAD, clang 12 does complain about two issues:

  1. prng32_bounded() is availabe to kernel only
  2. When compiling zstd_event.cc it requires random_get_pseudo_bytes() to be called with (uint8_t *) instead of (void *)

Description

  • FreeBSD: Compile in prng32_bounded() only for kernel
  • FreeBSD and Linux: do inline random_get_pseudo_bytes() with (uint8_t *).

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

prng32_bounded() is availabe to kernel only on FreeBSD 13+.

Call inline random_get_pseudo_bytes() with correct pointer type.
To be consistent, apply to Linux as well.

Signed-off-by: Martin Matuska <mm@FreeBSD.org>
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Jun 25, 2021
@behlendorf behlendorf merged commit 14d2841 into openzfs:master Jun 25, 2021
ghost pushed a commit to truenas/zfs that referenced this pull request Sep 17, 2021
prng32_bounded() is available to kernel only on FreeBSD 13+.

Call inline random_get_pseudo_bytes() with correct pointer type.
To be consistent, apply to Linux as well.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Martin Matuska <mm@FreeBSD.org>
Closes openzfs#12282
mmatuska added a commit to mmatuska/zfs that referenced this pull request Sep 18, 2021
prng32_bounded() is available to kernel only on FreeBSD 13+.

Call inline random_get_pseudo_bytes() with correct pointer type.
To be consistent, apply to Linux as well.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Martin Matuska <mm@FreeBSD.org>
Closes openzfs#12282
tonyhutter pushed a commit that referenced this pull request Nov 2, 2021
prng32_bounded() is available to kernel only on FreeBSD 13+.

Call inline random_get_pseudo_bytes() with correct pointer type.
To be consistent, apply to Linux as well.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Martin Matuska <mm@FreeBSD.org>
Closes #12282
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants