Home
last modified time | relevance | path

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

12345678910>>...151

/kernel/linux/linux-6.6/tools/testing/selftests/memfd/
Dmemfd_test.c51 static ssize_t fd2name(int fd, char *buf, size_t bufsize) in fd2name() argument
57 size = snprintf(buf1, PATH_MAX, "/proc/self/fd/%d", fd); in fd2name()
59 printf("snprintf(%d) failed on %m\n", fd); in fd2name()
77 int r, fd; in mfd_assert_new() local
79 fd = sys_memfd_create(name, flags); in mfd_assert_new()
80 if (fd < 0) { in mfd_assert_new()
86 r = ftruncate(fd, sz); in mfd_assert_new()
92 return fd; in mfd_assert_new()
97 int fd = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC); in sysctl_assert_write() local
99 if (fd < 0) { in sysctl_assert_write()
[all …]
/kernel/linux/linux-5.10/tools/testing/selftests/memfd/
Dmemfd_test.c39 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
62 sprintf(path, "/proc/self/fd/%d", fd_in); in mfd_assert_reopen_fd()
64 fd = open(path, O_RDWR); in mfd_assert_reopen_fd()
65 if (fd < 0) { in mfd_assert_reopen_fd()
66 printf("re-open of existing fd %d failed\n", fd_in); in mfd_assert_reopen_fd()
[all …]
/kernel/linux/linux-5.10/drivers/clk/
Dclk-fractional-divider.c17 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 …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-5.10/fs/hfs/
Dbfind.c15 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument
21 fd->tree = tree; in hfs_find_init()
22 fd->bnode = NULL; in hfs_find_init()
26 fd->search_key = ptr; in hfs_find_init()
27 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init()
46 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument
48 hfs_bnode_put(fd->bnode); in hfs_find_exit()
49 kfree(fd->search_key); in hfs_find_exit()
51 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit()
52 mutex_unlock(&fd->tree->tree_lock); in hfs_find_exit()
[all …]
/kernel/linux/linux-5.10/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()
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 …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-6.6/include/linux/
Dfile.h3 * Wrapper functions for accessing the file_struct fd array.
36 struct fd { struct
43 static inline void fdput(struct fd fd) in fdput() argument
45 if (fd.flags & FDPUT_FPUT) in fdput()
46 fput(fd.file); in fdput()
49 extern struct file *fget(unsigned int fd);
50 extern struct file *fget_raw(unsigned int fd);
51 extern struct file *fget_task(struct task_struct *task, unsigned int fd);
52 extern unsigned long __fdget(unsigned int fd);
53 extern unsigned long __fdget_raw(unsigned int fd);
[all …]
/kernel/linux/linux-5.10/include/linux/
Dfile.h3 * Wrapper functions for accessing the file_struct fd array.
36 struct fd { struct
43 static inline void fdput(struct fd fd) in fdput() argument
45 if (fd.flags & FDPUT_FPUT) in fdput()
46 fput(fd.file); in fdput()
49 extern struct file *fget(unsigned int fd);
50 extern struct file *fget_many(unsigned int fd, unsigned int refs);
51 extern struct file *fget_raw(unsigned int fd);
52 extern struct file *fget_task(struct task_struct *task, unsigned int fd);
53 extern unsigned long __fdget(unsigned int fd);
[all …]
/kernel/linux/linux-6.6/tools/perf/tests/
Dwp.c16 #define WP_TEST_ASSERT_VAL(fd, text, val) \ argument
19 wp_read(fd, &count, sizeof(long long)); \
27 static int wp_read(int fd, long long *count, int size) in wp_read() argument
29 int ret = read(fd, count, size); in wp_read()
56 int fd; in __event() local
60 fd = sys_perf_event_open(&attr, 0, -1, -1, in __event()
62 if (fd < 0) { in __event()
63 fd = -errno; in __event()
67 return fd; in __event()
77 int fd; in test__wp_ro()
[all …]
/kernel/linux/linux-6.6/fs/
Dfile.c7 * Manage the dynamic fd arrays in the process files_struct.
37 kvfree(fdt->fd); in __free_fdtable()
52 * Copy 'count' fd bits from the old table to the new table and clear the extra
81 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable()
82 memset((char *)nfdt->fd + cpy, 0, set); in copy_fdtable()
136 fdt->fd = data; in alloc_fdtable()
152 kvfree(fdt->fd); in alloc_fdtable()
161 * This function will allocate a new fdtable and both fd array and fdset, of
246 static inline void __set_close_on_exec(unsigned int fd, struct fdtable *fdt) in __set_close_on_exec() argument
248 __set_bit(fd, fdt->close_on_exec); in __set_close_on_exec()
[all …]
/kernel/linux/linux-5.10/fs/
Dfile.c7 * Manage the dynamic fd arrays in the process files_struct.
36 kvfree(fdt->fd); in __free_fdtable()
50 * Copy 'count' fd bits from the old table to the new table and clear the extra
84 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable()
85 memset((char *)nfdt->fd + cpy, 0, set); in copy_fdtable()
139 fdt->fd = data; in alloc_fdtable()
155 kvfree(fdt->fd); in alloc_fdtable()
164 * This function will allocate a new fdtable and both fd array and fdset, of
249 static inline void __set_close_on_exec(unsigned int fd, struct fdtable *fdt) in __set_close_on_exec() argument
251 __set_bit(fd, fdt->close_on_exec); in __set_close_on_exec()
[all …]
/kernel/linux/linux-6.6/arch/um/os-Linux/
Dfile.c43 int os_stat_fd(const int fd, struct uml_stat *ubuf) in os_stat_fd() argument
48 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd()
88 int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) in os_ioctl_generic() argument
92 err = ioctl(fd, cmd, arg); in os_ioctl_generic()
100 int os_get_ifname(int fd, char* namebuf) in os_get_ifname() argument
102 if (ioctl(fd, SIOCGIFNAME, namebuf) < 0) in os_get_ifname()
108 int os_set_slip(int fd) in os_set_slip() argument
113 if (ioctl(fd, TIOCSETD, &disc) < 0) in os_set_slip()
117 if (ioctl(fd, SIOCSIFENCAP, &sencap) < 0) in os_set_slip()
123 int os_mode_fd(int fd, int mode) in os_mode_fd() argument
[all …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-5.10/arch/um/os-Linux/
Dfile.c43 int os_stat_fd(const int fd, struct uml_stat *ubuf) in os_stat_fd() argument
48 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd()
88 int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) in os_ioctl_generic() argument
92 err = ioctl(fd, cmd, arg); in os_ioctl_generic()
100 int os_get_ifname(int fd, char* namebuf) in os_get_ifname() argument
102 if (ioctl(fd, SIOCGIFNAME, namebuf) < 0) in os_get_ifname()
108 int os_set_slip(int fd) in os_set_slip() argument
113 if (ioctl(fd, TIOCSETD, &disc) < 0) in os_set_slip()
117 if (ioctl(fd, SIOCSIFENCAP, &sencap) < 0) in os_set_slip()
123 int os_mode_fd(int fd, int mode) in os_mode_fd() argument
[all …]
/kernel/linux/linux-5.10/drivers/scsi/
Dfdomain.c118 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 …]
/kernel/linux/linux-5.10/tools/perf/tests/
Dwp.c14 #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 …]
/kernel/linux/linux-6.6/tools/perf/tests/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 …]
/kernel/linux/linux-6.6/tools/lib/perf/
Devsel.c46 #define FD(_evsel, _cpu_map_idx, _thread) \ macro
47 ((int *)xyarray__entry(_evsel->fd, _cpu_map_idx, _thread))
54 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int)); in perf_evsel__alloc_fd()
56 if (evsel->fd) { in perf_evsel__alloc_fd()
61 int *fd = FD(evsel, idx, thread); in perf_evsel__alloc_fd() local
63 if (fd) in perf_evsel__alloc_fd()
64 *fd = -1; in perf_evsel__alloc_fd()
69 return evsel->fd != NULL ? 0 : -ENOMEM; in perf_evsel__alloc_fd()
90 int *fd; in get_group_fd() local
101 if (!leader->fd) in get_group_fd()
[all …]
/kernel/linux/linux-6.6/tools/testing/vsock/
Dvsock_test.c40 int fd; in test_stream_connection_reset() local
42 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_connection_reset()
46 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_connection_reset()
60 close(fd); in test_stream_connection_reset()
76 int fd; in test_stream_bind_only_client() local
81 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_bind_only_client()
85 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_bind_only_client()
102 close(fd); in test_stream_bind_only_client()
117 int fd; in test_stream_bind_only_server() local
119 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_bind_only_server()
[all …]
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/
Dtest_maps.c40 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 …]
/kernel/linux/linux-6.6/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 …]
/kernel/linux/linux-6.6/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()
207 int fd; in FIXTURE() local
213 self->fd = -1; in FIXTURE_SETUP()
222 /* The access FD holds the iommufd open until it closes */ in FIXTURE_TEARDOWN()
226 teardown_iommufd(self->fd, _metadata); in FIXTURE_TEARDOWN()
238 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
[all …]

12345678910>>...151