vold: Fix encryption issue due to stack corruption.

Ioctl BLKGETSIZE expects pointer to unsigned long as argument.

On 64bit target using pointer to unsigned int can cause stack
corruption due to type mismatch.

Change-Id: I422068ba5006c0b685f1504e1e6aa30152ee8433
On bad removal unmount mountpoint of storage without partitions.

On bad removal of storage device, this change
will make sure to unmount the mount point
of the storage device having only disk and no partitions.

Change-Id: Ieb6ad1297883b93050abdf7d98346388cd5610df
Changes for supporting UICC feature

To have UICC support with multiple sysfs entries with
the same volume label, one boolean flag is added to validate
the correct sysfs entry in fstab.qcom

Change-Id: Ic254e514db95fca82552fea3f9b09310ac09b33b
vold: add support for Per-File-Encryption (PFE)

Add PFE-Enable command to crypto command listener.
The command handler creates the crypto-block-device
and mount it to /data, same as done for Full-Disk-Encryption (FDE)

Conflicts:
	cryptfs.h

Change-Id: I03e15e26800b96c0bf06398c6fc9fbb11fee6e71
Create disk encryption key before framework start

HW based disk encryption creates key in secure side. Key creation
can take sometime to create the key securely. If framework is
started before creating the key, it is possible that framework
requests service from secure side. Secure side can serve mostly one
request at a time. Secure side may reject framework request if key
creation request is still going on. This may cause problem in the
system

Change-Id: I5480ab72a37c02532218a18faaba598a824589fd
vold: cryptfs: add useful info messages

The vold can mount /data either to dm-crypt or dm-req-crypt target
with different parameters.
print that important info to the user space log.

Change-Id: I5a6925175b4b556f2675cef47f65f709a1b857e2
vold: reduce debug info printed

Print real_blk_name and extra_params instead of crypt_params.

Change-Id: I2c7e7f61d77b46ca1ae4ac9942e6052d5b7d13a4
Adding support of dm-req-crypt

Currently Android provides disk encryption support using dm-crypt
which is based on bios. dm-crypt uses 512 bytes packet size for
crypto operations. While 512 bytes size packet is ok for SW based
disk encryption, it is inefficient for HW based crypto engines.
dm-req-crypt is similar to dm-crypt except it uses block requests
rathe bios for crypto operations. block requests when unpacked
carries data upto 512KB. Hence, HW based crypto engine can be used
more efficiently.

Conflicts:
cryptfs.c
Change-Id: Ic541d4d1b9db4ce32465e30c5f25619a80975767
vold: Fixes for HW FDE issues

SW FDE is using default password to encrypt the device by default.
Hence whenever password is updated, vold check if default password
was used to encrypt the device. Similar change is required for HW
based FDE as well.

Change-Id: Id251d7f93a034786fbff00ae9b921731353d9edc
vold: cryptfs: compiler fix

Add extra input to wait_and_unmount.

Change-Id: I8e2c68408965aab7142ee5c6b078e6d37a36224a
Build minivold for recovery

 * We can't link to the main recovery executable due to various issues,
   so just build a static minivold.

 * Updated for 4.4

Change-Id: If110aa4fca9608d5c2a03f471773e7ce2c77dc91

minivold: adjustments for vold in recovery

- Mount directly to /storage/ instead of /mnt/media_rw
- Do not attempt to mount ASEC

Change-Id: Icb088a413e07222b302264d10f7c7f2aadfebcab

minivold: Adjust to 5.0

Change-Id: I9defc2c8642da603bfa0dcf0962152485f75f547
vold: allow override of MAX_PARTITIONS for devices with > 4 partitions

Change-Id: I3847109be69539c23f92077b0b81aaf6ad224af5
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: If8f0f9d275e4642dd8e098817c993e07a5f1ada1
Reintroduce BOARD_VOLD_EMMC_SHARES_DEV_MAJOR

Code taken from CM7's vold

Change-Id: Iaa6ebe57710ffe93156e3a9e47739ad771bd314b