Merge "Move to new Fstab class"
am: 12e20e3f2a
Change-Id: I09be93fbbade4a7ef01c4bf0ea4c202da3ec2f7b
This commit is contained in:
commit
3184a39837
1 changed files with 8 additions and 15 deletions
|
@ -36,29 +36,22 @@ using base::Timer;
|
|||
using base::Trim;
|
||||
using base::WriteStringToFd;
|
||||
using base::WriteStringToFile;
|
||||
using fs_mgr::Fstab;
|
||||
using fs_mgr::ReadDefaultFstab;
|
||||
|
||||
std::string getGarbageCollectPath() {
|
||||
std::unique_ptr<fstab, decltype(&fs_mgr_free_fstab)> fstab(fs_mgr_read_fstab_default(),
|
||||
fs_mgr_free_fstab);
|
||||
struct fstab_rec* rec = NULL;
|
||||
Fstab fstab;
|
||||
ReadDefaultFstab(&fstab);
|
||||
|
||||
for (int i = 0; i < fstab->num_entries; i++) {
|
||||
if (fs_mgr_has_sysfs_path(&fstab->recs[i])) {
|
||||
rec = &fstab->recs[i];
|
||||
break;
|
||||
for (const auto& entry : fstab) {
|
||||
if (!entry.sysfs_path.empty()) {
|
||||
return entry.sysfs_path + "/manual_gc";
|
||||
}
|
||||
}
|
||||
if (!rec) {
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string path;
|
||||
path.append(rec->sysfs_path);
|
||||
path = path + "/manual_gc";
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
Return<void> Storage::garbageCollect(uint64_t timeoutSeconds,
|
||||
const sp<IGarbageCollectCallback>& cb) {
|
||||
Result result = Result::SUCCESS;
|
||||
|
|
Loading…
Reference in a new issue