-
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
zfs_vnops: make zfs_get_data OS-independent #10979
zfs_vnops: make zfs_get_data OS-independent #10979
Conversation
Requesting @mattmacy for review. |
e7968c2
to
c449627
Compare
@problame Seems to be small typo in commit message 's/zfs_rele_async/zfs_zrele_async/' |
This is the I'm afraid I don't understand why the module builds on FreeBSD (but doesn't load?). |
|
Dmesg is captured as console You'll need to add the new file to module/Makefile.bsd for the FreeBSD build. |
c449627
to
44145dd
Compare
Welcome to the jungle... 😅 |
I'll set up a FreeBSD dev system. |
How do you feel about this refactor in general? Is this duplication intentional and intended to stay long-term or was it just easier to initially duplicate code for a faster FreeBSD port? |
It was easier and faster to keep the the ZPL bits in vnops/vfsops separate. There is indeed a lot of refactoring that should be done to share more of the code, and I see that as a worthwhile effort. I haven't closely audited your changes yet, but at a glance there is one suggestion I have, apart from setting yourself up with a FreeBSD VM and getting it to build on FreeBSD. Rather than *_common.c, the convention has been to name the platform-dependent files *_os.c where there is a name collision between files in common and platform code. |
a35dc5e
to
86d8a78
Compare
I restructured the PR to follow this pattern and updated the commit message accordingly. I set up a test VM with FreeBSD 12.1 release and found that my version of |
The build errors appear to be all 32-bit platforms, except Fedora. Not sure what happened to that one. |
86d8a78
to
aa202c7
Compare
@freqlabs I addressed the issues mentioned in the review and rebased onto master. Your |
There seemed to be some differences after all in how those functions are implemented. I don't fully understand why, but as I recall the Linux code passes around ownership of some strings instead of merely borrowing the strings from the caller. The eventual call to It would be good to investigate further if it is really necessary to pass around the string ownership like that. |
Agreed, although that won't be part of this PR. |
I wasn't aware of this PR and just re-did the bulk of the re-factoring. I need to share some common code for the async I/O rework. |
@mattmacy certainly. Could you please link to the commits where you did this refactoring? |
Please see also #11078 |
@problame It looks like the core of your changes should be just drop in on top of mine |
I guess this PR is obsolete, then. Close at your discretion. |
These changes nicely complement the work done in #11078. Let's get that PR in first then this work can be applied on top. |
@problame if you just keep your vnops changes we can get that merged |
Sry, I've been awfully busy in the last few days. I'll try to get it done until the end of the week! |
closes openzfs#10979 Signed-off-by: Christian Schwarz <me@cschwarz.com>
aa202c7
to
288ed4a
Compare
Rebase is done and it builds on my test VMs. |
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.
Looks good. Thanks!
Move zfs_get_data() in to platform-independent code. The only platform-specific aspect of it is the way we release an inode (Linux) / vnode_t (FreeBSD). I am not aware of a platform that could be supported by ZFS that couldn't implement zfs_rele_async itself. It's sibling zvol_get_data already is platform-independent. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Christian Schwarz <me@cschwarz.com> Closes openzfs#10979
Move zfs_get_data() in to platform-independent code. The only platform-specific aspect of it is the way we release an inode (Linux) / vnode_t (FreeBSD). I am not aware of a platform that could be supported by ZFS that couldn't implement zfs_rele_async itself. It's sibling zvol_get_data already is platform-independent. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Christian Schwarz <me@cschwarz.com> Closes openzfs#10979
Move zfs_get_data() in to platform-independent code. The only platform-specific aspect of it is the way we release an inode (Linux) / vnode_t (FreeBSD). I am not aware of a platform that could be supported by ZFS that couldn't implement zfs_rele_async itself. It's sibling zvol_get_data already is platform-independent. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Christian Schwarz <me@cschwarz.com> Closes openzfs#10979
Move zfs_get_data() in to platform-independent code. The only platform-specific aspect of it is the way we release an inode (Linux) / vnode_t (FreeBSD). I am not aware of a platform that could be supported by ZFS that couldn't implement zfs_rele_async itself. It's sibling zvol_get_data already is platform-independent. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Christian Schwarz <me@cschwarz.com> Closes #10979
Motivation
zfs_get_data
is almost platform-independentzvol_get_data
already is platform-independentvnode_t
(FreeBSD)zfs_rele_async
itself.Future work: evaluate whether we could make all interactions with inode / vnode lifecycle management C-style virtual function calls (i.e. store function pointers to the platform-specific lifecycle functions in the znode).
How Has This Been Tested?
Straight-forward refactor -> rely on ZFS test suite in OpenZFS CI.
Types of changes
Checklist:
Signed-off-by
.