Migrate primary external storage.
When requested, kick off a thread that will migrate storage contents
between two locations. This is performed in several steps that
also interact with the framework:
1. Take old and new volumes offline during migration
2. Wipe new location clean (10% of progress)
3. Copy files from old to new (60% of progress)
4. Inform framework that move was successful so it can persist
5. Wipe old location clean (15% of progress)
Derives a hacky progress estimate by using a rough proxy of free
disk space changes while a cp/rm is taking place.
Add new internal path for direct access to volumes to bypass any
FUSE emulation overhead, and send it to framework. Remove mutex
around various exec calls since setexeccon() is already per-thread.
Bug: 19993667
Change-Id: Ibcb4f6fe0126d05b2365f316f53e71dc3e79a2b8
diff --git a/VolumeBase.h b/VolumeBase.h
index 1010e94..a9975f8 100644
--- a/VolumeBase.h
+++ b/VolumeBase.h
@@ -81,6 +81,7 @@
userid_t getMountUserId() { return mMountUserId; }
State getState() { return mState; }
const std::string& getPath() { return mPath; }
+ const std::string& getInternalPath() { return mInternalPath; }
status_t setDiskId(const std::string& diskId);
status_t setMountFlags(int mountFlags);
@@ -109,6 +110,7 @@
status_t setId(const std::string& id);
status_t setPath(const std::string& path);
+ status_t setInternalPath(const std::string& internalPath);
void notifyEvent(int msg);
void notifyEvent(int msg, const std::string& value);
@@ -130,6 +132,8 @@
State mState;
/* Path to mounted volume */
std::string mPath;
+ /* Path to internal backing storage */
+ std::string mInternalPath;
/* Flag indicating that volume should emit no events */
bool mSilent;