fix: backport patch from upstream to fix btrfs re-indexing

epel9
Marc Deop i Argemí 2 years ago
parent 1fc406a484
commit c35eac32e7
No known key found for this signature in database
GPG Key ID: 0BD48519688058E8

@ -10,7 +10,7 @@
Name: kf5-%{framework} Name: kf5-%{framework}
Summary: A Tier 3 KDE Frameworks 5 module that provides indexing and search functionality Summary: A Tier 3 KDE Frameworks 5 module that provides indexing and search functionality
Version: 5.107.0 Version: 5.107.0
Release: 1%{?dist} Release: 2%{?dist}
# libs are LGPL, tools are GPL # libs are LGPL, tools are GPL
# KDE e.V. may determine that future LGPL/GPL versions are accepted # KDE e.V. may determine that future LGPL/GPL versions are accepted
@ -30,6 +30,8 @@ Source2: baloo_file_shutdown.sh
## upstreamable patches ## upstreamable patches
# http://bugzilla.redhat.com/1235026 # http://bugzilla.redhat.com/1235026
Patch100: baloo-5.67.0-baloofile_config.patch Patch100: baloo-5.67.0-baloofile_config.patch
# https://invent.kde.org/frameworks/baloo/-/merge_requests/131
Patch101: use_the_FSID_as_the_device_identifier_where_possible.patch
## upstream patches ## upstream patches
@ -207,6 +209,9 @@ make test ARGS="--output-on-failure --timeout 300" -C %{_target_platform} ||:
%changelog %changelog
* Wed Jun 07 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 5.107.0-2
- Backport patch from upstream
* Sat Jun 03 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 5.107.0-1 * Sat Jun 03 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 5.107.0-1
- 5.107.0 - 5.107.0

@ -0,0 +1,43 @@
diff --git a/src/engine/idutils.h b/src/engine/idutils.h
index 78d881a96e894d731ba024acc8cc74b47823c96b..606ac9dca0a647fcc78ffb031c081201fbb1a491 100644
--- a/src/engine/idutils.h
+++ b/src/engine/idutils.h
@@ -13,6 +13,8 @@
#ifdef Q_OS_WIN
# include <QFileInfo>
+#else
+# include <sys/statvfs.h>
#endif
namespace Baloo {
@@ -40,10 +42,28 @@ inline quint64 statBufToId(const QT_STATBUF& stBuf)
static_cast<quint32>(stBuf.st_ino));
}
+#ifndef Q_OS_WIN
+inline int statWithFsid(const char* path, QT_STATBUF* statBuf)
+{
+ int ret = QT_LSTAT(path, statBuf);
+ if (ret != 0) {
+ return ret;
+ }
+
+ struct statvfs fsBuf;
+ ret = statvfs(path, &fsBuf);
+ if (ret == 0 && fsBuf.f_fsid != 0) {
+ // Fold FSID into 32 bits, statBufToId would discard anything else
+ statBuf->st_dev = static_cast<quint32>(fsBuf.f_fsid ^ (fsBuf.f_fsid >> 32));
+ }
+ return ret;
+}
+#endif
+
inline int filePathToStat(const QByteArray& filePath, QT_STATBUF& statBuf)
{
#ifndef Q_OS_WIN
- return QT_LSTAT(filePath.constData(), &statBuf);
+ return statWithFsid(filePath.constData(), &statBuf);
#else
const int ret = QT_STAT(filePath.constData(), &statBuf);
const QString filePathStr = QString::fromUtf8(filePath);
Loading…
Cancel
Save