forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove support for AWS_PREFIX (openzfs#474)
The AWS_PREFIX code has fallen into disrepair, and the concept is not as useful as it once was, now that we have per-instance buckets for testing, `zpool import`, `zpool export`, and (soon) a working `zpool destroy`. This PR removes support for the AWS_PREFIX environment variable. Additionally, I updated the ObjectAccess code and its callers to follow the Rust API design guideline "Caller decides where to copy and place data": https://rust-lang.github.io/api-guidelines/flexibility.html#caller-decides-where-to-copy-and-place-data-c-caller-control Functions should take owned values (in this case, `String` instead of `&str`) when they need ownership of them. This makes the cost of allocation/copying clear to the callers, and in some cases this cost can be avoided. For example, if the caller has a String that it doesn't need later, today it creates a reference and passes it, then the callee has to allocate a new String, copying the &str to it. With this change the caller gives its String to the callee and no copy is needed. Although the performance impact of this change is negligible, I wanted to make the code a better example of the recommended design principles. Note: I restructured DataObjectPhys::get() to not use ::get_from_key() to eliminate a copy of the key String. For some workloads, every malloc() is noticeable on the FlameGraph. Note: I replaced `.context()` calls with `.with_context()`, which avoids allocating a String and formatting the arguments, when the Result is Ok.
- Loading branch information
Showing
11 changed files
with
150 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.