-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Extending FreeBSD UIO Struct #11438
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
Extending FreeBSD UIO Struct #11438
Conversation
7e6a08c
to
31a8622
Compare
31a8622
to
a201d36
Compare
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.
This turned out pretty nicely. Just a few small comments.
a201d36
to
7de40ef
Compare
@lundman @freqlabs would you mind having another look at this. |
7de40ef
to
7a85538
Compare
The macOS companion commit to this would look something like openzfsonosx/openzfs@4d4f088 quite similar to FreeBSD work, and it is nice to clean up the uio_t header hack. I did not 'do' zio_crypt.c Also occurs to me that common code now uses |
7a85538
to
7fd2d38
Compare
Looks good! Thanks for running down that last issue, everything looks like it's in good order now. |
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 also see a few comments in module/zfs/dmu.c referring to uio->uio_loffset but otherwise all the common code looks to be converted based on a quick grep.
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interaces to be zfs_uio_* to make it clear this is a ZFS interface. Signed-off-by: Brian Atkinson <[email protected]>
Adding zfs_uio_setoffset() to allow for macOS, FreeBSD, and Linux to have a common zfs_uio_t interface. This also is a cleaner way of setting the zfs_uio_t offset as opposed to doing an assignment through macros. Signed-off-by: Brian Atkinson <[email protected]>
Fixing a lingering uio->uio_loffset in the common zfs_vnops code and updating comments in dmu.c that referred to uio->uio_loffset to now say zfs_uio_offset(uio). Signed-off-by: Brian Atkinson <[email protected]>
7fd2d38
to
96fb570
Compare
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#11438
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#11438
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#11438
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#11438
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#11438
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#11438
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Brian Atkinson <[email protected]> Closes openzfs#11438
In FreeBSD the struct uio was just a typedef to uio_t. In order to
extend this struct, outside of the definition for the struct uio, the
struct uio has been embedded inside of a uio_t struct.
Signed-off-by: Brian Atkinson [email protected]
This patch is to allow for the FreeBSD to extend the uio_t struct. Originally, uio_t was just a typedef to a
struct uio. By embedding the struct uio inside of a uio_t struct further member variables can be added
for FreeBSD.
Motivation and Context
One such case where there is a advantage to this is PR #10018. In order to move the mappings of user pages
in to kernel space into the VFS layers, FreeBSD's uio_t struct can be extended to contain a vm_page_t * and
uio_extflg variables.
Description
I removed the typedef of stuct uio to uio_t and instead placed a struct uio pointer inside of a
uio_t struct. I also added/updated some macros for accessing the member variables of the
underlying struct uio in the uio_t. This allows for common code to still use uio_t's for both
FreeBSD and Linux as was already the case.
How Has This Been Tested?
Ran zloop for 30 mins both Linux and FreeBSD.
Linux: 4.18.0-193
FreeBSD: 12.1 STABLE
Types of changes
Checklist:
Signed-off-by
.