Lines Matching refs:finfo

74 static struct file_info finfo;
115 if (file_ops && finfo.type == VMA_FILE)
116 thp_set_read_ahead_path(finfo.dev_queue_read_ahead_path);
136 finfo.dir = dir;
137 stat(finfo.dir, &path_stat);
139 printf("%s: Not a directory (%s)\n", __func__, finfo.dir);
142 if (snprintf(finfo.path, sizeof(finfo.path), "%s/" TEST_FILE,
143 finfo.dir) >= sizeof(finfo.path)) {
147 if (statfs(finfo.dir, &fs)) {
151 finfo.type = fs.f_type == TMPFS_MAGIC ? VMA_SHMEM : VMA_FILE;
152 if (finfo.type == VMA_SHMEM)
168 if (snprintf(finfo.dev_queue_read_ahead_path,
169 sizeof(finfo.dev_queue_read_ahead_path),
172 >= sizeof(finfo.dev_queue_read_ahead_path)) {
197 if (snprintf(finfo.dev_queue_read_ahead_path,
198 sizeof(finfo.dev_queue_read_ahead_path),
200 str) >= sizeof(finfo.dev_queue_read_ahead_path)) {
373 unlink(finfo.path); /* Cleanup from previous failed tests */
374 printf("Creating %s for collapse%s...", finfo.path,
375 finfo.type == VMA_SHMEM ? " (tmpfs)" : "");
376 fd = open(finfo.path, O_DSYNC | O_CREAT | O_RDWR | O_TRUNC | O_EXCL,
391 printf("Opening %s read only for collapse...", finfo.path);
392 finfo.fd = open(finfo.path, O_RDONLY, 777);
393 if (finfo.fd < 0) {
398 MAP_PRIVATE, finfo.fd, 0);
413 close(finfo.fd);
414 unlink(finfo.path);
427 switch (finfo.type) {
443 finfo.fd = memfd_create("khugepaged-selftest-collapse-shmem", 0);
444 if (finfo.fd < 0) {
448 if (ftruncate(finfo.fd, size)) {
452 p = mmap(BASE_ADDR, size, PROT_READ | PROT_WRITE, MAP_SHARED, finfo.fd,
464 close(finfo.fd);
608 return ops == &__file_ops && finfo.type == VMA_SHMEM;