fs-verity: replace ioctl(FS_IOC_MEASURE_VERITY) with statx()

This CL replaces the open(file) + ioctl(FS_IOC_MEASURE_VERITY) with
statx() to improve performance. This is because opening fs-verity files
is expensive.

This CL assumes that statx(STATX_ATTR_VERITY) is supported by the kernel.
This is the case for all the Android common kernels that support
fs-verity.

Bug: 146676114
Test: atest com.android.apkverity.ApkVerityTest
      All 17 tests passed
      Tested on Cuttlefish.
Change-Id: I21c70132682c0d4ae6922419b269aa9f5de2fb72
2 files changed