Home
last modified time | relevance | path

Searched full:fd (Results 1 – 25 of 2401) sorted by relevance

12345678910>>...97

/linux-6.14.4/tools/testing/selftests/memfd/
Dmemfd_test.c49 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 = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC); in sysctl_assert_write() local
97 if (fd < 0) { in sysctl_assert_write()
[all …]
/linux-6.14.4/drivers/clk/
Dclk-fractional-divider.c53 static inline u32 clk_fd_readl(struct clk_fractional_divider *fd) in clk_fd_readl() argument
55 if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN) in clk_fd_readl()
56 return ioread32be(fd->reg); in clk_fd_readl()
58 return readl(fd->reg); in clk_fd_readl()
61 static inline void clk_fd_writel(struct clk_fractional_divider *fd, u32 val) in clk_fd_writel() argument
63 if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN) in clk_fd_writel()
64 iowrite32be(val, fd->reg); in clk_fd_writel()
66 writel(val, fd->reg); in clk_fd_writel()
71 struct clk_fractional_divider *fd = to_clk_fd(hw); in clk_fd_get_div() local
77 if (fd->lock) in clk_fd_get_div()
[all …]
Dclk-fractional-divider_test.c11 * 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
50 fd = kunit_kzalloc(test, sizeof(*fd), GFP_KERNEL); in clk_fd_test_approximation_max_numerator()
[all …]
/linux-6.14.4/include/linux/
Dfile.h3 * 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
62 if (fd.word & FDPUT_FPUT) in fdput()
[all …]
/linux-6.14.4/fs/hfs/
Dbfind.c15 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 …]
/linux-6.14.4/fs/hfsplus/
Dbfind.c15 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->tree->tree_lock); in hfs_find_exit()
[all …]
/linux-6.14.4/tools/testing/vsock/
Dvsock_test.c49 int fd; in test_stream_connection_reset() local
51 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_connection_reset()
55 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_connection_reset()
69 close(fd); in test_stream_connection_reset()
85 int fd; in test_stream_bind_only_client() local
90 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_bind_only_client()
94 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_bind_only_client()
111 close(fd); in test_stream_bind_only_client()
116 int fd; in test_stream_bind_only_server() local
118 fd = vsock_bind(VMADDR_CID_ANY, opts->peer_port, SOCK_STREAM); in test_stream_bind_only_server()
[all …]
/linux-6.14.4/tools/testing/selftests/filesystems/eventfd/
Deventfd_test.c47 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()
[all …]
/linux-6.14.4/tools/perf/tests/
Dwp.c16 #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-6.14.4/fs/
Dfile.c7 * Manage the dynamic fd arrays in the process files_struct.
100 kvfree(fdt->fd); in __free_fdtable()
115 * Copy 'count' fd bits from the old table to the new table and clear the extra
144 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable()
145 memset((char *)nfdt->fd + cpy, 0, set); in copy_fdtable()
174 * 256 slots (i.e. 1Kb fd array). in alloc_fdtable()
175 * 3. on 64bit don't skip anything, 1Kb fd array means 128 slots there in alloc_fdtable()
202 fdt->fd = data; in alloc_fdtable()
218 kvfree(fdt->fd); in alloc_fdtable()
227 * This function will allocate a new fdtable and both fd array and fdset, of
[all …]
/linux-6.14.4/arch/um/os-Linux/
Dfile.c44 int os_stat_fd(const int fd, struct uml_stat *ubuf) in os_stat_fd() argument
49 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd()
89 int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) in os_ioctl_generic() argument
93 err = ioctl(fd, cmd, arg); in os_ioctl_generic()
101 int os_get_ifname(int fd, char* namebuf) in os_get_ifname() argument
103 if (ioctl(fd, SIOCGIFNAME, namebuf) < 0) in os_get_ifname()
109 int os_set_slip(int fd) in os_set_slip() argument
114 if (ioctl(fd, TIOCSETD, &disc) < 0) in os_set_slip()
118 if (ioctl(fd, SIOCSIFENCAP, &sencap) < 0) in os_set_slip()
124 int os_mode_fd(int fd, int mode) in os_mode_fd() argument
[all …]
/linux-6.14.4/drivers/clk/ti/
Dfapll.c71 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->base); in ti_fapll_clear_bypass()
[all …]
/linux-6.14.4/tools/testing/selftests/iommu/
Diommufd_fail_nth.c31 int fd; in writeat() local
33 fd = openat(dfd, fn, O_WRONLY); in writeat()
34 if (fd == -1) in writeat()
36 res = write(fd, val, val_len); in writeat()
38 close(fd); in writeat()
210 int fd; in FIXTURE() local
216 self->fd = -1; in FIXTURE_SETUP()
225 /* The access FD holds the iommufd open until it closes */ in FIXTURE_TEARDOWN()
229 teardown_iommufd(self->fd, _metadata); in FIXTURE_TEARDOWN()
241 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
[all …]
Diommufd_utils.h85 ioctl(self->fd, \
90 static int _test_cmd_mock_domain(int fd, unsigned int ioas_id, __u32 *stdev_id, in _test_cmd_mock_domain() argument
101 ret = ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_mock_domain()
114 ASSERT_EQ(0, _test_cmd_mock_domain(self->fd, ioas_id, stdev_id, \
117 EXPECT_ERRNO(_errno, _test_cmd_mock_domain(self->fd, ioas_id, \
120 static int _test_cmd_mock_domain_flags(int fd, unsigned int ioas_id, in _test_cmd_mock_domain_flags() argument
132 ret = ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_mock_domain_flags()
145 ASSERT_EQ(0, _test_cmd_mock_domain_flags(self->fd, ioas_id, flags, \
149 _test_cmd_mock_domain_flags(self->fd, ioas_id, flags, \
152 static int _test_cmd_mock_domain_replace(int fd, __u32 stdev_id, __u32 pt_id, in _test_cmd_mock_domain_replace() argument
[all …]
/linux-6.14.4/scripts/ipe/polgen/
Dpolgen.c24 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-6.14.4/drivers/scsi/
Dfdomain.c123 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->base + REG_SCSI_DATA_NOACK); in fdomain_select()
192 outb(PARITY_MASK, fd->base + REG_ACTL); in fdomain_select()
[all …]
/linux-6.14.4/tools/perf/tests/shell/attr/
Dtest-stat-detailed-29 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=10
[all …]
Dtest-stat-detailed-39 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=10
[all …]
Dtest-stat-detailed-19 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=10
[all …]
Dtest-stat-default8 fd=1
14 fd=2
20 fd=3
26 fd=4
32 fd=5
39 fd=6
45 fd=7
52 fd=8
59 fd=9
66 fd=10
[all …]
/linux-6.14.4/tools/testing/selftests/bpf/
Dtest_maps.c36 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, &key, &value) < 0 && errno == ENOENT); in test_hashmap()
[all …]
/linux-6.14.4/tools/lib/perf/
Devsel.c48 #define FD(_evsel, _cpu_map_idx, _thread) \ macro
49 ((int *)xyarray__entry(_evsel->fd, _cpu_map_idx, _thread))
56 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int)); in perf_evsel__alloc_fd()
58 if (evsel->fd) { in perf_evsel__alloc_fd()
63 int *fd = FD(evsel, idx, thread); in perf_evsel__alloc_fd() local
65 if (fd) in perf_evsel__alloc_fd()
66 *fd = -1; in perf_evsel__alloc_fd()
71 return evsel->fd != NULL ? 0 : -ENOMEM; in perf_evsel__alloc_fd()
92 int *fd; in get_group_fd() local
103 if (!leader->fd) in get_group_fd()
[all …]
/linux-6.14.4/drivers/media/platform/samsung/exynos4-is/
Dfimc-is-param.c139 __hw_param_copy(&par->fd.control, &cfg->fd.control); in __fimc_is_hw_update_param()
143 __hw_param_copy(&par->fd.otf_input, &cfg->fd.otf_input); in __fimc_is_hw_update_param()
147 __hw_param_copy(&par->fd.dma_input, &cfg->fd.dma_input); in __fimc_is_hw_update_param()
151 __hw_param_copy(&par->fd.config, &cfg->fd.config); in __fimc_is_hw_update_param()
212 struct fd_param *fd; in __is_set_frame_size() local
216 fd = &is->config[index].fd; in __is_set_frame_size()
228 /* Update fd size info (OTF only) */ in __is_set_frame_size()
229 fd->otf_input.width = mf->width; in __is_set_frame_size()
230 fd->otf_input.height = mf->height; in __is_set_frame_size()
463 struct fd_param *fd; in __is_set_fd_control() local
[all …]
/linux-6.14.4/tools/testing/selftests/kvm/
Dguest_memfd_test.c23 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_t page_size) in test_mmap() argument
[all …]
/linux-6.14.4/Documentation/usb/
Dgadget_printer.rst208 struct pollfd fd[1];
211 fd[0].fd = open(PRINTER_FILE, O_RDWR);
212 if (fd[0].fd < 0) {
213 printf("Error %d opening %s\n", fd[0].fd, PRINTER_FILE);
214 close(fd[0].fd);
218 fd[0].events = POLLIN | POLLRDNORM;
226 retval = poll(fd, 1, 1000);
228 if (retval && (fd[0].revents & POLLRDNORM)) {
231 bytes_read = read(fd[0].fd, buf, BUF_SIZE);
235 fd[0].fd, PRINTER_FILE);
[all …]

12345678910>>...97