As it is not upstream, it doesn't belong in the external/kernel-headers
... or in bionic's cleaned up copy.
It matches what is in common/android-3.10.
Bug: 15593563
Change-Id: I6fa22cd823a88805ec57f973813ac69291069c7d
This adds an "fstrim dodtrim" command which will attempt to use
the FIDTRIM ioctl() if FIDTRIM is defined in the uapi/linux/fs.h.
If not, it will fail with EINVAL.
If no FIDTRIM is defined, it does not affect the "fstrim dotrim".
Change-Id: Icbfd621abb592b170db06f749e5eedfd1175f723
Replace MINOR(dev_t) and MAJOR(dev_t) with minor and major,
which cast to int.
Cast int to uintptr_t before casting to pointer
Change-Id: I59375518f15d27f400fcd4f8a8dfe5ebdd8350e6
Fstrim can take a while, so grab a wakelock so it finishes now,
not when the user picks up the device and wakes it back up.
This change does not protect against multiple calls to fstrim
before the first one completes. When the first one completes, it
will release the wakelock, and the device will go to sleep.
However, normal usage is this will not be invoked by the framework
more than once a day, so this should not be an issue.
Bug: 8781133
Change-Id: I8065d1380eaf52ca8a7ca308af66fb6e86d60a66
Some devices can take up to a few minutes to do fstrim. If done
in the same thread as the rest of the vold command listener, then
vold is blocked from responding to any other commands until the
trim is done. So create a thread to do the work, and return
immediately.
bug: 8688454
Change-Id: I780baae03ba7de2d3e805c3e9f103ec03be84c47
The fstrim subsystem implements the dotrim command, which goes
through all the writable filesystems on the device, and invokes
the FITRIM ioctl() on them. This marks all the unused blocks on
the underlying flash device as unused, so the device performs better.
Change-Id: I5fc8c2f60e0bc823f162d0f89580fb288ecb2160