/linux/tools/testing/selftests/memfd/ |
H A D | memfd_test.c | 49 static ssize_t fd2name(int fd, char *buf, size_t bufsize) in fd2name() argument 55 size = snprintf(buf1, PATH_MAX, "/proc/self/fd/%d", fd); in fd2name() 57 printf("snprintf(%d) failed on %m\n", fd); in fd2name() 75 int r, fd; in mfd_assert_new() local 77 fd = sys_memfd_create(name, flags); in mfd_assert_new() 78 if (fd < 0) { in mfd_assert_new() 84 r = ftruncate(fd, sz); in mfd_assert_new() 90 return fd; in mfd_assert_new() 95 int fd in sysctl_assert_write() local 110 int fd = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC); sysctl_fail_write() local 127 int fd = open("/proc/sys/vm/memfd_noexec", O_RDONLY | O_CLOEXEC); sysctl_assert_equal() local 153 int fd; mfd_assert_reopen_fd() local 180 mfd_assert_get_seals(int fd) mfd_assert_get_seals() argument 193 mfd_assert_has_seals(int fd,unsigned int seals) mfd_assert_has_seals() argument 206 mfd_assert_add_seals(int fd,unsigned int seals) mfd_assert_add_seals() argument 219 mfd_fail_add_seals(int fd,unsigned int seals) mfd_fail_add_seals() argument 238 mfd_assert_size(int fd,size_t size) mfd_assert_size() argument 254 mfd_assert_dup(int fd) mfd_assert_dup() argument 267 mfd_assert_mmap_shared(int fd) mfd_assert_mmap_shared() argument 285 mfd_assert_mmap_read_shared(int fd) mfd_assert_mmap_read_shared() argument 303 mfd_assert_mmap_private(int fd) mfd_assert_mmap_private() argument 321 mfd_assert_open(int fd,int flags,mode_t mode) mfd_assert_open() argument 336 mfd_fail_open(int fd,int flags,mode_t mode) mfd_fail_open() argument 349 mfd_assert_read(int fd) mfd_assert_read() argument 389 mfd_assert_read_shared(int fd) mfd_assert_read_shared() argument 407 mfd_assert_fork_private_write(int fd) mfd_assert_fork_private_write() argument 441 mfd_assert_write(int fd) mfd_assert_write() argument 521 mfd_fail_write(int fd) mfd_fail_write() argument 586 mfd_assert_shrink(int fd) mfd_assert_shrink() argument 606 mfd_fail_shrink(int fd) mfd_fail_shrink() argument 621 mfd_assert_grow(int fd) mfd_assert_grow() argument 645 mfd_fail_grow(int fd) mfd_fail_grow() argument 665 mfd_assert_grow_write(int fd) mfd_assert_grow_write() argument 689 mfd_fail_grow_write(int fd) mfd_fail_grow_write() argument 711 mfd_assert_mode(int fd,int mode) mfd_assert_mode() argument 730 mfd_assert_chmod(int fd,int mode) mfd_assert_chmod() argument 744 mfd_fail_chmod(int fd,int mode) mfd_fail_chmod() argument 840 int fd; test_create() local 889 int fd; test_basic() local 941 int fd; test_seal_write() local 967 int fd, fd2; test_seal_future_write() local 1003 int fd; test_seal_write_map_read_shared() local 1031 int fd; test_seal_shrink() local 1057 int fd; test_seal_grow() local 1083 int fd; test_seal_resize() local 1110 int fd; test_exec_seal() local 1160 int fd; test_exec_no_seal() local 1179 int fd; test_noexec_seal() local 1204 int fd; test_sysctl_sysctl0() local 1225 int fd; test_sysctl_sysctl1() local 1262 int fd; test_sysctl_sysctl2() local 1460 int fd, fd2; test_share_dup() local 1501 int fd; test_share_mmap() local 1536 int fd, fd2; test_share_open() local 1578 int fd; test_share_fork() local [all...] |
/linux/include/linux/ |
H A D | file.h | 3 * Wrapper functions for accessing the file_struct fd array. 38 struct fd { struct 45 static inline bool fd_empty(struct fd f) in fd_empty() argument 50 #define EMPTY_FD (struct fd){0} 51 static inline struct fd BORROWED_FD(struct file *f) in BORROWED_FD() 53 return (struct fd){(unsigned long)f}; in BORROWED_FD() 55 static inline struct fd CLONED_FD(struct file *f) in CLONED_FD() 57 return (struct fd){(unsigned long)f | FDPUT_FPUT}; in CLONED_FD() 60 static inline void fdput(struct fd fd) in fdput() argument 117 take_fd(fd) global() argument [all...] |
/linux/tools/testing/vsock/ |
H A D | vsock_test.c | 51 int fd; in test_stream_connection_reset() local 53 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_connection_reset() 57 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_connection_reset() 71 close(fd); in test_stream_connection_reset() 87 int fd; in test_stream_bind_only_client() local 92 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_bind_only_client() 96 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_bind_only_client() 113 close(fd); in test_stream_bind_only_client() 118 int fd; in test_stream_bind_only_server() local 120 fd in test_stream_bind_only_server() 133 int fd; test_stream_client_close_client() local 147 int fd; test_stream_client_close_server() local 168 int fd; test_stream_server_close_client() local 189 int fd; test_stream_server_close_server() local 260 int fd; test_msg_peek_client() local 289 int fd; test_msg_peek_server() local 358 int fd; test_seqpacket_msg_bounds_client() local 427 int fd; test_seqpacket_msg_bounds_server() local 495 int fd; test_seqpacket_msg_trunc_client() local 512 int fd; test_seqpacket_msg_trunc_server() local 562 int fd; test_seqpacket_timeout_client() local 609 int fd; test_seqpacket_timeout_server() local 627 int fd; test_seqpacket_bigmsg_client() local 668 int fd; test_seqpacket_bigmsg_server() local 686 int fd; test_seqpacket_invalid_rec_buffer_client() local 721 int fd; test_seqpacket_invalid_rec_buffer_server() local 804 int fd; test_stream_poll_rcvlowat_server() local 836 int fd; test_stream_poll_rcvlowat_client() local 899 int fd; test_inv_buf_client() local 934 int fd; test_inv_buf_server() local 980 int fd; test_stream_virtio_skb_merge_client() local 1009 int fd; test_stream_virtio_skb_merge_server() local 1065 test_stream_check_sigpipe(int fd) test_stream_check_sigpipe() argument 1126 int fd; test_stream_shutwr_client() local 1154 int fd; test_stream_shutwr_server() local 1169 int fd; test_stream_shutrd_client() local 1194 int fd; test_stream_shutrd_server() local 1285 int fd; test_unsent_bytes_client() local 1334 int fd; test_unread_bytes_client() local 1411 int fd; test_stream_rcvlowat_def_cred_upd_client() local 1448 int fd; test_stream_credit_update_test() local 1577 int fd; test_stream_leak_acceptq_client() local 1594 int fd; test_stream_leak_acceptq_server() local 1607 int fd; test_stream_msgzcopy_leak_errq_client() local 1630 int fd; test_stream_msgzcopy_leak_errq_server() local 1719 int fd, res; test_stream_msgzcopy_leak_zcskb_client() local 1778 int fd; test_stream_msgzcopy_leak_zcskb_server() local 1797 int fd, i, c; test_stream_transport_uaf() local 1901 int fd; test_stream_connect_retry_client() local 1927 int fd; test_stream_connect_retry_server() local 2117 int fd; test_stream_linger_client() local 2131 int fd; test_stream_linger_server() local 2150 int fd; test_stream_nolinger_client() local 2178 int fd; test_stream_nolinger_server() local [all...] |
/linux/tools/testing/selftests/filesystems/eventfd/ |
H A D | eventfd_test.c | 47 int fd, flags; in TEST() local 49 fd = sys_eventfd2(0, 0); in TEST() 50 ASSERT_GE(fd, 0); in TEST() 52 flags = fcntl(fd, F_GETFL); in TEST() 56 close(fd); in TEST() 61 int fd, flags; in TEST() local 63 fd = sys_eventfd2(0, EFD_CLOEXEC); in TEST() 64 ASSERT_GE(fd, 0); in TEST() 66 flags = fcntl(fd, F_GETFD); in TEST() 70 close(fd); in TEST() 75 int fd, flags; TEST() local 90 int fd, flags; TEST() local 115 verify_fdinfo(int fd,struct error * err,const char * prefix,size_t prefix_len,const char * expect,...) verify_fdinfo() argument 169 int fd, ret; TEST() local 196 int fd; TEST() local 224 int fd; TEST() local 252 int fd; TEST() local 286 int fd; TEST() local [all...] |
/linux/fs/hfs/ |
H A D | bfind.c | 15 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument 19 if (!tree || !fd) in hfs_find_init() 22 fd->tree = tree; in hfs_find_init() 23 fd->bnode = NULL; in hfs_find_init() 27 fd->search_key = ptr; in hfs_find_init() 28 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init() 47 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument 49 hfs_bnode_put(fd->bnode); in hfs_find_exit() 50 kfree(fd->search_key); in hfs_find_exit() 52 fd in hfs_find_exit() 58 __hfs_brec_find(struct hfs_bnode * bnode,struct hfs_find_data * fd) __hfs_brec_find() argument 110 hfs_brec_find(struct hfs_find_data * fd) hfs_brec_find() argument 164 hfs_brec_read(struct hfs_find_data * fd,void * rec,int rec_len) hfs_brec_read() argument 177 hfs_brec_goto(struct hfs_find_data * fd,int cnt) hfs_brec_goto() argument [all...] |
/linux/fs/hfsplus/ |
H A D | bfind.c | 15 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument 19 fd->tree = tree; in hfs_find_init() 20 fd->bnode = NULL; in hfs_find_init() 24 fd->search_key = ptr; in hfs_find_init() 25 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init() 33 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument 35 hfs_bnode_put(fd->bnode); in hfs_find_exit() 36 kfree(fd->search_key); in hfs_find_exit() 38 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit() 39 mutex_unlock(&fd in hfs_find_exit() 44 hfs_find_1st_rec_by_cnid(struct hfs_bnode * bnode,struct hfs_find_data * fd,int * begin,int * end,int * cur_rec) hfs_find_1st_rec_by_cnid() argument 82 hfs_find_rec_by_key(struct hfs_bnode * bnode,struct hfs_find_data * fd,int * begin,int * end,int * cur_rec) hfs_find_rec_by_key() argument 103 __hfs_brec_find(struct hfs_bnode * bnode,struct hfs_find_data * fd,search_strategy_t rec_found) __hfs_brec_find() argument 153 hfs_brec_find(struct hfs_find_data * fd,search_strategy_t do_key_compare) hfs_brec_find() argument 207 hfs_brec_read(struct hfs_find_data * fd,void * rec,int rec_len) hfs_brec_read() argument 220 hfs_brec_goto(struct hfs_find_data * fd,int cnt) hfs_brec_goto() argument [all...] |
/linux/tools/perf/tests/ |
H A D | wp.c | 16 #define WP_TEST_ASSERT_VAL(fd, text, val) \ argument 19 wp_read(fd, &count, sizeof(long long)); \ 32 static int wp_read(int fd, long long *count, int size) in wp_read() argument 34 int ret = read(fd, count, size); in wp_read() 61 int fd; in __event() local 65 fd = sys_perf_event_open(&attr, 0, -1, -1, in __event() 67 if (fd < 0) { in __event() 68 fd = -errno; in __event() 72 return fd; in __event() 82 int fd; in test__wp_ro() [all...] |
/linux/drivers/scsi/ |
H A D | fdomain.c | 123 static inline void fdomain_make_bus_idle(struct fdomain *fd) in fdomain_make_bus_idle() argument 125 outb(0, fd->base + REG_BCTL); in fdomain_make_bus_idle() 126 outb(0, fd->base + REG_MCTL); in fdomain_make_bus_idle() 127 if (fd->chip == tmc18c50 || fd->chip == tmc18c30) in fdomain_make_bus_idle() 130 fd->base + REG_ACTL); in fdomain_make_bus_idle() 132 outb(ACTL_RESET | PARITY_MASK, fd->base + REG_ACTL); in fdomain_make_bus_idle() 186 struct fdomain *fd = shost_priv(sh); in fdomain_select() local 188 outb(BCTL_BUSEN | BCTL_SEL, fd->base + REG_BCTL); in fdomain_select() 189 outb(BIT(sh->this_id) | BIT(target), fd in fdomain_select() 210 fdomain_finish_cmd(struct fdomain * fd) fdomain_finish_cmd() argument 220 struct fdomain *fd = shost_priv(cmd->device->host); fdomain_read_data() local 240 struct fdomain *fd = shost_priv(cmd->device->host); fdomain_write_data() local 267 struct fdomain *fd = container_of(work, struct fdomain, work); fdomain_work() local 388 struct fdomain *fd = dev_id; fdomain_irq() local 408 struct fdomain *fd = shost_priv(cmd->device->host); fdomain_queue() local 441 struct fdomain *fd = shost_priv(sh); fdomain_abort() local 462 struct fdomain *fd = shost_priv(sh); fdomain_host_reset() local 518 struct fdomain *fd; fdomain_create() local 582 struct fdomain *fd = shost_priv(sh); fdomain_destroy() local 596 struct fdomain *fd = shost_priv(dev_get_drvdata(dev)); fdomain_resume() local [all...] |
/linux/tools/testing/selftests/wireguard/qemu/ |
H A D | init.c | 61 int bits = 256, fd; in seed_rng() local 66 fd = open("/dev/random", O_WRONLY); in seed_rng() 67 if (fd < 0) in seed_rng() 69 if (ioctl(fd, RNDADDTOENTCNT, &bits) < 0) in seed_rng() 71 close(fd); in seed_rng() 106 if (symlink("/proc/self/fd", "/dev/fd")) in mount_filesystems() 107 panic("fd symlink"); in mount_filesystems() 112 int fd; in enable_logging() local 114 fd in enable_logging() 164 int status, fd; launch_tests() local 219 int fd = open("/dev/console", O_RDWR); ensure_console() local 236 int fd; clear_leaks() local 248 int fd; check_leaks() local [all...] |
/linux/scripts/ipe/polgen/ |
H A D | polgen.c | 24 FILE *fd; in policy_to_buffer() local 26 fd = fopen(pathname, "r"); in policy_to_buffer() 27 if (!fd) { in policy_to_buffer() 32 fseek(fd, 0, SEEK_END); in policy_to_buffer() 33 fsize = ftell(fd); in policy_to_buffer() 34 rewind(fd); in policy_to_buffer() 42 read = fread((void *)lbuf, sizeof(*lbuf), fsize, fd); in policy_to_buffer() 50 fclose(fd); in policy_to_buffer() 57 fclose(fd); in policy_to_buffer() 64 FILE *fd; in write_boot_policy() local [all...] |
/linux/tools/testing/selftests/bpf/ |
H A D | test_maps.c | 36 int fd; in test_hashmap() local 38 fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(key), sizeof(value), 2, &map_opts); in test_hashmap() 39 if (fd < 0) { in test_hashmap() 47 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 51 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() 56 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 && in test_hashmap() 60 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() 65 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 68 assert(bpf_map_lookup_and_delete_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() 71 assert(bpf_map_lookup_elem(fd, in test_hashmap() 131 int fd, i, j; test_hashmap_sizes() local 154 int fd, i; test_hashmap_percpu() local 266 int i, fd, ret; helper_fill_hashmap() local 288 int fd, i, max_entries = 10000; test_hashmap_walk() local 359 int key, next_key, fd; test_arraymap() local 415 int key, next_key, fd, i; test_arraymap_percpu() local 478 int key, fd, i; test_arraymap_percpu_many_keys() local 509 int fd; test_devmap() local 523 int fd; test_devmap_hash() local 539 int fd, i; test_queuemap() local 595 int fd, i; test_stackmap() local 660 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; test_sockmap() local 1152 int mim_fd, fd, err; test_map_in_map() local 1312 int fd, i, value; test_map_large() local 1445 int fd = ((int *)data)[0]; test_update_delete() local 1475 int i, fd, key = 0, value = 0, j = 0; test_map_parallel() local 1533 int fd, key = 0, value = 0; test_map_rdonly() local 1562 int fd, key = 0, value = 0; test_map_wronly_hash() local 1590 int fd, value = 0; test_map_wronly_stack_or_queue() local 1726 int fd; test_reuseport_array() local [all...] |
/linux/tools/testing/selftests/net/ |
H A D | ipv6_flowlabel_mgr.c | 48 static int flowlabel_get(int fd, uint32_t label, uint8_t share, uint16_t flags) in flowlabel_get() argument 61 return setsockopt(fd, SOL_IPV6, IPV6_FLOWLABEL_MGR, &req, sizeof(req)); in flowlabel_get() 64 static int flowlabel_put(int fd, uint32_t label) in flowlabel_put() argument 71 return setsockopt(fd, SOL_IPV6, IPV6_FLOWLABEL_MGR, &req, sizeof(req)); in flowlabel_put() 74 static void run_tests(int fd) in run_tests() argument 80 expect_fail(flowlabel_get(fd, 1, IPV6_FL_S_ANY, 0)); in run_tests() 83 expect_fail(flowlabel_put(fd, 1)); in run_tests() 86 expect_fail(flowlabel_get(fd, 0x1FFFFF, IPV6_FL_S_ANY, in run_tests() 90 expect_pass(flowlabel_get(fd, 1, IPV6_FL_S_ANY, IPV6_FL_F_CREATE)); in run_tests() 92 expect_pass(flowlabel_get(fd, in run_tests() 185 int fd; main() local [all...] |
H A D | reuseaddr_ports_exhausted.c | 58 int fd, ret; in bind_port() local 60 fd = socket(AF_INET, SOCK_STREAM, 0); in bind_port() 61 ASSERT_NE(-1, fd) TH_LOG("failed to open socket."); in bind_port() 63 ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(int)); in bind_port() 66 ret = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &reuseport, sizeof(int)); in bind_port() 73 if (bind(fd, (struct sockaddr *)&local_addr, len) == -1) { in bind_port() 74 close(fd); in bind_port() 78 return fd; in bind_port() 84 int i, j, fd[2]; in TEST() local 90 fd[ in TEST() 104 int i, j, fd[2]; TEST() local 129 int i, j, ret, fd[2]; TEST() local [all...] |
/linux/fs/ |
H A D | file.c | 7 * Manage the dynamic fd arrays in the process files_struct. 105 kvfree(fdt->fd); in __free_fdtable() 120 * Copy 'count' fd bits from the old table to the new table and clear the extra 149 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable() 150 memset((char *)nfdt->fd + cpy, 0, set); in copy_fdtable() 179 * 256 slots (i.e. 1Kb fd array). in alloc_fdtable() 180 * 3. on 64bit don't skip anything, 1Kb fd array means 128 slots there in alloc_fdtable() 222 fdt->fd = data; in alloc_fdtable() 238 kvfree(fdt->fd); in alloc_fdtable() 322 __set_close_on_exec(unsigned int fd,struct fdtable * fdt,bool set) __set_close_on_exec() argument 333 __set_open_fd(unsigned int fd,struct fdtable * fdt,bool set) __set_open_fd() argument 342 __clear_open_fd(unsigned int fd,struct fdtable * fdt) __clear_open_fd() argument 350 fd_is_open(unsigned int fd,const struct fdtable * fdt) fd_is_open() argument 573 unsigned int fd; alloc_fd() local 626 __put_unused_fd(struct files_struct * files,unsigned int fd) __put_unused_fd() argument 634 put_unused_fd(unsigned int fd) put_unused_fd() argument 652 fd_install(unsigned int fd,struct file * file) fd_install() argument 692 file_close_fd_locked(struct files_struct * files,unsigned fd) file_close_fd_locked() argument 711 close_fd(unsigned fd) close_fd() argument 740 __range_cloexec(struct files_struct * cur_fds,unsigned int fd,unsigned int max_fd) __range_cloexec() argument 753 __range_close(struct files_struct * files,unsigned int fd,unsigned int max_fd) __range_close() argument 790 SYSCALL_DEFINE3(close_range,unsigned int,fd,unsigned int,max_fd,unsigned int,flags) SYSCALL_DEFINE3() argument 850 file_close_fd(unsigned int fd) file_close_fd() argument 871 unsigned fd = i * BITS_PER_LONG; do_close_on_exec() local 990 __fget_files_rcu(struct files_struct * files,unsigned int fd,fmode_t mask) __fget_files_rcu() argument 1065 __fget_files(struct files_struct * files,unsigned int fd,fmode_t mask) __fget_files() argument 1077 __fget(unsigned int fd,fmode_t mask) __fget() argument 1082 fget(unsigned int fd) fget() argument 1088 fget_raw(unsigned int fd) fget_raw() argument 1094 fget_task(struct task_struct * task,unsigned int fd) fget_task() argument 1110 unsigned int fd = *ret_fd; fget_task_next() local 1153 __fget_light(unsigned int fd,fmode_t mask) __fget_light() argument 1179 fdget(unsigned int fd) fdget() argument 1185 fdget_raw(unsigned int fd) fdget_raw() argument 1225 fdget_pos(unsigned int fd) fdget_pos() argument 1248 set_close_on_exec(unsigned int fd,int flag) set_close_on_exec() argument 1256 get_close_on_exec(unsigned int fd) get_close_on_exec() argument 1266 do_dup2(struct files_struct * files,struct file * file,unsigned fd,unsigned flags) do_dup2() argument 1318 replace_fd(unsigned fd,struct file * file,unsigned flags) replace_fd() argument [all...] |
/linux/fs/jffs2/ |
H A D | build.c | 56 struct jffs2_full_dirent *fd; in jffs2_build_inode_pass1() local 61 for(fd = ic->scan_dents; fd; fd = fd->next) { in jffs2_build_inode_pass1() 63 if (!fd->ino) in jffs2_build_inode_pass1() 68 child_ic = jffs2_get_ino_cache(c, fd->ino); in jffs2_build_inode_pass1() 71 fd->name, fd->ino, ic->ino); in jffs2_build_inode_pass1() 72 jffs2_mark_node_obsolete(c, fd in jffs2_build_inode_pass1() 103 struct jffs2_full_dirent *fd; jffs2_build_filesystem() local 247 struct jffs2_full_dirent *fd; jffs2_build_remove_unlinked_inode() local [all...] |
/linux/tools/testing/selftests/mm/ |
H A D | gup_longterm.c | 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 322 int fd; run_with_tmpfile() local 346 int fd; run_with_local_tmpfile() local 370 int fd; run_with_memfd_hugetlb() local 393 test_shared_rw_pin(int fd,size_t size) test_shared_rw_pin() argument 398 test_shared_rw_fast_pin(int fd,size_t size) test_shared_rw_fast_pin() argument 403 test_shared_ro_pin(int fd,size_t size) test_shared_ro_pin() argument 408 test_shared_ro_fast_pin(int fd,size_t size) test_shared_ro_fast_pin() argument 413 test_private_rw_pin(int fd,size_t size) test_private_rw_pin() argument 418 test_private_rw_fast_pin(int fd,size_t size) test_private_rw_fast_pin() argument 423 test_private_ro_pin(int fd,size_t size) test_private_ro_pin() argument 428 test_private_ro_fast_pin(int fd,size_t size) test_private_ro_fast_pin() argument 434 test_shared_iouring(int fd,size_t size) test_shared_iouring() argument 439 test_private_iouring(int fd,size_t size) test_private_iouring() argument [all...] |
/linux/drivers/clk/ |
H A D | clk-fractional-divider_test.c | 11 * Test the maximum denominator case for fd clock without flags. 18 struct clk_fractional_divider *fd; in clk_fd_test_approximation_max_denominator() local 21 fd = kunit_kzalloc(test, sizeof(*fd), GFP_KERNEL); in clk_fd_test_approximation_max_denominator() 22 KUNIT_ASSERT_NOT_NULL(test, fd); in clk_fd_test_approximation_max_denominator() 24 fd->mwidth = 3; in clk_fd_test_approximation_max_denominator() 25 fd->nwidth = 3; in clk_fd_test_approximation_max_denominator() 32 clk_fractional_divider_general_approximation(&fd->hw, rate, &parent_rate, &m, &n); in clk_fd_test_approximation_max_denominator() 40 * Test the maximum numerator case for fd clock without flags. 47 struct clk_fractional_divider *fd; in clk_fd_test_approximation_max_numerator() local 76 struct clk_fractional_divider *fd; clk_fd_test_approximation_max_denominator_zero_based() local 106 struct clk_fractional_divider *fd; clk_fd_test_approximation_max_numerator_zero_based() local [all...] |
/linux/drivers/clk/ti/ |
H A D | fapll.c | 71 struct fapll_data *fd; member 79 static bool ti_fapll_clock_is_bypass(struct fapll_data *fd) in ti_fapll_clock_is_bypass() argument 81 u32 v = readl_relaxed(fd->base); in ti_fapll_clock_is_bypass() 83 if (fd->bypass_bit_inverted) in ti_fapll_clock_is_bypass() 89 static void ti_fapll_set_bypass(struct fapll_data *fd) in ti_fapll_set_bypass() argument 91 u32 v = readl_relaxed(fd->base); in ti_fapll_set_bypass() 93 if (fd->bypass_bit_inverted) in ti_fapll_set_bypass() 97 writel_relaxed(v, fd->base); in ti_fapll_set_bypass() 100 static void ti_fapll_clear_bypass(struct fapll_data *fd) in ti_fapll_clear_bypass() argument 102 u32 v = readl_relaxed(fd in ti_fapll_clear_bypass() 111 ti_fapll_wait_lock(struct fapll_data * fd) ti_fapll_wait_lock() argument 133 struct fapll_data *fd = to_fapll(hw); ti_fapll_enable() local 145 struct fapll_data *fd = to_fapll(hw); ti_fapll_disable() local 154 struct fapll_data *fd = to_fapll(hw); ti_fapll_is_enabled() local 163 struct fapll_data *fd = to_fapll(hw); ti_fapll_recalc_rate() local 186 struct fapll_data *fd = to_fapll(hw); ti_fapll_get_parent() local 240 struct fapll_data *fd = to_fapll(hw); ti_fapll_set_rate() local 406 struct fapll_data *fd = synth->fd; ti_fapll_synth_round_rate() local 440 struct fapll_data *fd = synth->fd; ti_fapll_synth_set_rate() local 484 ti_fapll_synth_setup(struct fapll_data * fd,void __iomem * freq,void __iomem * div,int index,const char * name,const char * parent,struct clk * pll_clk) ti_fapll_synth_setup() argument 534 struct fapll_data *fd; ti_fapll_setup() local [all...] |
/linux/drivers/infiniband/hw/hfi1/ |
H A D | user_exp_rcv.c | 15 struct hfi1_filedata *fd); 17 static int set_rcvarray_entry(struct hfi1_filedata *fd, 29 static int program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *, 33 static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo); 34 static void __clear_tid_node(struct hfi1_filedata *fd, 36 static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); 50 int hfi1_user_exp_rcv_init(struct hfi1_filedata *fd, in hfi1_user_exp_rcv_init() argument 55 fd->entry_to_rb = kcalloc(uctxt->expected_count, in hfi1_user_exp_rcv_init() 56 sizeof(*fd->entry_to_rb), in hfi1_user_exp_rcv_init() 58 if (!fd in hfi1_user_exp_rcv_init() 103 hfi1_user_exp_rcv_free(struct hfi1_filedata * fd) hfi1_user_exp_rcv_free() argument 132 unpin_rcv_pages(struct hfi1_filedata * fd,struct tid_user_buf * tidbuf,struct tid_rb_node * node,unsigned int idx,unsigned int npages,bool mapped) unpin_rcv_pages() argument 159 pin_rcv_pages(struct hfi1_filedata * fd,struct tid_user_buf * tidbuf) pin_rcv_pages() argument 246 hfi1_user_exp_rcv_setup(struct hfi1_filedata * fd,struct hfi1_tid_info * tinfo) hfi1_user_exp_rcv_setup() argument 483 hfi1_user_exp_rcv_clear(struct hfi1_filedata * fd,struct hfi1_tid_info * tinfo) hfi1_user_exp_rcv_clear() argument 518 hfi1_user_exp_rcv_invalid(struct hfi1_filedata * fd,struct hfi1_tid_info * tinfo) hfi1_user_exp_rcv_invalid() argument 656 program_rcvarray(struct hfi1_filedata * fd,struct tid_user_buf * tbuf,struct tid_group * grp,u16 count,u32 * tidlist,unsigned int * tididx,unsigned int * pmapped) program_rcvarray() argument 723 set_rcvarray_entry(struct hfi1_filedata * fd,struct tid_user_buf * tbuf,u32 rcventry,struct tid_group * grp,u16 pageidx,unsigned int npages) set_rcvarray_entry() argument 788 unprogram_rcvarray(struct hfi1_filedata * fd,u32 tidinfo) unprogram_rcvarray() argument 818 __clear_tid_node(struct hfi1_filedata * fd,struct tid_rb_node * node) __clear_tid_node() argument 841 clear_tid_node(struct hfi1_filedata * fd,struct tid_rb_node * node) clear_tid_node() argument 865 unlock_exp_tids(struct hfi1_ctxtdata * uctxt,struct exp_tid_set * set,struct hfi1_filedata * fd) unlock_exp_tids() argument [all...] |
/linux/tools/testing/selftests/efivarfs/ |
H A D | open-unlink.c | 16 int fd; in set_immutable() local 20 fd = open(path, O_RDONLY); in set_immutable() 21 if (fd < 0) in set_immutable() 22 return fd; in set_immutable() 24 rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); in set_immutable() 27 close(fd); in set_immutable() 37 rc = ioctl(fd, FS_IOC_SETFLAGS, &flags); in set_immutable() 39 close(fd); in set_immutable() 47 int fd; in get_immutable() local 51 fd in get_immutable() 72 int fd, rc; main() local [all...] |
/linux/tools/testing/selftests/kvm/ |
H A D | guest_memfd_test.c | 23 static void test_file_read_write(int fd) in test_file_read_write() argument 27 TEST_ASSERT(read(fd, buf, sizeof(buf)) < 0, in test_file_read_write() 28 "read on a guest_mem fd should fail"); in test_file_read_write() 29 TEST_ASSERT(write(fd, buf, sizeof(buf)) < 0, in test_file_read_write() 30 "write on a guest_mem fd should fail"); in test_file_read_write() 31 TEST_ASSERT(pread(fd, buf, sizeof(buf), 0) < 0, in test_file_read_write() 32 "pread on a guest_mem fd should fail"); in test_file_read_write() 33 TEST_ASSERT(pwrite(fd, buf, sizeof(buf), 0) < 0, in test_file_read_write() 34 "pwrite on a guest_mem fd should fail"); in test_file_read_write() 37 static void test_mmap(int fd, size_ argument 45 test_file_size(int fd,size_t page_size,size_t total_size) test_file_size() argument 56 test_fallocate(int fd,size_t page_size,size_t total_size) test_fallocate() argument 93 test_invalid_punch_hole(int fd,size_t page_size,size_t total_size) test_invalid_punch_hole() argument 128 int fd; test_create_guest_memfd_invalid() local 177 int fd; main() local [all...] |
/linux/tools/testing/selftests/rtc/ |
H A D | rtctest.c | 36 int fd; in FIXTURE() local 40 self->fd = open(rtc_file, O_RDONLY); in FIXTURE_SETUP() 44 close(self->fd); in FIXTURE_TEARDOWN() 51 if (self->fd == -1 && errno == ENOENT) in TEST_F() 53 ASSERT_NE(-1, self->fd); in TEST_F() 56 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); in TEST_F() 92 static enum rtc_alarm_state get_rtc_alarm_state(int fd, int need_seconds) in get_rtc_alarm_state() argument 100 rc = ioctl(fd, RTC_PARAM_GET, ¶m); in get_rtc_alarm_state() 120 if (self->fd == -1 && errno == ENOENT) 122 ASSERT_NE(-1, self->fd); [all...] |
/linux/samples/timers/ |
H A D | hpet_example.c | 82 int fd; in hpet_open_close() local 89 fd = open(argv[0], O_RDONLY); in hpet_open_close() 90 if (fd < 0) in hpet_open_close() 93 close(fd); in hpet_open_close() 102 int fd; in hpet_info() local 109 fd = open(argv[0], O_RDONLY); in hpet_info() 110 if (fd < 0) { in hpet_info() 115 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_info() 126 close(fd); in hpet_info() 134 int iterations, i, fd; in hpet_poll() local 226 int iterations, i, fd, value; hpet_fasync() local [all...] |
/linux/tools/testing/selftests/thermal/intel/workload_hint/ |
H A D | workload_hint_test.c | 29 int fd; in workload_hint_exit() local 33 fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR); in workload_hint_exit() 34 if (fd < 0) { in workload_hint_exit() 39 if (write(fd, "0\n", 2) < 0) { in workload_hint_exit() 46 close(fd); in workload_hint_exit() 53 int fd, ret, index; in main() local 71 fd = open(WORKLOAD_NOTIFICATION_DELAY_ATTRIBUTE, O_RDWR); in main() 72 if (fd < 0) { in main() 77 if (write(fd, delay_str, strlen(delay_str)) < 0) { in main() 82 close(fd); in main() [all...] |
/linux/tools/perf/tests/shell/attr/ |
H A D | test-stat-detailed-3 | 9 fd=1 15 fd=2 21 fd=3 27 fd=4 33 fd=5 40 fd=6 47 fd=7 54 fd=8 61 fd=9 68 fd [all...] |