Lines Matching refs:finfo
73 static struct file_info finfo;
339 if (file_ops && finfo.type == VMA_FILE)
340 _write_num(finfo.dev_queue_read_ahead_path,
412 if (file_ops && finfo.type == VMA_FILE)
414 _read_num(finfo.dev_queue_read_ahead_path);
432 finfo.dir = dir;
433 stat(finfo.dir, &path_stat);
435 printf("%s: Not a directory (%s)\n", __func__, finfo.dir);
438 if (snprintf(finfo.path, sizeof(finfo.path), "%s/" TEST_FILE,
439 finfo.dir) >= sizeof(finfo.path)) {
443 if (statfs(finfo.dir, &fs)) {
447 finfo.type = fs.f_type == TMPFS_MAGIC ? VMA_SHMEM : VMA_FILE;
448 if (finfo.type == VMA_SHMEM)
464 if (snprintf(finfo.dev_queue_read_ahead_path,
465 sizeof(finfo.dev_queue_read_ahead_path),
468 >= sizeof(finfo.dev_queue_read_ahead_path)) {
493 if (snprintf(finfo.dev_queue_read_ahead_path,
494 sizeof(finfo.dev_queue_read_ahead_path),
496 str) >= sizeof(finfo.dev_queue_read_ahead_path)) {
669 unlink(finfo.path); /* Cleanup from previous failed tests */
670 printf("Creating %s for collapse%s...", finfo.path,
671 finfo.type == VMA_SHMEM ? " (tmpfs)" : "");
672 fd = open(finfo.path, O_DSYNC | O_CREAT | O_RDWR | O_TRUNC | O_EXCL,
687 printf("Opening %s read only for collapse...", finfo.path);
688 finfo.fd = open(finfo.path, O_RDONLY, 777);
689 if (finfo.fd < 0) {
694 MAP_PRIVATE, finfo.fd, 0);
709 close(finfo.fd);
710 unlink(finfo.path);
723 switch (finfo.type) {
739 finfo.fd = memfd_create("khugepaged-selftest-collapse-shmem", 0);
740 if (finfo.fd < 0) {
744 if (ftruncate(finfo.fd, size)) {
748 p = mmap(BASE_ADDR, size, PROT_READ | PROT_WRITE, MAP_SHARED, finfo.fd,
760 close(finfo.fd);
904 return ops == &__file_ops && finfo.type == VMA_SHMEM;