Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56f9ada9 authored by Sandeep Patil's avatar Sandeep Patil
Browse files

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: default avatarSandeep Patil <sspatil@google.com>
parent 4a534ebc
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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,