summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-07-11 00:18:55 +0200
committerGitHub <noreply@github.com>2017-07-11 00:18:55 +0200
commit38e32c6324515bf0bcecb73fc3d55591f08866f5 (patch)
treeeb1abba651b844a93917ded3c6a2865065aa83d9 /Source
parentb5dfde12ad4f3ef641fccda4ce181c89af395427 (diff)
parent1376484f76cae6ba160c02449743420213db7704 (diff)
Merge pull request #5775 from leoetlino/hardcoded-fs-usage
IOS/FS: Remove hardcoded FS usage data
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/IOS/FS/FS.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/Source/Core/Core/IOS/FS/FS.cpp b/Source/Core/Core/IOS/FS/FS.cpp
index 0dffca2e9d..41048dcb26 100644
--- a/Source/Core/Core/IOS/FS/FS.cpp
+++ b/Source/Core/Core/IOS/FS/FS.cpp
@@ -613,27 +613,13 @@ IPCCommandResult FS::GetUsage(const IOCtlVRequest& request)
INFO_LOG(IOS_FILEIO, "IOCTL_GETUSAGE %s", path.c_str());
if (File::IsDirectory(path))
{
- // LPFaint99: After I found that setting the number of inodes to the number of children + 1
- // for the directory itself
- // I decided to compare with sneek which has the following 2 special cases which are
- // Copyright (C) 2009-2011 crediar http://code.google.com/p/sneek/
- if ((relativepath.compare(0, 16, "/title/00010001") == 0) ||
- (relativepath.compare(0, 16, "/title/00010005") == 0))
- {
- fsBlocks = 23; // size is size/0x4000
- iNodes = 42; // empty folders return a FileCount of 1
- }
- else
- {
- File::FSTEntry parentDir = File::ScanDirectoryTree(path, true);
- // add one for the folder itself
- iNodes = 1 + (u32)parentDir.size;
+ File::FSTEntry parentDir = File::ScanDirectoryTree(path, true);
+ // add one for the folder itself
+ iNodes = 1 + (u32)parentDir.size;
- u64 totalSize =
- ComputeTotalFileSize(parentDir); // "Real" size, to be converted to nand blocks
+ u64 totalSize = ComputeTotalFileSize(parentDir); // "Real" size, to be converted to nand blocks
- fsBlocks = (u32)(totalSize / (16 * 1024)); // one bock is 16kb
- }
+ fsBlocks = (u32)(totalSize / (16 * 1024)); // one bock is 16kb
INFO_LOG(IOS_FILEIO, "FS: fsBlock: %i, iNodes: %i", fsBlocks, iNodes);
}