Lines Matching refs:fname
297 static int check_verity_restart(const char *fname)
305 fd = TEMP_FAILURE_RETRY(open(fname, O_RDONLY | O_CLOEXEC));
309 PERROR << "Failed to open " << fname;
315 PERROR << "Failed to fstat " << fname;
326 PERROR << "Failed to lseek " << (intmax_t)(s.st_size - size) << " " << fname;
331 PERROR << "Failed to read " << size << " bytes from " << fname;
388 static int metadata_find(const char *fname, const char *stag,
399 if (!fname) {
403 fp = fopen(fname, "r+");
406 PERROR << "Failed to open " << fname;
413 PERROR << "Failed to read magic from " << fname;
422 PERROR << "Failed to write magic to " << fname;
428 PERROR << "Failed to add metadata to " << fname;
453 PERROR << "Failed to seek " << fname;
459 PERROR << "Failed to write metadata to " << fname;
474 static int write_verity_state(const char *fname, off64_t offset, int32_t mode)
480 fd = TEMP_FAILURE_RETRY(open(fname, O_WRONLY | O_SYNC | O_CLOEXEC));
483 PERROR << "Failed to open " << fname;
488 PERROR << "Failed to write " << sizeof(s) << " bytes to " << fname
503 static int read_verity_state(const char *fname, off64_t offset, int *mode)
509 fd = TEMP_FAILURE_RETRY(open(fname, O_RDONLY | O_CLOEXEC));
512 PERROR << "Failed to open " << fname;
517 PERROR << "Failed to read " << sizeof(s) << " bytes from " << fname
525 rc = write_verity_state(fname, offset, *mode);