-
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
Factor out non-portable vnode_t usage #9556
Factor out non-portable vnode_t usage #9556
Conversation
87cf8a0
to
f69e95e
Compare
2ebe49d
to
3ccebe9
Compare
7111c86
to
470f2a6
Compare
27dc2f9
to
4f97fd4
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.
LGTM, thanks
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.
It's awesome to see this refactoring removes 600 lines of mostly ugly compatibility code!
vtype -> mode, file_t -> zfs_file_t, there is a lot to like in this version. and the rest can be handled with wrappers in |
b459dc4
to
2727960
Compare
Codecov Report
@@ Coverage Diff @@
## master #9556 +/- ##
=========================================
- Coverage 79.22% 78.93% -0.3%
=========================================
Files 419 418 -1
Lines 123704 123531 -173
=========================================
- Hits 98009 97504 -505
- Misses 25695 26027 +332
Continue to review full report at Codecov.
|
A lot of this seems to be adding more indirection, so we can avoid the problems of, say, Linux and FreeBSD having different file and vnode types. Given that, it seems fine to me. |
@kithrup thanks for the feedback. That's right, the intent is to provide a basic interface which can be implemented on all platforms which can be used by the common code. The vnode interface effectively served this same purpose, but the compatibility code required to support it ended up being a bit gnarly. After this change there are longer any vnode /VOP calls or related structures in the common code. |
2727960
to
b4edfe5
Compare
On FreeBSD file offset state is maintained in struct file. A given vnode can be referenced from many different struct file *. As a consequence, FreeBSD's SPL doesn't support vn_rdwr with the FAPPEND flag. This change replaces the non-portable vnode_t with the portable file_t in the common code. Signed-off-by: Matt Macy <[email protected]>
b4edfe5
to
4a1f22c
Compare
It only really adds extra indirection for Illumos. FreeBSD doesn’t support the |
On FreeBSD file offset state is maintained in struct file. A given
vnode can be referenced from many different struct file *. As a
consequence, FreeBSD's SPL doesn't support vn_rdwr with the FAPPEND
flag.
This change replaces the non-portable vnode_t with the portable
zfs_file_t in the common code.
Upon discussion with Brian - have expanded the scope to eliminate all references to
vn_rdwr
and have limited the scope of the use of thevn_
functions tovdev_file.c
Signed-off-by: Matt Macy [email protected]
Motivation and Context
Description
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.