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

Update ZFS_IOC offsets for FreeBSD #9667

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

mattmacy
Copy link
Contributor

@mattmacy mattmacy commented Dec 2, 2019

Signed-off-by: Matt Macy [email protected]

Motivation and Context

Description

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:

Copy link
Contributor

@allanjude allanjude left a comment

Choose a reason for hiding this comment

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

Reviewed By: Allan Jude [email protected]

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

Looks like you may have forgotten to include the matching ./tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c changes.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Dec 3, 2019
@mattmacy
Copy link
Contributor Author

mattmacy commented Dec 3, 2019

./tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.

Fixed.

include/sys/fs/zfs.h Show resolved Hide resolved
ZFS_IOC_FREEBSD = ZFS_IOC_FIRST + 0xc0,
ZFS_IOC_NEXTBOOT, /* 0xc1 */
ZFS_IOC_JAIL, /* 0xc2 */
ZFS_IOC_UNJAIL, /* 0xc3 */
Copy link
Contributor

Choose a reason for hiding this comment

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

Before we officially commit this range by using these reserved values let's check with @lundman. We may want to reserve smaller groups of 32 to leave space for MacOS and windows.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, on OSX:
+ 0xD0 and we define one (ZFS_IOC_PROXY_DATASET)

On Windows:
+ 0xE0 and we define three (ZFS_IOC_MOUNT. ZFS_IOC_UNMOUNT, ZFS_IOC_UNREGISTER_FS)

Unfortunately, Windows ioctls are a bit weird (they go up by increments of +4), so I had to spell them out:

https://github.com/openzfsonwindows/ZFSin/blob/master/ZFSin/zfs/include/sys/zfs_ioctl.h#L533

The CTL_CODE macro shifts the "index" << 2, hence the +4. So the Windows table might have to be separate, unless there is something clever we can do?

Copy link
Contributor

Choose a reason for hiding this comment

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

(Hmm and I should probably fix that lone ZFS_IOC_RECV_NEW o_O )

Copy link
Contributor

Choose a reason for hiding this comment

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

Well these don't have to be entirely consistent across platforms, it more for our own convenience when reserving values. It sound like it may make the most sense for windows to do its own thing when we get to that point.

include/sys/fs/zfs.h Outdated Show resolved Hide resolved
ZFS_IOC_FREEBSD = ZFS_IOC_FIRST + 0xc0,
ZFS_IOC_NEXTBOOT, /* 0xc1 */
ZFS_IOC_JAIL, /* 0xc2 */
ZFS_IOC_UNJAIL, /* 0xc3 */
Copy link
Contributor

Choose a reason for hiding this comment

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

Well these don't have to be entirely consistent across platforms, it more for our own convenience when reserving values. It sound like it may make the most sense for windows to do its own thing when we get to that point.

@mattmacy mattmacy force-pushed the projects/zfs_ioc branch 3 times, most recently from 53051d8 to b071969 Compare December 5, 2019 01:36
@codecov
Copy link

codecov bot commented Dec 5, 2019

Codecov Report

Merging #9667 into master will increase coverage by <1%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #9667    +/-   ##
========================================
+ Coverage      79%      79%   +<1%     
========================================
  Files         418      418            
  Lines      123562   123562            
========================================
+ Hits        98093    98177    +84     
+ Misses      25469    25385    -84
Flag Coverage Δ
#kernel 80% <ø> (ø) ⬆️
#user 67% <100%> (ø) ⬆️

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 12395c7...45a0975. Read the comment docs.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 5, 2019
@behlendorf behlendorf merged commit 054a049 into openzfs:master Dec 5, 2019
@mattmacy mattmacy deleted the projects/zfs_ioc branch December 19, 2019 22:38
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.

4 participants