| 180 | } |
| 181 | |
| 182 | void CryptContext::GetFsInfo(FsInfo & info) |
| 183 | { |
| 184 | info.deleteSpurriousFiles = this->m_delete_spurrious_files; |
| 185 | info.flushAfterWrite = this->m_flushafterwrite; |
| 186 | info.denyServices = this->m_denyServices; |
| 187 | info.denyOtherSessions = this->m_denyOtherSessions; |
| 188 | info.encryptKeysInMemory = this->m_encryptKeysInMemory; |
| 189 | info.cacheKeysInMemory = this->m_cacheKeysInMemory; |
| 190 | info.cacheTTL = m_cache_ttl; |
| 191 | info.caseInsensitive = IsCaseInsensitive(); |
| 192 | info.configPath = GetConfig()->m_configPath; |
| 193 | info.dataEncryption = GetConfig()->m_AESSIV ? L"AES256-SIV" : L"AES256-GCM"; |
| 194 | info.fileNameEncryption = GetConfig()->m_PlaintextNames ? L"none" : L"AES256-EME"; |
| 195 | info.multhreaded = m_multithreaded; |
| 196 | info.ioBufferSize = m_bufferblocks * 4; |
| 197 | info.longFileNames = GetConfig()->m_LongNames; |
| 198 | info.mountManager = m_recycle_bin; |
| 199 | info.readOnly = m_read_only; |
| 200 | info.reverse = GetConfig()->m_reverse; |
| 201 | info.path = GetConfig()->m_basedir; |
| 202 | |
| 203 | // get rid of leading \\?\ for display |
| 204 | if (!wcsncmp(info.path.c_str(), L"\\\\?\\", wcslen(L"\\\\?\\"))) { |
| 205 | info.path = info.path.c_str() + wcslen(L"\\\\?\\"); |
| 206 | } |
| 207 | if (!wcsncmp(info.configPath.c_str(), L"\\\\?\\", wcslen(L"\\\\?\\"))) { |
| 208 | info.configPath = info.configPath.c_str() + wcslen(L"\\\\?\\"); |
| 209 | } |
| 210 | |
| 211 | long long hits, lookups; |
| 212 | |
| 213 | if (info.reverse && info.longFileNames) { |
| 214 | hits = m_lfn_cache.hits(); |
| 215 | lookups = m_lfn_cache.lookups(); |
| 216 | info.lfnCacheHitRatio = lookups ? (float)hits / (float)lookups : 0.0f; |
| 217 | } else { |
| 218 | info.lfnCacheHitRatio = -1.0; |
| 219 | } |
| 220 | |
| 221 | if (info.caseInsensitive) { |
| 222 | hits = m_case_cache.hits(); |
| 223 | lookups = m_case_cache.lookups(); |
| 224 | info.caseCacheHitRatio = lookups ? (float)hits / (float)lookups : 0.0f; |
| 225 | } else { |
| 226 | info.caseCacheHitRatio = -1.0f; |
| 227 | } |
| 228 | |
| 229 | if (GetConfig()->DirIV()) { |
| 230 | hits = m_dir_iv_cache.hits(); |
| 231 | lookups = m_dir_iv_cache.lookups(); |
| 232 | info.dirIvCacheHitRatio = lookups ? (float)hits / (float)lookups : 0.0f; |
| 233 | } else { |
| 234 | info.dirIvCacheHitRatio = -1.0f; |
| 235 | } |
| 236 | |
| 237 | info.longNameMax = m_config->m_LongNameMax; |
| 238 | } |
no test coverage detected