DO NOT MERGE. Fix crash in vold

b/11239345

Change-Id: I46a8d6b38e3c093e20e1e5c4f01efc13d1960ad4
merge in klp-release (no-op)
Merge "DO NOT MERGE. Fix crash in vold" into klp-dev
Extract UUID and label from inserted volumes.

Uses "blkid" tool to extract metadata from an inserted volume, and
reports it up to the framework.  This needs to happen in vold, since
only the FUSE-wrapped volume is visible to userspace.

Remove autorun sanitization, since FUSE takes care of this now.

Bug: 11175082
Change-Id: Ie69b38011ad6011bfb50e40d4f35a29e02150c19
Clean up ASEC unmounting on physical storage.

When physical devices are unsafely removed, unmountAllAsecsInDir()
fails to find any ASECs, and leaves them all mounted, preventing the
rest of volume from going down.

Now we examine all ASEC containers, and remove when on external
storage, or when the storage media is no longer found.

Bug: 11175082
Change-Id: Iffa38ea43f7e5ad78b598374ebeb60a8727d99fd
Merge "Extract UUID and label from inserted volumes." into klp-dev
Merge "Clean up ASEC unmounting on physical storage." into klp-dev
Use correct minor device number to format SD card

When formatting SD card partitions, instead of assuming partition
minor device numbers start from 1, use (minor device number of
the disk device + 1) as the starting point.

Bug: 11352632
Change-Id: I69d37f57aec6b62fe2a055470f7525ec09dc3859
Signed-off-by: Blair Prescott <blairp@broadcom.com>
Signed-off-by: Pierre <pierre@broadcom.com>
vold: allow override of MAX_PARTITIONS for devices with > 4 partitions

Change-Id: Iec4de6e7e5ad52a6dfa45952bb19104f500d9c58a
Reintroduce BOARD_VOLD_EMMC_SHARES_DEV_MAJOR

Code taken from CM7's vold
vold: add ro.vold.umsdirtyratio property

This allows control of what /proc/sys/vm/dirty_ratio is used when USB mounting.
Some platforms like the HTC Desire (bravo) 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 HTC Desire.

This addresses this issue: http://code.google.com/p/cyanogenmod/issues/detail?id=2949

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

Change-Id: I86b7bbd02695fb0c19f39448714a219257bf806f
DirectVolume: handle discs with multiple major numbers

CFlag: BOARD_VOLD_DISC_HAS_MULTIPLE_MAJORS

Allows Direct Volume to handle discs with multiple major numbers.
Needed on Samsung Galaxy S II and variants.

For example:
mmcblk0p1 - 179:0
mmcblk0p2 - 179:1
mmcblk0p3 - 179:2
mmcblk0p4 - 256:0
mmcblk0p5 - 256:1

Change-Id: I633ac882a721cde25f0df779b4028efa6be15750
vold: fix an offset one bug that makes partition 4 unusable

Change-Id: Ic8e18e6191ad7ee33162e36060b57a6802cf0883
vold: Add ntfs (read-only) support.

See http://review.cyanogenmod.com/#change,7457 for more info.

Change-Id: Ic841e73be6435e8bbbb22984cc749e27c46826e8
vold: fix handling of discs with multiple majors on DirectVolume::getShareDevice()

The method DirectVolume::getShareDevice() returns an invalid device if the partition referenced by
mPartIdx is bad. A bad partition is one where the major/minor numbers on disk don't match what is
expected.

The original major number is stored for bad partitions so the fix attempts to retrieve it and
return it if applicable.

This fix is one part of fixing ICS encryption on the i777 (and possibly other devices) where bad
partitions may exist.

Change-Id: Ic3b05dbf45315bde502c151f53928ca1891483f0
vold: use blkid to detect filesystem type

In preparation for handling ext4 partitions via vold and fuse.

Change-Id: Ibaccded63a7a293ad53f16afb80448ddd493554c
vold: add support for ext4 media

Depends on:
http://review.cyanogenmod.org/31202
http://review.cyanogenmod.org/31211

Result:
http://pastebin.com/nzUbvW7K

Change-Id: I5bd227e637f2a1ed4d13a2eb81390c56c953f482
vold: exFAT support

 * Add support for exFAT using FUSE implementation.

Change-Id: I590c7b1bc8fbcb8c0b2c669f4073ac022857e4da
vold: Add NTFS read+write support via ntfs-3g

 * Use ntfs-3g for full NTFS support.
 * Original code from Freescale.

Change-Id: I01191c3c339421904dc9415eb00143f7f8365152
vold: Replace usage of discontinued logwrap()

Change-Id: Ia76bf8998064beee5e0ea4451c4dd8418c2193c4