Lines Matching refs:fd

165   android::base::unique_fd fd(  in IsFscryptV2Supported()  local
167 if (fd < 0) { in IsFscryptV2Supported()
172 if (ioctl(fd, FS_IOC_ADD_ENCRYPTION_KEY, nullptr) == 0) { in IsFscryptV2Supported()
201 explicit ScopedF2fsFilePinning(int fd) : fd_(fd) { in ScopedF2fsFilePinning() argument
220 static bool ReadRawDataOfFile(int fd, const std::string &blk_device, in ReadRawDataOfFile() argument
229 if (fsync(fd) != 0) { in ReadRawDataOfFile()
234 ScopedF2fsFilePinning pinned_file(fd); // no-op on non-f2fs in ReadRawDataOfFile()
244 if (ioctl(fd, FS_IOC_FIEMAP, map.get()) != 0) { in ReadRawDataOfFile()
314 android::base::unique_fd fd( in WriteTestFile() local
316 if (fd < 0) { in WriteTestFile()
320 if (!android::base::WriteFully(fd, plaintext.data(), plaintext.size())) { in WriteTestFile()
326 if (!ReadRawDataOfFile(fd, blk_device, plaintext.size(), ciphertext)) { in WriteTestFile()
540 android::base::unique_fd fd( in SetEncryptionPolicy() local
542 if (fd < 0) { in SetEncryptionPolicy()
579 android::base::unique_fd fd(open(kTestFile, O_RDONLY | O_CLOEXEC)); in GenerateTestFile() local
580 if (fd < 0) { in GenerateTestFile()
590 if (ioctl(fd, FS_IOC_GET_ENCRYPTION_NONCE, info->nonce.bytes) != 0) { in GenerateTestFile()
859 android::base::unique_fd fd( in TestEmmcOptimizedDunWraparound() local
861 ASSERT_GE(fd, 0) << "Failed to create " << path << Errno(); in TestEmmcOptimizedDunWraparound()
887 android::base::unique_fd fd(open(path.c_str(), open_flags)); in TestEmmcOptimizedDunWraparound() local
888 ASSERT_GE(fd, 0) << "Failed to open " << path << Errno(); in TestEmmcOptimizedDunWraparound()
901 ASSERT_EQ(data_size, pwrite(fd, buf_mem.get(), data_size, pos)) in TestEmmcOptimizedDunWraparound()
905 ASSERT_TRUE(ReadRawDataOfFile(fd, fs_info_.raw_blk_device, data_size, in TestEmmcOptimizedDunWraparound()