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

Allow sys/vdev_disk.h to have OS fields #10452

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

lundman
Copy link
Contributor

@lundman lundman commented Jun 15, 2020

Move OS specific fields from vdev_disk.h into (new) platform header.

Motivation and Context

macOS and FreeBSD doesn't need to know what a struct block_device is, and I guarantee Linux and FreeBSD do not want to know about class iokit::storage::ioblockdevice.

Description

Based on the same style as zfs_znode_os.h.
Create an os/$platform/sys/vdev_disk_os.h for each platform, move
Linux specific fields into it. Currently it leaves FreeBSD's empty.

macOS header file will come in a future PR. If you are curious, it will look something like:
https://github.com/openzfsonosx/openzfs/blob/sorted2/include/os/macos/zfs/sys/vdev_disk_os.h#L26

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)
  • Code porting (possibly-breaking change which makes code more universal)

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.

@codecov
Copy link

codecov bot commented Jun 15, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10452      +/-   ##
==========================================
- Coverage   80.24%   79.44%   -0.81%     
==========================================
  Files         293      393     +100     
  Lines       83882   123859   +39977     
==========================================
+ Hits        67313    98397   +31084     
- Misses      16569    25462    +8893     
Flag Coverage Δ
#kernel 80.05% <ø> (-0.20%) ⬇️
#user 65.43% <ø> (?)
Impacted Files Coverage Δ
module/os/linux/zfs/vdev_disk.c 84.43% <ø> (+1.16%) ⬆️
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/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/zcommon/zfeature_common.c 92.85% <0.00%> (-4.82%) ⬇️
module/zfs/aggsum.c 95.34% <0.00%> (-4.66%) ⬇️
module/zfs/dsl_deleg.c 90.07% <0.00%> (-4.48%) ⬇️
... and 283 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...6774579. Read the comment docs.

include/sys/vdev_disk.h Outdated Show resolved Hide resolved
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jun 15, 2020
Linux defines different vdev_disk_t members to macOS, but they are
generally only used in vdev_disk.c

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

lundman commented Jun 16, 2020

Heh it became almost nothing :)

typedef struct vdev_disk {
ddi_devid_t vd_devid;
char *vd_minor;
struct block_device *vd_bdev;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little surprised this ever worked on FreeBSD 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think FreeBSD even includes the header which is why it was OK.

@behlendorf behlendorf added 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 d366c8f into openzfs:master Jun 16, 2020
lundman referenced this pull request in openzfsonosx/openzfs Jun 19, 2020
Linux defines different vdev_disk_t members to macOS, but they are
only used in vdev_disk.c so move the declaration there.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #10452
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
Linux defines different vdev_disk_t members to macOS, but they are
only used in vdev_disk.c so move the declaration there.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes openzfs#10452
@lundman lundman deleted the macOS_pr6 branch May 28, 2021 05:21
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
Linux defines different vdev_disk_t members to macOS, but they are
only used in vdev_disk.c so move the declaration there.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes openzfs#10452
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