[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [libktorrent/2.0] src: avoid mmaping on ntfs partitions
From:       Nick Shaforostoff <shafff () ukr ! net>
Date:       2016-04-16 23:29:06
Message-ID: E1arZeE-0007r0-Jo () scm ! kde ! org
[Download RAW message or body]

Git commit bc899d7449bd605421556f034c20879b595da88a by Nick Shaforostoff.
Committed on 16/04/2016 at 23:27.
Pushed by shaforo into branch '2.0'.

avoid mmaping on ntfs partitions

BUG: 354633

M  +3    -1    src/diskio/cachefile.cpp
M  +1    -1    src/torrent/torrentstats.cpp

http://commits.kde.org/libktorrent/bc899d7449bd605421556f034c20879b595da88a

diff --git a/src/diskio/cachefile.cpp b/src/diskio/cachefile.cpp
index 27cd329..022f6ee 100644
--- a/src/diskio/cachefile.cpp
+++ b/src/diskio/cachefile.cpp
@@ -38,6 +38,7 @@
 #include "preallocationthread.h"
 #include "cache.h"
 
+#include <QStorageInfo>
 
 // Not all systems have an O_LARGEFILE - Solaris depending
 // on command-line defines, FreeBSD never - so in those cases,
@@ -110,7 +111,8 @@ namespace bt
 		if (!fptr)
 		{
 		//	Out(SYS_DIO|LOG_DEBUG) << "Reopening " << path << endl;
-			if (!OpenFileAllowed()) 
+			QStorageInfo mount(path); //ntfs cannot handle mmap properly
+			if (!OpenFileAllowed() || mount.fileSystemType()=="fuseblk" || \
mount.fileSystemType().startsWith("ntfs"))  return 0; // Running out of file \
descriptors, force buffered mode  openFile(mode);
 		}
diff --git a/src/torrent/torrentstats.cpp b/src/torrent/torrentstats.cpp
index 9c4d08a..e55b337 100644
--- a/src/torrent/torrentstats.cpp
+++ b/src/torrent/torrentstats.cpp
@@ -57,8 +57,8 @@ namespace bt
 		, auto_stopped(false)
 		, superseeding(false)
 		, qm_can_start(false)
-		, priv_torrent(false)
 		, multi_file_torrent(false)
+		, priv_torrent(false)
 		, max_share_ratio(0.0f)
 		, max_seed_time(0.0f)
 		, num_corrupted_chunks(0)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic