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

drr_begin: can't forward declare untagged struct #10453

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

lundman
Copy link
Contributor

@lundman lundman commented Jun 15, 2020

C++ doesn't like the way struct dmu_replay_record is defined.

Motivation and Context

To please Apple's clang++.

Description

When compiling with Clang++ it does not allow for untagged structs, so
struct ddr_begin needs to be declared before the struct that uses it.

../../../../include/sys/zfs_ioctl.h:484:19: error: field has incomplete type
'struct drr_begin'
struct drr_begin zc_begin_record;

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)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

When compiling with Clang++ it does not allow for untagged structs, so
struct ddr_begin needs to be declared before the struct that uses it.

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
@codecov
Copy link

codecov bot commented Jun 15, 2020

Codecov Report

Merging #10453 into master will decrease coverage by 0.63%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10453      +/-   ##
==========================================
- Coverage   80.24%   79.60%   -0.64%     
==========================================
  Files         293      393     +100     
  Lines       83882   123859   +39977     
==========================================
+ Hits        67313    98601   +31288     
- Misses      16569    25258    +8689     
Flag Coverage Δ
#kernel 79.91% <ø> (-0.33%) ⬇️
#user 65.92% <ø> (?)
Impacted Files Coverage Δ
module/os/linux/spl/spl-zlib.c 55.35% <0.00%> (-28.58%) ⬇️
module/zfs/zcp_set.c 87.09% <0.00%> (-12.91%) ⬇️
module/os/linux/spl/spl-kmem-cache.c 75.22% <0.00%> (-9.77%) ⬇️
module/zfs/zfs_ratelimit.c 90.47% <0.00%> (-9.53%) ⬇️
module/zfs/dmu_redact.c 82.15% <0.00%> (-6.24%) ⬇️
module/zfs/zfs_byteswap.c 79.45% <0.00%> (-5.85%) ⬇️
module/zcommon/zfs_deleg.c 92.45% <0.00%> (-5.55%) ⬇️
module/zfs/bpobj.c 86.86% <0.00%> (-5.15%) ⬇️
module/zcommon/zfeature_common.c 92.85% <0.00%> (-4.82%) ⬇️
module/zfs/aggsum.c 95.34% <0.00%> (-4.66%) ⬇️
... and 281 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 883a40f...2db901c. Read the comment docs.

@behlendorf behlendorf added Status: Code Review Needed Ready for review and testing Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jun 16, 2020
@behlendorf behlendorf merged commit cd07d7c into openzfs:master Jun 16, 2020
lundman referenced this pull request in openzfsonosx/openzfs Jun 19, 2020
When compiling with Clang++ it does not allow for untagged structs, so
struct ddr_begin needs to be declared before the struct that uses it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #10453
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
When compiling with Clang++ it does not allow for untagged structs, so
struct ddr_begin needs to be declared before the struct that uses it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes openzfs#10453
@lundman lundman deleted the macOS_pr7 branch May 28, 2021 05:21
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
When compiling with Clang++ it does not allow for untagged structs, so
struct ddr_begin needs to be declared before the struct that uses it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes openzfs#10453
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.

2 participants