diff options
author | Jeff Sharkey <jsharkey@android.com> | 2016-11-21 14:16:53 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2016-11-21 15:05:09 -0700 |
commit | 31d0b7043d9077ad8a0ebfbd6ff2f98621e6f413 (patch) | |
tree | 1e44d07bf2d8174b8d91e83124a4a80336e25260 /cmds/sm/src | |
parent | 2c0dc3e09429973f018f771cdecb7d4ecba48833 (diff) |
Add 'fstrim' command for use from shell.
Test: builds, boots, new command works
Bug: 20948199
Change-Id: If7b122a6c98a4ce2a2f38e545015a22decd1b516
Diffstat (limited to 'cmds/sm/src')
-rw-r--r-- | cmds/sm/src/com/android/commands/sm/Sm.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java index 4291c7768198..db3772da9e4f 100644 --- a/cmds/sm/src/com/android/commands/sm/Sm.java +++ b/cmds/sm/src/com/android/commands/sm/Sm.java @@ -92,6 +92,8 @@ public final class Sm { runSetEmulateFbe(); } else if ("get-fbe-mode".equals(op)) { runGetFbeMode(); + } else if ("fstrim".equals(op)) { + runFstrim(); } else { throw new IllegalArgumentException(); } @@ -210,7 +212,7 @@ public final class Sm { mSm.benchmark(volId); } - public void runForget() throws RemoteException{ + public void runForget() throws RemoteException { final String fsUuid = nextArg(); if ("all".equals(fsUuid)) { mSm.forgetAllVolumes(); @@ -219,6 +221,10 @@ public final class Sm { } } + public void runFstrim() throws RemoteException { + mSm.fstrim(0); + } + private String nextArg() { if (mNextArg >= mArgs.length) { return null; @@ -240,6 +246,7 @@ public final class Sm { System.err.println(" sm unmount VOLUME"); System.err.println(" sm format VOLUME"); System.err.println(" sm benchmark VOLUME"); + System.err.println(" sm fstrim"); System.err.println(""); System.err.println(" sm forget [UUID|all]"); System.err.println(""); |