From 3f092f7778ed608d454df4c3dc3b3f7cb4afde3b Mon Sep 17 00:00:00 2001 From: Tom Marshall Date: Mon, 24 Nov 2014 16:02:04 -0800 Subject: recovery: Awakening of MiniVold A minimal vold client for recovery. Change-Id: Id25d955dc1861a910e5f5fc27d9a19e245d66833 --- mtdutils/mounts.c | 15 +++++++++++++++ mtdutils/mounts.h | 1 + 2 files changed, 16 insertions(+) (limited to 'mtdutils') diff --git a/mtdutils/mounts.c b/mtdutils/mounts.c index 6a9b03d..41efa37 100644 --- a/mtdutils/mounts.c +++ b/mtdutils/mounts.c @@ -153,6 +153,21 @@ unmount_mounted_volume(const MountedVolume *volume) } int +unmount_mounted_volume_detach(const MountedVolume *volume) +{ + /* Intentionally pass NULL to umount if the caller tries + * to unmount a volume they already unmounted using this + * function. + */ + int ret = umount2(volume->mount_point, MNT_DETACH); + if (ret == 0) { + free_volume_internals(volume, 1); + return 0; + } + return ret; +} + +int remount_read_only(const MountedVolume* volume) { return mount(volume->device, volume->mount_point, volume->filesystem, diff --git a/mtdutils/mounts.h b/mtdutils/mounts.h index d721355..c8318c0 100644 --- a/mtdutils/mounts.h +++ b/mtdutils/mounts.h @@ -31,6 +31,7 @@ const MountedVolume * find_mounted_volume_by_mount_point(const char *mount_point); int unmount_mounted_volume(const MountedVolume *volume); +int unmount_mounted_volume_detach(const MountedVolume *volume); int remount_read_only(const MountedVolume* volume); -- cgit v1.1