-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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>
Heh it became almost nothing :) |
typedef struct vdev_disk { | ||
ddi_devid_t vd_devid; | ||
char *vd_minor; | ||
struct block_device *vd_bdev; |
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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.
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
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
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
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 aboutclass 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
Checklist:
Signed-off-by
.