aboutsummaryrefslogtreecommitdiffstats
path: root/mtdutils
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2014-11-24 16:02:04 -0800
committerTom Marshall <tdm@cyngn.com>2015-11-25 15:34:31 -0800
commit3f092f7778ed608d454df4c3dc3b3f7cb4afde3b (patch)
tree326444388672880e6ab3bf72f434e13e1d80c25e /mtdutils
parent383f723fdb0ebba5078ccc2aabf87f0516215bf9 (diff)
downloadbootable_recovery-3f092f7778ed608d454df4c3dc3b3f7cb4afde3b.zip
bootable_recovery-3f092f7778ed608d454df4c3dc3b3f7cb4afde3b.tar.gz
bootable_recovery-3f092f7778ed608d454df4c3dc3b3f7cb4afde3b.tar.bz2
recovery: Awakening of MiniVold
A minimal vold client for recovery. Change-Id: Id25d955dc1861a910e5f5fc27d9a19e245d66833
Diffstat (limited to 'mtdutils')
-rw-r--r--mtdutils/mounts.c15
-rw-r--r--mtdutils/mounts.h1
2 files changed, 16 insertions, 0 deletions
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);