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
libzfs: add zfs_mount_at() function #9833
Conversation
zfs_mount_at() mounts a dataset at an arbitrary mountpoint rather than at the configured mountpoint. This may be used by consumers that wish to temporarily expose a dataset at another mountpoint without altering dataset/pool properties. This will be used by FreeBSD's libbe be_mount(), which mounts a boot environment at an arbitrary mountpoint. Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
f6b753c
to
cc776ca
Compare
Codecov Report
@@ Coverage Diff @@
## master #9833 +/- ##
========================================
+ Coverage 79% 80% +<1%
========================================
Files 385 385
Lines 121610 121615 +5
========================================
+ Hits 96429 96706 +277
+ Misses 25181 24909 -272
Continue to review full report at Codecov.
|
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.
Providing such an interface makes sense. Are you aware of anything other than the mountpoint which would be useful to specify?
I had put some thought into it, but hadn't come up with anything (unless it's feasible to, say, set sync=disabled for just this mount). Perhaps it would be better to structure this as some kind of |
OK, I couldn't think of anything immediately useful either. Why don't we go ahead with the PR as proposed but keep the idea for a |
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.
We have test coverage from existing tests since it's used by zfs_mount(). 👍
Sounds good to me! |
zfs_mount_at() mounts a dataset at an arbitrary mountpoint rather than at the configured mountpoint. This may be used by consumers that wish to temporarily expose a dataset at another mountpoint without altering dataset/pool properties. This will be used by FreeBSD's libbe be_mount(), which mounts a boot environment at an arbitrary mountpoint. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Closes openzfs#9833
Motivation and Context
zfs_mount_at
will be used by FreeBSD's libbe to transition away from directly usingzmount
.Description
This adds the capability for libzfs consumers to mount a dataset at an arbitrary mountpoint without resorting to digging deeper into libzfs internals to use hidden OS-specific mounting interfaces, and to do so without modifying dataset/pool properties to achieve the desired effect.
How Has This Been Tested?
Replaced libbe's zmount() with zfs_mount_at() in our local zfs; diff is similar enough that I wouldn't anticipate any issues in the transition here.
Types of changes
Checklist:
Signed-off-by
.I'm not entirely sure where one would find libzfs documentation, given the nature of it. Also unsure of where one would add tests for it, but given that this just pulls the 'grab mountpoint 'part out into zfs_mount() and doesn't functionally change much- I guess the test coverage doesn't drop all that much.