/Linux-v5.4/tools/testing/selftests/memfd/ |
D | memfd_test.c | 39 int r, fd; in mfd_assert_new() local 41 fd = sys_memfd_create(name, flags); in mfd_assert_new() 42 if (fd < 0) { in mfd_assert_new() 48 r = ftruncate(fd, sz); in mfd_assert_new() 54 return fd; in mfd_assert_new() 59 int r, fd; in mfd_assert_reopen_fd() local 64 fd = open(path, O_RDWR); in mfd_assert_reopen_fd() 65 if (fd < 0) { in mfd_assert_reopen_fd() 70 return fd; in mfd_assert_reopen_fd() 86 static unsigned int mfd_assert_get_seals(int fd) in mfd_assert_get_seals() argument [all …]
|
D | fuse_test.c | 45 int r, fd; in mfd_assert_new() local 47 fd = sys_memfd_create(name, flags); in mfd_assert_new() 48 if (fd < 0) { in mfd_assert_new() 54 r = ftruncate(fd, sz); in mfd_assert_new() 60 return fd; in mfd_assert_new() 63 static __u64 mfd_assert_get_seals(int fd) in mfd_assert_get_seals() argument 67 r = fcntl(fd, F_GET_SEALS); in mfd_assert_get_seals() 69 printf("GET_SEALS(%d) failed: %m\n", fd); in mfd_assert_get_seals() 76 static void mfd_assert_has_seals(int fd, __u64 seals) in mfd_assert_has_seals() argument 80 s = mfd_assert_get_seals(fd); in mfd_assert_has_seals() [all …]
|
/Linux-v5.4/drivers/clk/ |
D | clk-fractional-divider.c | 17 static inline u32 clk_fd_readl(struct clk_fractional_divider *fd) in clk_fd_readl() argument 19 if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN) in clk_fd_readl() 20 return ioread32be(fd->reg); in clk_fd_readl() 22 return readl(fd->reg); in clk_fd_readl() 25 static inline void clk_fd_writel(struct clk_fractional_divider *fd, u32 val) in clk_fd_writel() argument 27 if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN) in clk_fd_writel() 28 iowrite32be(val, fd->reg); in clk_fd_writel() 30 writel(val, fd->reg); in clk_fd_writel() 36 struct clk_fractional_divider *fd = to_clk_fd(hw); in clk_fd_recalc_rate() local 42 if (fd->lock) in clk_fd_recalc_rate() [all …]
|
/Linux-v5.4/fs/hfsplus/ |
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() 44 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument 46 hfs_bnode_put(fd->bnode); in hfs_find_exit() 47 kfree(fd->search_key); in hfs_find_exit() 49 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit() 50 mutex_unlock(&fd->tree->tree_lock); in hfs_find_exit() [all …]
|
D | brec.c | 15 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd); 16 static int hfs_brec_update_parent(struct hfs_find_data *fd); 63 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) in hfs_brec_insert() argument 72 tree = fd->tree; in hfs_brec_insert() 73 if (!fd->bnode) { in hfs_brec_insert() 79 fd->bnode = node; in hfs_brec_insert() 80 fd->record = -1; in hfs_brec_insert() 83 key_len = be16_to_cpu(fd->search_key->key_len) + 2; in hfs_brec_insert() 86 rec = fd->record + 1; in hfs_brec_insert() 89 node = fd->bnode; in hfs_brec_insert() [all …]
|
/Linux-v5.4/fs/hfs/ |
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() 32 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument 34 hfs_bnode_put(fd->bnode); in hfs_find_exit() 35 kfree(fd->search_key); in hfs_find_exit() 37 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit() 38 mutex_unlock(&fd->tree->tree_lock); in hfs_find_exit() [all …]
|
D | brec.c | 14 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd); 15 static int hfs_brec_update_parent(struct hfs_find_data *fd); 65 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) in hfs_brec_insert() argument 74 tree = fd->tree; in hfs_brec_insert() 75 if (!fd->bnode) { in hfs_brec_insert() 81 fd->bnode = node; in hfs_brec_insert() 82 fd->record = -1; in hfs_brec_insert() 85 key_len = (fd->search_key->key_len | 1) + 1; in hfs_brec_insert() 88 rec = fd->record + 1; in hfs_brec_insert() 91 node = fd->bnode; in hfs_brec_insert() [all …]
|
/Linux-v5.4/include/linux/ |
D | file.h | 34 struct fd { struct 41 static inline void fdput(struct fd fd) in fdput() argument 43 if (fd.flags & FDPUT_FPUT) in fdput() 44 fput(fd.file); in fdput() 47 extern struct file *fget(unsigned int fd); 48 extern struct file *fget_many(unsigned int fd, unsigned int refs); 49 extern struct file *fget_raw(unsigned int fd); 50 extern unsigned long __fdget(unsigned int fd); 51 extern unsigned long __fdget_raw(unsigned int fd); 52 extern unsigned long __fdget_pos(unsigned int fd); [all …]
|
/Linux-v5.4/drivers/scsi/ |
D | fdomain.c | 118 static inline void fdomain_make_bus_idle(struct fdomain *fd) in fdomain_make_bus_idle() argument 120 outb(0, fd->base + REG_BCTL); in fdomain_make_bus_idle() 121 outb(0, fd->base + REG_MCTL); in fdomain_make_bus_idle() 122 if (fd->chip == tmc18c50 || fd->chip == tmc18c30) in fdomain_make_bus_idle() 125 fd->base + REG_ACTL); in fdomain_make_bus_idle() 127 outb(ACTL_RESET | PARITY_MASK, fd->base + REG_ACTL); in fdomain_make_bus_idle() 181 struct fdomain *fd = shost_priv(sh); in fdomain_select() local 183 outb(BCTL_BUSEN | BCTL_SEL, fd->base + REG_BCTL); in fdomain_select() 184 outb(BIT(sh->this_id) | BIT(target), fd->base + REG_SCSI_DATA_NOACK); in fdomain_select() 187 outb(PARITY_MASK, fd->base + REG_ACTL); in fdomain_select() [all …]
|
/Linux-v5.4/tools/perf/tests/ |
D | wp.c | 14 #define WP_TEST_ASSERT_VAL(fd, text, val) \ argument 17 wp_read(fd, &count, sizeof(long long)); \ 24 static int wp_read(int fd, long long *count, int size) in wp_read() argument 26 int ret = read(fd, count, size); in wp_read() 53 int fd; in __event() local 57 fd = sys_perf_event_open(&attr, 0, -1, -1, in __event() 59 if (fd < 0) in __event() 62 return fd; in __event() 67 int fd; in wp_ro_test() local 70 fd = __event(HW_BREAKPOINT_R, (void *)&data1, sizeof(data1)); in wp_ro_test() [all …]
|
D | fdarray.c | 9 int fd; in fdarray__init_revents() local 13 for (fd = 0; fd < fda->nr; ++fd) { in fdarray__init_revents() 14 fda->entries[fd].fd = fda->nr - fd; in fdarray__init_revents() 15 fda->entries[fd].revents = revents; in fdarray__init_revents() 32 int nr_fds, expected_fd[2], fd, err = TEST_FAIL; in test__fdarray__filter() local 58 expected_fd[0] = fda->entries[2].fd; in test__fdarray__filter() 69 if (fda->entries[0].fd != expected_fd[0]) { in test__fdarray__filter() 71 fda->entries[0].fd, expected_fd[0]); in test__fdarray__filter() 77 expected_fd[0] = fda->entries[0].fd; in test__fdarray__filter() 79 expected_fd[1] = fda->entries[3].fd; in test__fdarray__filter() [all …]
|
D | bp_account.c | 35 int fd; in __event() local 52 fd = sys_perf_event_open(attr, -1, 0, -1, in __event() 54 if (fd < 0) { in __event() 59 return fd; in __event() 75 int i, fd[wp_cnt], fd_wp, ret; in bp_accounting() local 78 fd[i] = wp_event((void *)&the_var, &attr); in bp_accounting() 79 TEST_ASSERT_VAL("failed to create wp\n", fd[i] != -1); in bp_accounting() 87 ret = ioctl(fd[0], PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &attr_mod); in bp_accounting() 99 close(fd[i]); in bp_accounting() 108 int fd[100], cnt = 0, i; in detect_cnt() local [all …]
|
/Linux-v5.4/tools/testing/selftests/net/ |
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, 1, IPV6_FL_S_ANY, 0)); in run_tests() [all …]
|
/Linux-v5.4/fs/ |
D | file.c | 31 kvfree(fdt->fd); in __free_fdtable() 79 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable() 80 memset((char *)nfdt->fd + cpy, 0, set); in copy_fdtable() 118 fdt->fd = data; in alloc_fdtable() 134 kvfree(fdt->fd); in alloc_fdtable() 228 static inline void __set_close_on_exec(unsigned int fd, struct fdtable *fdt) in __set_close_on_exec() argument 230 __set_bit(fd, fdt->close_on_exec); in __set_close_on_exec() 233 static inline void __clear_close_on_exec(unsigned int fd, struct fdtable *fdt) in __clear_close_on_exec() argument 235 if (test_bit(fd, fdt->close_on_exec)) in __clear_close_on_exec() 236 __clear_bit(fd, fdt->close_on_exec); in __clear_close_on_exec() [all …]
|
/Linux-v5.4/drivers/clk/ti/ |
D | fapll.c | 78 struct fapll_data *fd; member 86 static bool ti_fapll_clock_is_bypass(struct fapll_data *fd) in ti_fapll_clock_is_bypass() argument 88 u32 v = readl_relaxed(fd->base); in ti_fapll_clock_is_bypass() 90 if (fd->bypass_bit_inverted) in ti_fapll_clock_is_bypass() 96 static void ti_fapll_set_bypass(struct fapll_data *fd) in ti_fapll_set_bypass() argument 98 u32 v = readl_relaxed(fd->base); in ti_fapll_set_bypass() 100 if (fd->bypass_bit_inverted) in ti_fapll_set_bypass() 104 writel_relaxed(v, fd->base); in ti_fapll_set_bypass() 107 static void ti_fapll_clear_bypass(struct fapll_data *fd) in ti_fapll_clear_bypass() argument 109 u32 v = readl_relaxed(fd->base); in ti_fapll_clear_bypass() [all …]
|
/Linux-v5.4/arch/um/os-Linux/ |
D | file.c | 39 int os_stat_fd(const int fd, struct uml_stat *ubuf) in os_stat_fd() argument 44 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd() 84 int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) in os_ioctl_generic() argument 88 err = ioctl(fd, cmd, arg); in os_ioctl_generic() 96 int os_get_ifname(int fd, char* namebuf) in os_get_ifname() argument 98 if (ioctl(fd, SIOCGIFNAME, namebuf) < 0) in os_get_ifname() 104 int os_set_slip(int fd) in os_set_slip() argument 109 if (ioctl(fd, TIOCSETD, &disc) < 0) in os_set_slip() 113 if (ioctl(fd, SIOCSIFENCAP, &sencap) < 0) in os_set_slip() 119 int os_mode_fd(int fd, int mode) in os_mode_fd() argument [all …]
|
D | mem.c | 98 int fd; in make_tempfile() local 110 fd = open(tempdir, O_CLOEXEC | O_RDWR | O_EXCL | O_TMPFILE, 0700); in make_tempfile() 115 if (fd != -1 || (errno != EINVAL && errno != EISDIR && in make_tempfile() 117 return fd; in make_tempfile() 126 fd = mkstemp(tempname); in make_tempfile() 127 if (fd < 0) { in make_tempfile() 137 return fd; in make_tempfile() 139 close(fd); in make_tempfile() 149 int fd, err; in create_tmp_file() local 152 fd = make_tempfile(TEMPNAME_TEMPLATE); in create_tmp_file() [all …]
|
/Linux-v5.4/tools/testing/selftests/bpf/ |
D | test_maps.c | 40 int fd; in test_hashmap() local 42 fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), in test_hashmap() 44 if (fd < 0) { in test_hashmap() 52 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 56 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == -1 && in test_hashmap() 61 assert(bpf_map_update_elem(fd, &key, &value, -1) == -1 && in test_hashmap() 65 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() 69 assert(bpf_map_lookup_elem(fd, &key, &value) == -1 && errno == ENOENT); in test_hashmap() 72 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) == -1 && in test_hashmap() 77 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == 0); in test_hashmap() [all …]
|
/Linux-v5.4/fs/jffs2/ |
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->raw); in jffs2_build_inode_pass1() 74 fd->ic = NULL; in jffs2_build_inode_pass1() 79 fd->ic = child_ic; in jffs2_build_inode_pass1() 83 if (fd->type == DT_DIR) { in jffs2_build_inode_pass1() 89 dbg_fsbuild("increased nlink for child \"%s\" (ino #%u)\n", fd->name, fd->ino); in jffs2_build_inode_pass1() [all …]
|
/Linux-v5.4/tools/testing/selftests/efivarfs/ |
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 = open(path, O_RDONLY); in get_immutable() [all …]
|
/Linux-v5.4/drivers/infiniband/hw/hfi1/ |
D | user_exp_rcv.c | 56 struct hfi1_filedata *fd); 58 static int set_rcvarray_entry(struct hfi1_filedata *fd, 67 static int program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *, 72 static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo, 74 static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); 87 int hfi1_user_exp_rcv_init(struct hfi1_filedata *fd, in hfi1_user_exp_rcv_init() argument 93 spin_lock_init(&fd->tid_lock); in hfi1_user_exp_rcv_init() 94 spin_lock_init(&fd->invalid_lock); in hfi1_user_exp_rcv_init() 96 fd->entry_to_rb = kcalloc(uctxt->expected_count, in hfi1_user_exp_rcv_init() 99 if (!fd->entry_to_rb) in hfi1_user_exp_rcv_init() [all …]
|
/Linux-v5.4/samples/timers/ |
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 [all …]
|
/Linux-v5.4/arch/um/drivers/ |
D | port_kern.c | 24 int fd; member 38 int fd; member 48 int fd; in pipe_interrupt() local 50 fd = os_rcv_fd(conn->socket[0], &conn->helper_pid); in pipe_interrupt() 51 if (fd < 0) { in pipe_interrupt() 52 if (fd == -EAGAIN) in pipe_interrupt() 56 -fd); in pipe_interrupt() 57 os_close_file(conn->fd); in pipe_interrupt() 62 conn->fd = fd; in pipe_interrupt() 79 int fd, socket[2], pid; in port_accept() local [all …]
|
/Linux-v5.4/tools/testing/selftests/sync/ |
D | sync.c | 58 int sync_wait(int fd, int timeout) in sync_wait() argument 62 fds.fd = fd; in sync_wait() 84 static struct sync_file_info *sync_file_info(int fd) in sync_file_info() argument 94 err = ioctl(fd, SYNC_IOC_FILE_INFO, info); in sync_file_info() 114 err = ioctl(fd, SYNC_IOC_FILE_INFO, info); in sync_file_info() 131 int sync_fence_size(int fd) in sync_fence_size() argument 134 struct sync_file_info *info = sync_file_info(fd); in sync_fence_size() 146 int sync_fence_count_with_status(int fd, int status) in sync_fence_count_with_status() argument 150 struct sync_file_info *info = sync_file_info(fd); in sync_fence_count_with_status() 171 int sw_sync_timeline_inc(int fd, unsigned int count) in sw_sync_timeline_inc() argument [all …]
|
/Linux-v5.4/tools/testing/selftests/rtc/ |
D | rtctest.c | 27 int fd; in FIXTURE() local 31 self->fd = open(rtc_file, O_RDONLY); in FIXTURE_SETUP() 32 ASSERT_NE(-1, self->fd); in FIXTURE_SETUP() 36 close(self->fd); in FIXTURE_TEARDOWN() 44 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm); in TEST_F() 57 rc = ioctl(self->fd, RTC_UIE_ON, 0); 66 rc = read(self->fd, &data, sizeof(data)); 73 rc = ioctl(self->fd, RTC_UIE_OFF, 0); 82 rc = ioctl(self->fd, RTC_UIE_ON, 0); in TEST_F() 94 FD_SET(self->fd, &readfds); in TEST_F() [all …]
|