Changeset 83a03aaae in mythtv
- Timestamp:
- Jan 27, 2012, 1:53:42 AM (13 years ago)
- Branches:
- devel/2020-player, devel/ffmpeg-resync, devel/gpu-commflag, fixes/0.25, fixes/0.26, fixes/0.27, fixes/0.28, fixes/29, fixes/30, fixes/31, github-templates, master
- Children:
- 6d4508255a
- Parents:
- f2d222c123
- Location:
- mythtv
- Files:
-
- 10 edited
-
libs/libmythbase/filesysteminfo.cpp (modified) (5 diffs)
-
libs/libmythbase/filesysteminfo.h (modified) (5 diffs)
-
libs/libmythbase/mythcoreutil.cpp (modified) (1 diff)
-
libs/libmythbase/mythcoreutil.h (modified) (1 diff)
-
libs/libmythbase/mythversion.h (modified) (1 diff)
-
libs/libmythbase/storagegroup.cpp (modified) (1 diff)
-
libs/libmythbase/util.cpp (modified) (1 diff)
-
programs/mythbackend/autoexpire.cpp (modified) (8 diffs)
-
programs/mythbackend/autoexpire.h (modified) (1 diff)
-
programs/mythbackend/mainserver.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mythtv/libs/libmythbase/filesysteminfo.cpp
rf2d222c123 r83a03aaae 59 59 60 60 FileSystemInfo::FileSystemInfo(QString hostname, QString path, bool local, 61 int fsid, int groupid, int blksize, long long total, long longused) :61 int fsid, int groupid, int blksize, int64_t total, int64_t used) : 62 62 m_hostname(hostname), m_path(path), m_local(local), m_fsid(fsid), 63 63 m_grpid(groupid), m_blksize(blksize), m_total(total), m_used(used) … … 173 173 174 174 void FileSystemInfo::Consolidate(QList<FileSystemInfo> &disks, 175 bool merge, size_t fuzz)175 bool merge, int64_t fuzz) 176 176 { 177 177 int newid = 0; … … 195 195 int bSize = max(32, max(it1->getBlockSize(), it2->getBlockSize()) 196 196 / 1024); 197 long longdiffSize = it1->getTotalSpace() - it2->getTotalSpace();198 long longdiffUsed = it1->getUsedSpace() - it2->getUsedSpace();197 int64_t diffSize = it1->getTotalSpace() - it2->getTotalSpace(); 198 int64_t diffUsed = it1->getUsedSpace() - it2->getUsedSpace(); 199 199 200 200 if (diffSize < 0) … … 203 203 diffUsed = 0 - diffUsed; 204 204 205 if ((diffSize <= bSize) && ( (size_t)diffUsed <= fuzz))205 if ((diffSize <= bSize) && (diffUsed <= fuzz)) 206 206 { 207 207 it2->setFSysID(it1->getFSysID()); … … 225 225 void FileSystemInfo::PopulateDiskSpace(void) 226 226 { 227 long longtotal = -1, used = -1;227 int64_t total = -1, used = -1; 228 228 getDiskSpace(getPath().toAscii().constData(), total, used); 229 229 setTotalSpace(total); -
mythtv/libs/libmythbase/filesysteminfo.h
rf2d222c123 r83a03aaae 20 20 FileSystemInfo(const FileSystemInfo &other); 21 21 FileSystemInfo(QString hostname, QString path, bool local, int fsid, 22 int groupid, int blksize, long long total, long longused);22 int groupid, int blksize, int64_t total, int64_t used); 23 23 FileSystemInfo(QStringList::const_iterator &it, 24 24 QStringList::const_iterator end); … … 38 38 int getGroupID(void) const { return m_grpid; } 39 39 int getBlockSize(void) const { return m_blksize; } 40 long longgetTotalSpace(void) const { return m_total; }41 long longgetUsedSpace(void) const { return m_used; }40 int64_t getTotalSpace(void) const { return m_total; } 41 int64_t getUsedSpace(void) const { return m_used; } 42 42 int getWeight(void) const { return m_weight; } 43 43 44 long long getFreeSpace(void) const { return m_total-m_used; } 44 // reserved space could potentially result in this being negative 45 int64_t getFreeSpace(void) const { return m_total-m_used; } 45 46 46 47 // information puts … … 51 52 void setGroupID(int id) { m_grpid = id; } 52 53 void setBlockSize(int size) { m_blksize = size; } 53 void setTotalSpace( long long size){ m_total = size; }54 void setUsedSpace( long long size){ m_used = size; }54 void setTotalSpace(int64_t size) { m_total = size; } 55 void setUsedSpace(int64_t size) { m_used = size; } 55 56 void setWeight(int weight) { m_weight = weight; } 56 57 … … 59 60 static const QList<FileSystemInfo> RemoteGetInfo(MythSocket *sock=NULL); 60 61 static void Consolidate(QList<FileSystemInfo> &disks, bool merge=true, 61 size_t fuzz=14000);62 int64_t fuzz=14000); 62 63 void PopulateDiskSpace(void); 63 64 void PopulateFSProp(void); … … 74 75 int m_grpid; 75 76 int m_blksize; 76 long longm_total;77 long longm_used;77 int64_t m_total; 78 int64_t m_used; 78 79 int m_weight; 79 80 }; -
mythtv/libs/libmythbase/mythcoreutil.cpp
rf2d222c123 r83a03aaae 37 37 * \param file_on_disk file on the file system we wish to stat. 38 38 */ 39 long longgetDiskSpace(const QString &file_on_disk,40 long long &total, long long&used)39 int64_t getDiskSpace(const QString &file_on_disk, 40 int64_t &total, int64_t &used) 41 41 { 42 42 struct statfs statbuf; 43 43 memset(&statbuf, 0, sizeof(statbuf)); 44 long longfreespace = -1;44 int64_t freespace = -1; 45 45 QByteArray cstr = file_on_disk.toLocal8Bit(); 46 46 -
mythtv/libs/libmythbase/mythcoreutil.h
rf2d222c123 r83a03aaae 6 6 #include "mythbaseexp.h" 7 7 8 MBASE_PUBLIC long long getDiskSpace(const QString&,long long&,long long&);8 MBASE_PUBLIC int64_t getDiskSpace(const QString&,int64_t&,int64_t&); 9 9 10 10 MBASE_PUBLIC bool extractZIP(const QString &zipFile, const QString &outDir); -
mythtv/libs/libmythbase/mythversion.h
rf2d222c123 r83a03aaae 13 13 /// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and 14 14 /// libmythui class methods used by plug-ins. 15 #define MYTH_BINARY_VERSION "0.25.2012012 3-2"15 #define MYTH_BINARY_VERSION "0.25.20120126-1" 16 16 17 17 /** \brief Increment this whenever the MythTV network protocol changes. -
mythtv/libs/libmythbase/storagegroup.cpp
rf2d222c123 r83a03aaae 656 656 { 657 657 QString nextDir; 658 long longnextDirFree = 0;659 long longthisDirTotal;660 long longthisDirUsed;661 long longthisDirFree;658 int64_t nextDirFree = 0; 659 int64_t thisDirTotal; 660 int64_t thisDirUsed; 661 int64_t thisDirFree; 662 662 663 663 LOG(VB_FILE, LOG_DEBUG, LOC + QString("FindNextDirMostFree: Starting")); -
mythtv/libs/libmythbase/util.cpp
rf2d222c123 r83a03aaae 733 733 // swap it is using, and the dynamic_pager daemon doesn't even seem to be 734 734 // able to report what filesystem it is using for the swapfiles. So, we do: 735 long longtotal, used, free;735 int64_t total, used, free; 736 736 free = getDiskSpace("/private/var/vm", total, used); 737 totalVM = (int)(total /1024LL);738 freeVM = (int)(free /1024LL);737 totalVM = (int)(total >> 10); 738 freeVM = (int)(free >> 10); 739 739 740 740 #else -
mythtv/programs/mythbackend/autoexpire.cpp
rf2d222c123 r83a03aaae 135 135 */ 136 136 137 size_t AutoExpire::GetDesiredSpace(int fsID) const137 uint64_t AutoExpire::GetDesiredSpace(int fsID) const 138 138 { 139 139 QMutexLocker locker(&instance_lock); … … 164 164 } 165 165 166 size_t maxKBperMin = 0;167 size_t extraKB = gCoreContext->GetNumSetting("AutoExpireExtraSpace", 0) <<166 uint64_t maxKBperMin = 0; 167 uint64_t extraKB = gCoreContext->GetNumSetting("AutoExpireExtraSpace", 0) << 168 168 20; 169 169 … … 190 190 191 191 fsMap[fsit->getFSysID()] = 0; 192 size_t thisKBperMin = 0;192 uint64_t thisKBperMin = 0; 193 193 194 194 // append unknown recordings to all fsIDs … … 205 205 .arg(fsit->getUsedSpace() / 1024.0 / 1024.0, 7, 'f', 1) 206 206 .arg(fsit->getFreeSpace() / 1024.0 / 1024.0, 7, 'f', 1)); 207 208 207 209 208 vector<int>::iterator encit = … … 225 224 } 226 225 227 long longmaxBitrate = enc->GetMaxBitrate();226 uint64_t maxBitrate = enc->GetMaxBitrate(); 228 227 if (maxBitrate<=0) 229 228 maxBitrate = 19500000LL; 230 thisKBperMin += ((( size_t)maxBitrate)*((size_t)15))>>11;229 thisKBperMin += (((uint64_t)maxBitrate)*((uint64_t)15))>>11; 231 230 LOG(VB_FILE, LOG_INFO, QString(" Cardid %1: max bitrate " 232 231 "%2 Kb/sec, fsID %3 max is now %4 KB/min") … … 491 490 } 492 491 493 if ( (size_t)max(0LL, fsit->getFreeSpace()) <492 if (max((int64_t)0LL, fsit->getFreeSpace()) < 494 493 desired_space[fsit->getFSysID()]) 495 494 { … … 520 519 pginfolist_t::iterator it = expireList.begin(); 521 520 while ((it != expireList.end()) && 522 ( (size_t)max(0LL, fsit->getFreeSpace()) <521 (max((int64_t)0LL, fsit->getFreeSpace()) < 523 522 desired_space[fsit->getFSysID()])) 524 523 { … … 712 711 (found > *maxIter)) 713 712 { 714 long longspaceFreed = query.value(5).toLongLong() >> 20;713 uint64_t spaceFreed = query.value(5).toLongLong() >> 20; 715 714 QString msg = 716 715 QString("%1Expiring %2 MBytes for %3 at %4 => %5. " -
mythtv/programs/mythbackend/autoexpire.h
rf2d222c123 r83a03aaae 73 73 void PrintExpireList(QString expHost = "ALL"); 74 74 75 size_t GetDesiredSpace(int fsID) const;75 uint64_t GetDesiredSpace(int fsID) const; 76 76 77 77 void GetAllExpiring(QStringList &strList); -
mythtv/programs/mythbackend/mainserver.cpp
rf2d222c123 r83a03aaae 4310 4310 { 4311 4311 QString allHostList = gCoreContext->GetHostName(); 4312 long longtotalKB = -1, usedKB = -1;4312 int64_t totalKB = -1, usedKB = -1; 4313 4313 QMap <QString, bool>foundDirs; 4314 4314 QString driveKey; … … 4461 4461 4462 4462 // Consolidate hosts sharing storage 4463 size_t maxWriteFiveSec = GetCurrentMaxBitrate()/12 /*5 seconds*/;4464 maxWriteFiveSec = max(( size_t)2048, maxWriteFiveSec); // safety for NFS mounted dirs4463 int64_t maxWriteFiveSec = GetCurrentMaxBitrate()/12 /*5 seconds*/; 4464 maxWriteFiveSec = max((int64_t)2048, maxWriteFiveSec); // safety for NFS mounted dirs 4465 4465 QList<FileSystemInfo>::iterator it1, it2; 4466 4466 int bSize = 32; … … 4479 4479 // or 32, whichever is greater 4480 4480 bSize = max(32, max(it1->getBlockSize(), it2->getBlockSize()) / 1024); 4481 long longdiffSize = it1->getTotalSpace() - it2->getTotalSpace();4482 long longdiffUsed = it1->getUsedSpace() - it2->getUsedSpace();4481 int64_t diffSize = it1->getTotalSpace() - it2->getTotalSpace(); 4482 int64_t diffUsed = it1->getUsedSpace() - it2->getUsedSpace(); 4483 4483 if (diffSize < 0) 4484 4484 diffSize = 0 - diffSize; … … 4487 4487 4488 4488 if (it2->getFSysID() == -1 && (diffSize <= bSize) && 4489 ( (size_t)diffUsed <= maxWriteFiveSec))4489 (diffUsed <= maxWriteFiveSec)) 4490 4490 { 4491 4491 if (!it1->getHostname().contains(it2->getHostname()))
Note: See TracChangeset
for help on using the changeset viewer.
