Refactor some Xattr and Acl internals#1893
Merged
BareosBot merged 14 commits intobareos:masterfrom Feb 11, 2025
Merged
Conversation
sebsura
requested changes
Jul 17, 2024
Contributor
sebsura
left a comment
There was a problem hiding this comment.
Looks like a very good change to me. I just found one typo that needs fixing.
febc5da to
922899c
Compare
b0e547b to
bf0d587
Compare
fe9d184 to
7af9f60
Compare
sebsura
reviewed
Dec 20, 2024
sebsura
reviewed
Dec 20, 2024
7af9f60 to
1393b4e
Compare
Member
Author
|
I also added two small changes for things that bugged my in the windows build. |
328552e to
7ee6b4f
Compare
sebsura
requested changes
Jan 6, 2025
Contributor
sebsura
left a comment
There was a problem hiding this comment.
The new changes are really great!
I added some small remarks, but this is basically good to go!
385af86 to
45078b4
Compare
sebsura
requested changes
Jan 8, 2025
sebsura
approved these changes
Jan 9, 2025
3daa1c6 to
356a9b9
Compare
356a9b9 to
50d26fd
Compare
inside `XattrData` there was
```
union {
xattr_build_data_t* build;
xattr_parse_data_t* parse;
};
```
both of these types contained a `uint32_t nr_errors` that was moved into
`XattrData`, leaving `xattr_parse_data_t` empty, so it could be removed.
instead of keeping a ptr to `xattr_build_data_t` in `XattrData`, we now have to distinct types `XattrData` and `XattrBuildData` with the latter inheriting from the former and providing all members of xattr_build_data_t (and proper ctor/dtor). The downside is that some of the functions in xattr.cc that were passed a `XattrData*` before will now need a `XattrBuildData*` so we need to downcast when calling these.
use a PoolMem instead of a POOLMEM* this also refactors some duplicated code into a common function.
this adds AclBuildData as a child class to AclData. The members previously in acl_build_data_t were moved into that class.
some compilers (i.e. MSVC) don't support -fdebug-prefix-map, so ccache will not automatically do the right thing when base_dir is set. Therefore, we disable hash_dir unless -fdebug-prefix-map was added.
* class -> struct * static_cast -> dynamic_cast * improve interface of SerializeXattrStream() * better error reporting
bd60166 to
d99ff00
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is my approach to use proper C++ types instead of pointer-connected C structs for XattrData (and maybe AclData).
This will also fix a crash when running bextract to extract a job with xattr onto a filesystem without xattr support (and presumably the same for acl data).
Thank you for contributing to the Bareos Project!
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Required backport PRs have been createdSource code quality