Lines Matching refs:dirname
42 static int EliminateOpenFiles(const std::string& dirname, std::set<std::string>* files) { in EliminateOpenFiles() argument
69 if (android::base::StartsWith(link, dirname)) { in EliminateOpenFiles()
81 const std::string& dirname, const std::function<bool(const std::string&)>& name_filter) { in FindExpendableFiles() argument
82 std::unique_ptr<DIR, decltype(&closedir)> d(opendir(dirname.c_str()), closedir); in FindExpendableFiles()
84 PLOG(ERROR) << "Failed to open " << dirname; in FindExpendableFiles()
92 std::string path = dirname + "/" + de->d_name; in FindExpendableFiles()
112 if (EliminateOpenFiles(dirname, &files) < 0) { in FindExpendableFiles()
163 for (const auto& dirname : dirs) { in CheckAndFreeSpaceOnCache() local
164 if (RemoveFilesInDirectory(bytes, dirname, FreeSpaceForFile)) { in CheckAndFreeSpaceOnCache()
172 bool RemoveFilesInDirectory(size_t bytes_needed, const std::string& dirname, in RemoveFilesInDirectory() argument
182 if (stat(dirname.c_str(), &st) == -1) { in RemoveFilesInDirectory()
183 PLOG(ERROR) << "Failed to stat " << dirname; in RemoveFilesInDirectory()
187 LOG(ERROR) << dirname << " is not a directory"; in RemoveFilesInDirectory()
191 int64_t free_now = space_checker(dirname); in RemoveFilesInDirectory()
193 LOG(ERROR) << "Failed to check free space for " << dirname; in RemoveFilesInDirectory()
196 LOG(INFO) << free_now << " bytes free on " << dirname << " (" << bytes_needed << " needed)"; in RemoveFilesInDirectory()
203 if (dirname == Paths::Get().cache_log_directory()) { in RemoveFilesInDirectory()
210 files = FindExpendableFiles(dirname, log_filter); in RemoveFilesInDirectory()
226 files = FindExpendableFiles(dirname, nullptr); in RemoveFilesInDirectory()
235 free_now = space_checker(dirname); in RemoveFilesInDirectory()
237 LOG(ERROR) << "Failed to check free space for " << dirname; in RemoveFilesInDirectory()