binder: Remove ashmem validitiy checks

ashmem_get_size_region will return an error if the fd is invalid or is
not an ashmem_fd. There is no point in calling ashmem_valid and doing an
fstat. This patch avoids it since its of no use in the critical path.

Test: Run camera preview succesfully
    VFS calls before change:
    ffffff8ed17e263c vfs_getattr.cfi                1457
    ffffff8ed2d09d48 vfs_getattr                    1597
    ffffff8ed2d2ccd4 vfs_read                       2826
    ffffff8ed17d6a34 vfs_read.cfi                   2856
    ffffff8ed17d6660 vfs_write.cfi                  1753
    ffffff8ed2d2d170 vfs_write                      1840

    VFS calls after change (showing reduction in getattr):
    ffffff9625309d48 vfs_getattr                     151
    ffffff9623de263c vfs_getattr.cfi                 151
    ffffff962532ccd4 vfs_read                       1301
    ffffff9623dd6a34 vfs_read.cfi                   1333
    ffffff9623dd6660 vfs_write.cfi                  1385
    ffffff962532d170 vfs_write                      1458

Bug: 111418894
Change-Id: I47038e0ed4cf564dfb63db8918c7f39d919b3634
Signed-off-by: Joel Fernandes <joelaf@google.com>
1 file changed