diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-07-10 08:31:41 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-07-10 08:31:41 -0500 |
commit | bd7dd864507015f2ddab6399fba1eb54664f2289 (patch) | |
tree | 91d3b809ff16af45bd68a0f27b541feee747c78c | |
parent | 3d06098ece39d7a2e2d292b28fd0e165b3b4f43e (diff) | |
download | tdelibs-bd7dd864507015f2ddab6399fba1eb54664f2289.tar.gz tdelibs-bd7dd864507015f2ddab6399fba1eb54664f2289.zip |
Fix incorrect sizes being reported on raid devices
-rw-r--r-- | tdecore/tdehw/tdestoragedevice.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/tdecore/tdehw/tdestoragedevice.cpp b/tdecore/tdehw/tdestoragedevice.cpp index b22996b88..9491a6675 100644 --- a/tdecore/tdehw/tdestoragedevice.cpp +++ b/tdecore/tdehw/tdestoragedevice.cpp @@ -671,18 +671,9 @@ TQPixmap TDEStorageDevice::icon(TDEIcon::StdSizes size) { unsigned long long TDEStorageDevice::deviceSize() { TQString bsnodename = systemPath(); - bsnodename.append("/queue/physical_block_size"); - TQFile bsfile( bsnodename ); - TQString blocksize; - if ( bsfile.open( IO_ReadOnly ) ) { - TQTextStream stream( &bsfile ); - blocksize = stream.readLine(); - bsfile.close(); - } - else { - // Drat, I can't get a guaranteed block size. Assume a block size of 512, as everything I have read indicates that /sys/block/<dev>/size is given in terms of a 512 byte block... - blocksize = "512"; - } + // While at first glance it would seem that checking /queue/physical_block_size would be needed to get an accurate device size, in reality Linux + // appears to only ever report the device size in 512 byte units. This does not appear to be documented anywhere! + TQString blocksize = "512"; TQString dsnodename = systemPath(); dsnodename.append("/size"); |