diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index 6e9ffba59..9856126ab 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -1190,27 +1190,6 @@ int fs_mgr_do_tmpfs_mount(const char *n_name) return 0; } -int fs_mgr_unmount_all(struct fstab *fstab) -{ - int i = 0; - int ret = 0; - - if (!fstab) { - return -1; - } - - while (fstab->recs[i].blk_device) { - if (umount(fstab->recs[i].mount_point)) { - LERROR << "Cannot unmount filesystem at " - << fstab->recs[i].mount_point; - ret = -1; - } - i++; - } - - return ret; -} - /* This must be called after mount_all, because the mkswap command needs to be * available. */ diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp index af4d6c1e1..a14dba3c6 100644 --- a/fs_mgr/fs_mgr_fstab.cpp +++ b/fs_mgr/fs_mgr_fstab.cpp @@ -679,7 +679,6 @@ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b) // We can't call fs_mgr_free_fstab because a->recs still references the // memory allocated by strdup. free(b->recs); - free(b->fstab_filename); free(b); a->num_entries = total_entries; @@ -741,9 +740,7 @@ struct fstab *fs_mgr_read_fstab(const char *fstab_path) } fstab = fs_mgr_read_fstab_file(fstab_file); - if (fstab) { - fstab->fstab_filename = strdup(fstab_path); - } else { + if (!fstab) { LERROR << __FUNCTION__ << "(): failed to load fstab from : '" << fstab_path << "'"; } @@ -854,9 +851,6 @@ void fs_mgr_free_fstab(struct fstab *fstab) /* Free the fstab_recs array created by calloc(3) */ free(fstab->recs); - /* Free the fstab filename */ - free(fstab->fstab_filename); - /* Free fstab */ free(fstab); } diff --git a/fs_mgr/include/fs_mgr.h b/fs_mgr/include/fs_mgr.h index 72f019e21..c1b2ed97a 100644 --- a/fs_mgr/include/fs_mgr.h +++ b/fs_mgr/include/fs_mgr.h @@ -70,7 +70,6 @@ int fs_mgr_do_mount(struct fstab *fstab, const char *n_name, char *n_blk_device, char *tmp_mount_point); int fs_mgr_do_mount_one(struct fstab_rec *rec); int fs_mgr_do_tmpfs_mount(const char *n_name); -int fs_mgr_unmount_all(struct fstab *fstab); struct fstab_rec const* fs_mgr_get_crypt_entry(struct fstab const* fstab); void fs_mgr_get_crypt_info(struct fstab* fstab, char* key_loc, char* real_blk_device, size_t size); bool fs_mgr_load_verity_state(int* mode); diff --git a/fs_mgr/include_fstab/fstab/fstab.h b/fs_mgr/include_fstab/fstab/fstab.h index d232cca86..b1ee32885 100644 --- a/fs_mgr/include_fstab/fstab/fstab.h +++ b/fs_mgr/include_fstab/fstab/fstab.h @@ -33,7 +33,6 @@ struct fstab { int num_entries; struct fstab_rec* recs; - char* fstab_filename; }; struct fstab_rec {