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()
98 if (ftruncate(fd, size)) { in do_test()
103 if (fallocate(fd, 0, 0, size)) { in do_test()
112 shared ? MAP_SHARED : MAP_PRIVATE, fd, 0); in do_test()
242 typedef void (*test_fn)(int fd, size_t size);
246 int fd; in run_with_memfd() local
250 fd = memfd_create("test", 0); in run_with_memfd()
251 if (fd < 0) { in run_with_memfd()
256 fn(fd, pagesize); in run_with_memfd()
257 close(fd); in run_with_memfd()
263 int fd; in run_with_tmpfile() local
273 fd = fileno(file); in run_with_tmpfile()
274 if (fd < 0) { in run_with_tmpfile()
279 fn(fd, pagesize); in run_with_tmpfile()
287 int fd; in run_with_local_tmpfile() local
291 fd = mkstemp(filename); in run_with_local_tmpfile()
292 if (fd < 0) { in run_with_local_tmpfile()
302 fn(fd, pagesize); in run_with_local_tmpfile()
304 close(fd); in run_with_local_tmpfile()
311 int fd; in run_with_memfd_hugetlb() local
318 fd = memfd_create("test", flags); in run_with_memfd_hugetlb()
319 if (fd < 0) { in run_with_memfd_hugetlb()
324 fn(fd, hugetlbsize); in run_with_memfd_hugetlb()
325 close(fd); in run_with_memfd_hugetlb()
333 static void test_shared_rw_pin(int fd, size_t size) in test_shared_rw_pin() argument
335 do_test(fd, size, TEST_TYPE_RW, true); in test_shared_rw_pin()
338 static void test_shared_rw_fast_pin(int fd, size_t size) in test_shared_rw_fast_pin() argument
340 do_test(fd, size, TEST_TYPE_RW_FAST, true); in test_shared_rw_fast_pin()
343 static void test_shared_ro_pin(int fd, size_t size) in test_shared_ro_pin() argument
345 do_test(fd, size, TEST_TYPE_RO, true); in test_shared_ro_pin()
348 static void test_shared_ro_fast_pin(int fd, size_t size) in test_shared_ro_fast_pin() argument
350 do_test(fd, size, TEST_TYPE_RO_FAST, true); in test_shared_ro_fast_pin()
353 static void test_private_rw_pin(int fd, size_t size) in test_private_rw_pin() argument
355 do_test(fd, size, TEST_TYPE_RW, false); in test_private_rw_pin()
358 static void test_private_rw_fast_pin(int fd, size_t size) in test_private_rw_fast_pin() argument
360 do_test(fd, size, TEST_TYPE_RW_FAST, false); in test_private_rw_fast_pin()
363 static void test_private_ro_pin(int fd, size_t size) in test_private_ro_pin() argument
365 do_test(fd, size, TEST_TYPE_RO, false); in test_private_ro_pin()
368 static void test_private_ro_fast_pin(int fd, size_t size) in test_private_ro_fast_pin() argument
370 do_test(fd, size, TEST_TYPE_RO_FAST, false); in test_private_ro_fast_pin()
374 static void test_shared_iouring(int fd, size_t size) in test_shared_iouring() argument
376 do_test(fd, size, TEST_TYPE_IOURING, true); in test_shared_iouring()
379 static void test_private_iouring(int fd, size_t size) in test_private_iouring() argument
381 do_test(fd, size, TEST_TYPE_IOURING, false); in test_private_iouring()