Lines Matching defs:file

18 #include <linux/file.h>
158 static int bpf_map_update_value(struct bpf_map *map, struct file *map_file,
331 * map object inspection since multiple file descriptors with
819 static int bpf_map_release(struct inode *inode, struct file *filp)
832 fmode_t mode = f.file->f_mode;
834 /* Our file permissions may have been overridden by global
849 static void bpf_map_show_fdinfo(struct seq_file *m, struct file *filp)
887 static ssize_t bpf_dummy_read(struct file *filp, char __user *buf, size_t siz,
896 static ssize_t bpf_dummy_write(struct file *filp, const char __user *buf,
928 static int bpf_map_mmap(struct file *filp, struct vm_area_struct *vma)
976 static __poll_t bpf_map_poll(struct file *filp, struct poll_table_struct *pts)
986 static unsigned long bpf_get_unmapped_area(struct file *filp, unsigned long addr,
1426 if (!f.file)
1428 if (f.file->f_op != &bpf_map_fops) {
1433 return f.file->private_data;
1654 err = bpf_map_update_value(map, f.file, key, value, attr->flags);
1845 int generic_map_update_batch(struct bpf_map *map, struct file *map_file,
2306 static int bpf_prog_release(struct inode *inode, struct file *filp)
2359 static void bpf_prog_show_fdinfo(struct seq_file *m, struct file *filp)
2412 if (!f.file)
2414 if (f.file->f_op != &bpf_prog_fops) {
2419 return f.file->private_data;
3018 /* Clean up bpf_link and corresponding anon_inode file and FD. After
3021 * defunct, releases anon_inode file and puts reserved FD. bpf_prog's refcnt
3031 fput(primer->file);
3109 static int bpf_link_release(struct inode *inode, struct file *filp)
3129 static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)
3175 /* Prepare bpf_link to be exposed to user-space by allocating anon_inode file,
3186 * that file, FD, or ID can't be allocated.
3190 struct file *file;
3204 file = anon_inode_getfile("bpf_link", &bpf_link_fops, link, O_CLOEXEC);
3205 if (IS_ERR(file)) {
3208 return PTR_ERR(file);
3212 primer->file = file;
3225 fd_install(primer->fd, primer->file);
3240 if (!f.file)
3242 if (f.file->f_op != &bpf_link_fops) {
3247 link = f.file->private_data;
3592 struct file *perf_file;
3772 struct file *perf_file;
4560 static int bpf_prog_get_info_by_fd(struct file *file,
4638 if (prog->blinded && !bpf_dump_raw_ok(file->f_cred)) {
4642 insns_sanitized = bpf_insn_prepare_dump(prog, file->f_cred);
4676 if (bpf_dump_raw_ok(file->f_cred)) {
4711 if (bpf_dump_raw_ok(file->f_cred)) {
4742 if (bpf_dump_raw_ok(file->f_cred)) {
4802 if (bpf_dump_raw_ok(file->f_cred)) {
4849 static int bpf_map_get_info_by_fd(struct file *file,
4896 static int bpf_btf_get_info_by_fd(struct file *file,
4912 static int bpf_link_get_info_by_fd(struct file *file,
4963 if (!f.file)
4966 if (f.file->f_op == &bpf_prog_fops)
4967 err = bpf_prog_get_info_by_fd(f.file, f.file->private_data, attr,
4969 else if (f.file->f_op == &bpf_map_fops)
4970 err = bpf_map_get_info_by_fd(f.file, f.file->private_data, attr,
4972 else if (f.file->f_op == &btf_fops)
4973 err = bpf_btf_get_info_by_fd(f.file, f.file->private_data, attr, uattr);
4974 else if (f.file->f_op == &bpf_link_fops)
4975 err = bpf_link_get_info_by_fd(f.file, f.file->private_data,
5085 struct file *file;
5104 file = fget_task(task, fd);
5106 if (!file)
5109 if (file->f_op == &bpf_link_fops) {
5110 struct bpf_link *link = file->private_data;
5126 event = perf_get_event(file);
5146 fput(file);
5196 BPF_DO_BATCH(map->ops->map_update_batch, map, f.file, attr, uattr);
5492 static int bpf_stats_release(struct inode *inode, struct file *file)