D28195: Avoid double fetch and temporary hex encoding for NTFS attributes
Stefan BrĂ¼ns
noreply at phabricator.kde.org
Sun Mar 22 04:29:18 GMT 2020
bruns created this revision.
bruns added reviewers: Dolphin, dfaure.
Herald added a project: Frameworks.
Herald edited subscribers, added: kde-frameworks-devel; removed: Frameworks.
bruns requested review of this revision.
REVISION SUMMARY
The attrib is a DWORD (32 bit unsigned int) in the Windows APIs (see
WIN32_FILE_ATTRIBUTE_DATA), and exported as a 4 byte array by ntfs-3g.
As the size is known, there is no need to query it. As each file has
the "archive" flag set on creation, i.e. the first getxattr call typically
never returns 0, this cuts the number of syscalls by half.
Skip the temporary hex encoding of the value, it is pointless to hex-
encode the value and immediately after parse it again.
TEST PLAN
1. touch foo
2. getfattr -n system.ntfs_attrib_be -e hex foo
3. dolphin ./
4. setfattr -n system.ntfs_attrib_be -v 0x00000022
5. refresh dolphin
REPOSITORY
R241 KIO
BRANCH
ntfs_hidden
REVISION DETAIL
https://phabricator.kde.org/D28195
AFFECTED FILES
src/ioslaves/file/file_unix.cpp
To: bruns, #dolphin, dfaure
Cc: kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200322/2b7f8071/attachment.html>
More information about the Kde-frameworks-devel
mailing list