Lines Matching refs:fd

38 static __fsword_t get_fs_type(int fd)  in get_fs_type()  argument
44 ret = fstatfs(fd, &fs); in get_fs_type()
91 static void do_test(int fd, size_t size, enum test_type type, bool shared) in do_test() argument
93 __fsword_t fs_type = get_fs_type(fd); in do_test()
99 if (fd < 0) { in do_test()
104 if (ftruncate(fd, size)) { in do_test()
116 if (fallocate(fd, 0, 0, size)) { in do_test()
136 shared ? MAP_SHARED : MAP_PRIVATE, fd, 0); in do_test()
300 typedef void (*test_fn)(int fd, size_t size);
304 int fd; in run_with_memfd() local
308 fd = memfd_create("test", 0); in run_with_memfd()
309 if (fd < 0) { in run_with_memfd()
315 fn(fd, pagesize); in run_with_memfd()
316 close(fd); in run_with_memfd()
322 int fd; in run_with_tmpfile() local
329 fd = -1; in run_with_tmpfile()
331 fd = fileno(file); in run_with_tmpfile()
332 if (fd < 0) { in run_with_tmpfile()
337 fn(fd, pagesize); in run_with_tmpfile()
346 int fd; in run_with_local_tmpfile() local
350 fd = mkstemp(filename); in run_with_local_tmpfile()
351 if (fd < 0) in run_with_local_tmpfile()
356 close(fd); in run_with_local_tmpfile()
357 fd = -1; in run_with_local_tmpfile()
360 fn(fd, pagesize); in run_with_local_tmpfile()
362 if (fd >= 0) in run_with_local_tmpfile()
363 close(fd); in run_with_local_tmpfile()
370 int fd; in run_with_memfd_hugetlb() local
377 fd = memfd_create("test", flags); in run_with_memfd_hugetlb()
378 if (fd < 0) { in run_with_memfd_hugetlb()
384 fn(fd, hugetlbsize); in run_with_memfd_hugetlb()
385 close(fd); in run_with_memfd_hugetlb()
393 static void test_shared_rw_pin(int fd, size_t size) in test_shared_rw_pin() argument
395 do_test(fd, size, TEST_TYPE_RW, true); in test_shared_rw_pin()
398 static void test_shared_rw_fast_pin(int fd, size_t size) in test_shared_rw_fast_pin() argument
400 do_test(fd, size, TEST_TYPE_RW_FAST, true); in test_shared_rw_fast_pin()
403 static void test_shared_ro_pin(int fd, size_t size) in test_shared_ro_pin() argument
405 do_test(fd, size, TEST_TYPE_RO, true); in test_shared_ro_pin()
408 static void test_shared_ro_fast_pin(int fd, size_t size) in test_shared_ro_fast_pin() argument
410 do_test(fd, size, TEST_TYPE_RO_FAST, true); in test_shared_ro_fast_pin()
413 static void test_private_rw_pin(int fd, size_t size) in test_private_rw_pin() argument
415 do_test(fd, size, TEST_TYPE_RW, false); in test_private_rw_pin()
418 static void test_private_rw_fast_pin(int fd, size_t size) in test_private_rw_fast_pin() argument
420 do_test(fd, size, TEST_TYPE_RW_FAST, false); in test_private_rw_fast_pin()
423 static void test_private_ro_pin(int fd, size_t size) in test_private_ro_pin() argument
425 do_test(fd, size, TEST_TYPE_RO, false); in test_private_ro_pin()
428 static void test_private_ro_fast_pin(int fd, size_t size) in test_private_ro_fast_pin() argument
430 do_test(fd, size, TEST_TYPE_RO_FAST, false); in test_private_ro_fast_pin()
434 static void test_shared_iouring(int fd, size_t size) in test_shared_iouring() argument
436 do_test(fd, size, TEST_TYPE_IOURING, true); in test_shared_iouring()
439 static void test_private_iouring(int fd, size_t size) in test_private_iouring() argument
441 do_test(fd, size, TEST_TYPE_IOURING, false); in test_private_iouring()