Merge branch 'kk4.4' of https://github.com/SlimRoms/android_system_core into kk4.4
sdcard: direct I/O file access fix

If a file is opened in direct I/O mode (with O_DIRECT flag),
the read buffer addess must be aligned to memory page size
boundary. The Direct I/O is not needed for normal files,
however, some special hardware access (e.g. smart SD cards)
will not work without it.

Change-Id: I42babeee86dba1880fd23e2592fddd7060da3e20
sdcard: direct I/O file access write buffer alignment

It is not enough to align the read buffer only, because
consequent writes might still fail with EINVAL. The write
buffer should be also aligned according to the write(2)
manual page.

Change-Id: I7547dec5208732c56f4466c1b0c88f36dabacf5b
Handle FUSE_FSYNCDIR as FUSE_FSYNC

There have been issues with sdcard data corruption even after
successfully calling fsync for /sdcard. This is caused by
the sdcard daemon doing nothing in this case.

Change-Id: I48149ceabdac79ac535b35c2598bb1fbb5410883
sdcard: fuse AOSP updates

Slight modifications have been made to the AOSP master branch for fuse.c
this commit add the small changes to bring fuse inline with AOSP.

Change-Id: Iad894b65571cb2d5146f0e25bdc2dbf40ef03761
sdcard: direct I/O file access fix

If a file is opened in direct I/O mode (with O_DIRECT flag),
the read buffer addess must be aligned to memory page size
boundary. The Direct I/O is not needed for normal files,
however, some special hardware access (e.g. smart SD cards)
will not work without it.

Change-Id: I42babeee86dba1880fd23e2592fddd7060da3e20
Fix build with clang 3.4

Clang doesn't have __builtin___clear_cache, and currently has a
problem with large alignments (llvm bug #13007).

Change-Id: I2555e9557a687882265a21abbb403082852be830
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
sdcard: Respect check_caller_access_to_name on readdir() calls

While looking at a blocked path failed as expected when trying
to access it with a stat(), read(), or getattr(), readdir() still
returned the entry, making devices with mounted external storage fail
com.android.cts.appsecurity.AppSecurityTests#testExternalStorageWrite
by trying to interact with otherwise invisible paths.

Fixit by skipping all entries that would've been made invisible at
LOOKUP

Change-Id: Ia8afac0703fa10f78c89046f029776bd290e4846
<system/audio.h>: do not use GNU old-style field designators

Avoiding the use of GCC extensions improves code
portability

Change-Id: I2af822c236d073b424ed44976450c9f9e71411cb