fs_mgr: add fs_mgr_do_mount_one() API

This is to be used in early mount case where we will have a fully
prepared fstab_rec. fs_mgr_do_mount() does a lot more checks and
spends time preparing verity / avb devices before it does the actual
mount.

b/33254008

Test: Boot sailfish

Change-Id: I4481b5af8d900c8b7e3355b7513c325d8f2ecff2
Signed-off-by: Sandeep Patil <sspatil@google.com>
This commit is contained in:
Sandeep Patil 2017-02-14 14:00:14 -08:00
parent 4a534ebc91
commit 56f9ada93d
2 changed files with 19 additions and 0 deletions

View File

@ -880,6 +880,24 @@ int fs_mgr_mount_all(struct fstab *fstab, int mount_mode)
}
}
/* wrapper to __mount() and expects a fully prepared fstab_rec,
* unlike fs_mgr_do_mount which does more things with avb / verity
* etc.
*/
int fs_mgr_do_mount_one(struct fstab_rec *rec)
{
if (!rec) {
return FS_MGR_DOMNT_FAILED;
}
int ret = __mount(rec->blk_device, rec->mount_point, rec);
if (ret) {
ret = (errno == EBUSY) ? FS_MGR_DOMNT_BUSY : FS_MGR_DOMNT_FAILED;
}
return ret;
}
/* If tmp_mount_point is non-null, mount the filesystem there. This is for the
* tmp mount we do to check the user password
* If multiple fstab entries are to be mounted on "n_name", it will try to mount each one

View File

@ -103,6 +103,7 @@ int fs_mgr_mount_all(struct fstab *fstab, int mount_mode);
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(char *n_name);
int fs_mgr_unmount_all(struct fstab *fstab);
int fs_mgr_get_crypt_info(struct fstab *fstab, char *key_loc,