vold: don't crash when formatting unformatted volume

When formatting unformatting volumes, fstype will be NULL causing
a crash in strcmp. Set it to "vfat" to avoid the crash.

Conflicts:
	Volume.cpp

Change-Id: I3876ea2a6d91e78f579537fd6ea3d030fb18ee7b

Conflicts:
	Volume.cpp
vold: add ro.vold.umsdirtyratio property

It allows control of what /proc/sys/vm/dirty_ratio is used when USB mounting.
At some platforms like the HTC Desire (bravo) and Samsung Galaxy S family (i9000x) we get a _HUGE_ performance boost when writing to the sdcard when USB mounting if this is set to 20 (which is the default) on the devices above.

It makes it possible to undo or control the effect of this commit:
https://github.com/CyanogenMod/android_system_vold/commit/a28056b38275003895ff5d9576681aca01544822

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I86b7bbd02695fb0c19f39448714a219257bf806f
vold: mount ext4 with forced SELinux context

Always mount voldmanaged ext4 partitions with the SELinux sdcard_external
context. For other file systems, this is done via the genfs_context,
but since ext4 supports SELinux natively, it must be set here.

Change-Id: I1364f37018b25d79b1826c85849def64e868d72f

Conflicts:
	Ext4.cpp
Revert "vold: add ro.vold.umsdirtyratio property"

This reverts commit 8b697952b8d3136a24e1d04ef83f01c68605da50.
Revert "vold: don't crash when formatting unformatted volume"

This reverts commit 8e365f23f05cebbc6bd08c96255427a723ae641e.
cryptfs: also unmount /data/data before encrypting

galaxysmtd mounts /data/data on top on /data when unencrypted for
performance reason, so when encrypting, we need to unmount that
first before we can unmount /data.

On other devices, umount on a non-mounted folder will silently
succeed.

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I07a73534fb3e253b702a4be6f976594644795e36
vold: add ro.vold.umsdirtyratio property

It allows control of what /proc/sys/vm/dirty_ratio is used when USB mounting.
At some platforms like the HTC Desire (bravo) and Samsung Galaxy S family (i9000x) we get a _HUGE_ performance boost when writing to the sdcard when USB mounting if this is set to 20 (which is the default) on the devices above.

It makes it possible to undo or control the effect of this commit:
https://github.com/CyanogenMod/android_system_vold/commit/a28056b38275003895ff5d9576681aca01544822

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I86b7bbd02695fb0c19f39448714a219257bf806f
vold: don't crash when formatting unformatted volume

When formatting unformatting volumes, fstype will be NULL causing
a crash in strcmp. Set it to "vfat" to avoid the crash.

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I3876ea2a6d91e78f579537fd6ea3d030fb18ee7b
vold: support more than 1 UMS share

Used for devices with both mountable internal and external sdcards.

This is a forward-port and clean up of the 10.2 code (which contains
a lot of deadcode.)

Original authors:

    Alex Zepeda <alex@inferiorhumanorgans.com>
    Genokolar <genokolar@gmail.com>
    Josh Stone <cuviper@gmail.com>
    mik_os <kiril.mik.os@gmail.com>
    Oran Avraham <oranav@gmail.com>
    Pawit Pornkitprasan <p.pawit@gmail.com>
    Tony Layher <layhertony@gmail.com>

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I926ce244255414697373d26d252a9da89aea7226
Revert "vold: support more than 1 UMS share"

This reverts commit 2209cf1ad2a147abe7b6e64d2380416ed26cdc2f.
Revert "vold: don't crash when formatting unformatted volume"

This reverts commit 60b9e2ff0a254433718ff830342ed9a7d31950b6.
Revert "vold: add ro.vold.umsdirtyratio property"

This reverts commit ff7a04d6ebc22f3b5c89d495d225650648c5b862.
vold: fix common flags

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: Ia552365c28a32d814b1645547c77bc6e2a650e4c
Revert "cryptfs: also unmount /data/data before encrypting"

This reverts commit 415938c380ce1e4b20c47ee6397c3994b3dcdd33.
Merge pull request #1 from TheWolf91/android-4.4

Vold