D28478: [FileProtocol] change statx stat_dev() to use device major + minor
Ahmad Samir
noreply at phabricator.kde.org
Wed Apr 1 10:18:45 BST 2020
ahmadsamir created this revision.
ahmadsamir added reviewers: Frameworks, dfaure, meven.
Herald added a project: Frameworks.
ahmadsamir requested review of this revision.
REVISION SUMMARY
On Linux systems that have statx available, stat_dev() returned
stx_dev_major, which could be the same value for different partitions.
Change it to combine stx_dev_major and stx_dev_minor to get a unique
number (meaning a unique UDSEntry::UDS_DEVICE_ID).
Extend JobTest::stat() unit test to check that UDS_DEVICE_ID is unique
for each individual partition.
Also in JobTest::stat(), use a smaller #if/#endif to keep the HTTP stat
bits disabled (it's been disabled since kdelibs4 split so...).
TEST PLAN
$ stat /usr/bin/file | grep Device
Device: 804h/2052d Inode: 9168 Links: 1
$ stat ~/.bashrc | grep Device
Device: 803h/2051d Inode: 97 Links: 1
Apply small patch from http://www.davidfaure.fr/2020/uds_device_test.diff,
then:
$ kioclient5 openProperties /usr/bin/file
"DEVICE" 804
$ kioclient5 openProperties ~/.bashrc
"DEVICE" 803
without this change DEVICE would be "8" for both of these files.
REPOSITORY
R241 KIO
BRANCH
l-statx (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D28478
AFFECTED FILES
autotests/jobtest.cpp
src/ioslaves/file/file_unix.cpp
To: ahmadsamir, #frameworks, dfaure, meven
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/20200401/a8f33219/attachment.html>
More information about the Kde-frameworks-devel
mailing list