Closed kolyshkin closed 4 years ago
getxattrAll
The current implementation is suboptimal for two reasons:
the initial buffer size of 5 bytes makes no sense (my guess @stevvooe forgot to change it back to a sane value after the initial retry logic testing);
it never gets the real buffer size, resulting in extra iterations (5 -> 10 -> 20 -> ...).
This commit
128
ERANGE
listxattrAll
The current code
listxattr()
Fix all three issues at once by reusing the logic from getxattrAll().
getxattrAll()
I like it, but please sign your commits.
@Zyqsempai Sorry, I don't get it. Do you mean something other than the
Signed-off-by: Kir Kolyshkin kolyshkin@gmail.com
line which is present in both commits?
1. fix
getxattrAll
The current implementation is suboptimal for two reasons:
the initial buffer size of 5 bytes makes no sense (my guess @stevvooe forgot to change it back to a sane value after the initial retry logic testing);
it never gets the real buffer size, resulting in extra iterations (5 -> 10 -> 20 -> ...).
This commit
128
;ERANGE
(rather than doubling the buffer)2. improve
listxattrAll
The current code
listxattr()
twice);listxattr()
.Fix all three issues at once by reusing the logic from
getxattrAll()
.