If any of the override gflags specifies an override for the given path, then override the free bytes to match what is specified in the flag. See the definitions of these test-only flags for more information.
| 155 | // override the free bytes to match what is specified in the flag. See the |
| 156 | // definitions of these test-only flags for more information. |
| 157 | static void OverrideBytesFreeWithTestingFlags(const string& path, int64_t* bytes_free) { |
| 158 | const string* prefixes[] = { &FLAGS_disk_reserved_override_prefix_1_path_for_testing, |
| 159 | &FLAGS_disk_reserved_override_prefix_2_path_for_testing }; |
| 160 | const int64_t* overrides[] = { &FLAGS_disk_reserved_override_prefix_1_bytes_free_for_testing, |
| 161 | &FLAGS_disk_reserved_override_prefix_2_bytes_free_for_testing }; |
| 162 | for (int i = 0; i < arraysize(prefixes); i++) { |
| 163 | if (*overrides[i] != -1 && !prefixes[i]->empty() && HasPrefixString(path, *prefixes[i])) { |
| 164 | *bytes_free = *overrides[i]; |
| 165 | return; |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | Status VerifySufficientDiskSpace(Env *env, const std::string& path, int64_t requested_bytes, |
| 171 | int64_t reserved_bytes, int64_t* available_bytes) { |
no test coverage detected