Lines Matching refs:filename

397  * DO NOT use this function if the filename is actually the device name.
400 lofi_map_file(int lfd, struct lofi_ioctl *li, const char *filename)
405 (void) strlcpy(li->li_filename, filename, sizeof (li->li_filename));
411 die(gettext("could not map file %s"), filename);
422 add_mapping(int lfd, const char *devicename, const char *filename,
463 minor = lofi_map_file(lfd, &li, filename);
478 (void) strlcpy(li.li_filename, filename, sizeof (li.li_filename));
485 die(gettext("could not map file %s to %s"), filename,
493 * filename otherwise.
496 delete_mapping(int lfd, const char *devicename, const char *filename,
505 /* delete by filename */
506 (void) strlcpy(li.li_filename, filename,
510 die(gettext("could not unmap file %s"), filename);
526 * Show filename given devicename, or devicename given filename.
529 print_one_mapping(int lfd, const char *devicename, const char *filename)
535 /* given filename, print devicename */
537 (void) strlcpy(li.li_filename, filename,
540 die(gettext("could not find device for %s"), filename);
547 /* given devicename, print filename */
553 die(gettext("could not find filename for %s"), devicename);
1349 lofi_uncompress(int lfd, const char *filename)
1370 (void) strlcpy(li.li_filename, filename, sizeof (li.li_filename));
1373 filename);
1376 if (stat64(filename, &statbuf) == -1)
1377 die(gettext("stat: %s"), filename);
1381 minor = lofi_map_file(lfd, &li, filename);
1388 delete_mapping(lfd, devicename, filename, B_TRUE);
1389 die("%s is not compressed\n", filename);
1393 delete_mapping(lfd, devicename, filename, B_TRUE);
1394 die(gettext("open: %s"), filename);
1397 x = strdup(filename);
1400 x = strdup(filename);
1410 delete_mapping(lfd, devicename, filename, B_TRUE);
1411 die("%s could not be uncompressed\n", filename);
1423 delete_mapping(lfd, devicename, filename, B_TRUE);
1424 die("%s could not be uncompressed\n", filename);
1444 delete_mapping(lfd, devicename, filename, B_TRUE);
1452 die(gettext("could not read from %s"), filename);
1456 if (rename(tmpfilename, filename) == -1)
1464 lofi_compress(int *lfd, const char *filename, int compress_index,
1494 (void) strlcpy(lic.li_filename, filename, sizeof (lic.li_filename));
1497 filename);
1523 if ((uncompfd = open64(filename, O_RDWR|O_LARGEFILE, 0)) == -1)
1524 die(gettext("open: %s"), filename);
1540 die(gettext("fcntl: %s"), filename);
1544 die(gettext("fstat: %s"), filename);
1557 x = strdup(filename);
1560 x = strdup(filename);
1758 die(gettext("error compressing file %s"), filename);
1761 if (rename(comp_filename, filename) == -1) {
1763 die(gettext("error compressing file %s"), filename);
1801 check_file_validity(const char *filename)
1807 fd = open64(filename, O_RDONLY);
1809 die(gettext("open: %s"), filename);
1813 die(gettext("fstat: %s"), filename);
1817 filename);
1820 filename, DEV_BSIZE);
1824 if (name_to_minor(filename) != 0) {
1830 check_file_is_encrypted(const char *filename)
1837 fd = open64(filename, O_RDONLY);
1839 die(gettext("failed to open: %s"), filename);
1843 CRYOFF, filename);
1849 " at offset 0x%lx in file %s"), CRYOFF, filename);
1857 die(gettext("failed to close file %s"), filename);
1906 const char *filename = NULL;
1942 if ((filename = realpath(optarg, realfilename)) == NULL)
1975 if ((filename = realpath(optarg,
2050 if (compressflag || uncompressflag) /* needs filename */
2058 if ((filename = realpath(argv[optind],
2067 if ((filename = realpath(argv[optind],
2079 check_file_validity(filename);
2081 if (filename && !valid_abspath(filename))
2085 * Here, we know the arguments are correct, the filename is an
2134 !check_file_is_encrypted(filename));
2150 add_mapping(lfd, devicename, filename, cipher, rkey, rksz,
2153 lofi_compress(&lfd, filename, compress_index, segsize);
2155 lofi_uncompress(lfd, filename);
2157 delete_mapping(lfd, devicename, filename, force);
2158 else if (filename || devicename)
2159 print_one_mapping(lfd, devicename, filename);