- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.9k
          Lift userspace definitions out of zfs_context.h
          #17861
        
          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
base: master
Are you sure you want to change the base?
Conversation
e75afb5    to
    5d26232      
    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.
Very nice! Aside from a a couple small nits this is a welcome bit of long overdue refactoring.
For next steps I think it would make the most sense to move the remaining user space implementations out of libzpool and into libspl.  It looks like lib/libzpool/kernel.c and lib/libzpool/taskq.c should cover almost everything.
Do you want to tackle that in this PR or another? I'm fine with pulling in this whole stack of commits, having it broken up made it much easier to review.
| Actually, responding to both your comments, I realised what happened here:  Both those functions are very libzpool-specific, so they can either say in  I'll give it a try. I think there's at least enough overlap with this PR that it could go here, but I'll see how it shakes out - if its ick enough, maybe the next PR is better. More soon! | 
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Keeping the spl/zfs module split, libzpool is the zfs module for userspace. Headers and functions specific to it belong there.
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
…for userspace Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
The extra inclusion via xvattr.h appears to upset the linter in CI. I'm not entirely sure what its complaint is, but removing sys/string.h entirely is not quite possible yet, and include guards are rarely a bad idea, so this will do. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
sys/debug.h is not really the right place for them, but we already have some there for libspl, so it is at least convenient. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
These are kind-of compiler attribute placeholders, so go here with the others for now. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]>
5d26232    to
    c7b256c      
    Compare
  
    | @behlendorf ok, here we go. This actually doubles the size of the PR, but I'm not sure it cleanly splits into two. Let me know what you think. If I don't split, I should rewrite the OP at least. The whole thing here is ensuring the the implementations of things live in the same place as their headers. So there's a bunch of stuff moved over to  It's a lot, but I think it lands in a good place. | 
| This is looking good, and it definitely feels like we're moving in the right direction. Where I'd really like to end up is only including the  I took the liberty of pushing this PR a bit further with the above goal in mind. What do think of these proposed additions from https://github.com/behlendorf/zfs/tree/userspace-context-lift-part-2. 
 It might be a good idea to go even farther and move the headers in to  | 
Motivation and Context
As part of my ongoing project to make userspace into a "first class" platform, and to make OpenZFS easier to port to other platforms, I am working to make headers consistent across all platforms. I would like to get to a point where
zfs_context.his the same for all platforms and compile modes, and so provides a complete list of "necessary to implement" for any platform.The first part of that is to lift all the userspace-specific stuff out of
zfs_context.hinto separated headers inlib/libspl/include. That's this PR.This PR deliberately stops at emptying
zfs_context.hof definitions. The next PR I open on this project will collapse it into a single list of headers that works across all platforms, but that will require movement across all platform headers, not just userspace, and I don't want to complicate review on this further.Description
There's a lot of commits here, but they are basically just picking a specific concept or object from the userspace part
zfs_context.hand moving it out to a specific header underlib/libspl/include. For most, that header does not already exist. For some, it does exist but wasn't used, or was in conflict, and has been updated appropriately.After that, there's a long tail of misc stuff, which has been either moved somewhere more appropriate or deleted.
I expect that much of this could be collapsed into a smaller set of commits, but for the moment I'm keeping them separate for review.
How Has This Been Tested?
This should all be entirely mechanical, so anything that compiles should work.
The final series compiles on Linux and FreeBSD, and ZTS passes.
It should compile clean at each individual commit, but I have moved things around a little while assembling the final series, so something may be stacked wrong. I'll go and check that now, but its also pretty low-key.
Types of changes
Checklist:
Signed-off-by.