Merge "fs_mgr_fstab: removing fs_mgr_get_entry_for_mount_point_after()"
am: 16e31801a5
Change-Id: I59b8971b02f59f16082bc48ef96203ef13788277
This commit is contained in:
commit
b08be62fca
2 changed files with 5 additions and 31 deletions
|
|
@ -788,47 +788,21 @@ int fs_mgr_add_entry(struct fstab *fstab,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the 1st matching fstab_rec that follows the start_rec.
|
* Returns the fstab_rec* whose mount_point is path.
|
||||||
* start_rec is the result of a previous search or NULL.
|
* Returns nullptr if not found.
|
||||||
*/
|
*/
|
||||||
struct fstab_rec* fs_mgr_get_entry_for_mount_point_after(struct fstab_rec* start_rec,
|
struct fstab_rec* fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const std::string& path) {
|
||||||
struct fstab* fstab,
|
|
||||||
const std::string& path) {
|
|
||||||
int i;
|
|
||||||
if (!fstab) {
|
if (!fstab) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < fstab->num_entries; i++) {
|
||||||
if (start_rec) {
|
|
||||||
for (i = 0; i < fstab->num_entries; i++) {
|
|
||||||
if (&fstab->recs[i] == start_rec) {
|
|
||||||
i++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
i = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < fstab->num_entries; i++) {
|
|
||||||
if (fstab->recs[i].mount_point && path == fstab->recs[i].mount_point) {
|
if (fstab->recs[i].mount_point && path == fstab->recs[i].mount_point) {
|
||||||
return &fstab->recs[i];
|
return &fstab->recs[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns the 1st matching mount point.
|
|
||||||
* There might be more. To look for others, use fs_mgr_get_entry_for_mount_point_after()
|
|
||||||
* and give the fstab_rec from the previous search.
|
|
||||||
*/
|
|
||||||
struct fstab_rec *fs_mgr_get_entry_for_mount_point(struct fstab *fstab, const char *path)
|
|
||||||
{
|
|
||||||
return fs_mgr_get_entry_for_mount_point_after(NULL, fstab, path);
|
|
||||||
}
|
|
||||||
|
|
||||||
int fs_mgr_is_voldmanaged(const struct fstab_rec *fstab)
|
int fs_mgr_is_voldmanaged(const struct fstab_rec *fstab)
|
||||||
{
|
{
|
||||||
return fstab->fs_mgr_flags & MF_VOLDMANAGED;
|
return fstab->fs_mgr_flags & MF_VOLDMANAGED;
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ void fs_mgr_free_fstab(struct fstab* fstab);
|
||||||
|
|
||||||
int fs_mgr_add_entry(struct fstab* fstab, const char* mount_point, const char* fs_type,
|
int fs_mgr_add_entry(struct fstab* fstab, const char* mount_point, const char* fs_type,
|
||||||
const char* blk_device);
|
const char* blk_device);
|
||||||
struct fstab_rec* fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const char* path);
|
|
||||||
int fs_mgr_is_voldmanaged(const struct fstab_rec* fstab);
|
int fs_mgr_is_voldmanaged(const struct fstab_rec* fstab);
|
||||||
int fs_mgr_is_nonremovable(const struct fstab_rec* fstab);
|
int fs_mgr_is_nonremovable(const struct fstab_rec* fstab);
|
||||||
int fs_mgr_is_verified(const struct fstab_rec* fstab);
|
int fs_mgr_is_verified(const struct fstab_rec* fstab);
|
||||||
|
|
@ -96,6 +95,7 @@ __END_DECLS
|
||||||
// TODO: move this into separate header files under include/fs_mgr/*.h
|
// TODO: move this into separate header files under include/fs_mgr/*.h
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
std::string fs_mgr_get_slot_suffix();
|
std::string fs_mgr_get_slot_suffix();
|
||||||
|
struct fstab_rec* fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const std::string& path);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __CORE_FS_TAB_H */
|
#endif /* __CORE_FS_TAB_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue