diff options
author | Ken Sumrall <ksumrall@android.com> | 2013-05-02 11:36:02 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-05-02 11:36:02 -0700 |
commit | 924d9defc6d12f43c71daa1748f9e92c2a6e5981 (patch) | |
tree | 75bdedef32072a19ae2cacc8ddaa94ec9aee879c /fstrim.c | |
parent | 2c4b563b3dc2c5ea0a9e98fab54fee5f55a1a9f7 (diff) | |
parent | e78cd4f33d2b7969f1baca2b274740e1b53b3121 (diff) | |
download | android_system_vold-924d9defc6d12f43c71daa1748f9e92c2a6e5981.tar.gz android_system_vold-924d9defc6d12f43c71daa1748f9e92c2a6e5981.tar.bz2 android_system_vold-924d9defc6d12f43c71daa1748f9e92c2a6e5981.zip |
am e78cd4f3: Grab a partial wakelock when doing fstrim
* commit 'e78cd4f33d2b7969f1baca2b274740e1b53b3121':
Grab a partial wakelock when doing fstrim
Diffstat (limited to 'fstrim.c')
-rw-r--r-- | fstrim.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -26,6 +26,9 @@ #include <pthread.h> #define LOG_TAG "fstrim" #include "cutils/log.h" +#include "hardware_legacy/power.h" + +#define FSTRIM_WAKELOCK "dofstrim" static void *do_fstrim_filesystems(void *ignored) { @@ -83,6 +86,9 @@ static void *do_fstrim_filesystems(void *ignored) } SLOGI("Finished fstrim work.\n"); + /* Release the wakelock that let us work */ + release_wake_lock(FSTRIM_WAKELOCK); + return (void *)ret; } @@ -91,6 +97,11 @@ int fstrim_filesystems(void) pthread_t t; int ret; + /* Get a wakelock as this may take a while, and we don't want the + * device to sleep on us. + */ + acquire_wake_lock(PARTIAL_WAKE_LOCK, FSTRIM_WAKELOCK); + /* Depending on the emmc chip and size, this can take upwards * of a few minutes. If done in the same thread as the caller * of this function, that would block vold from accepting any |