Home
last modified time | relevance | path

Searched refs:filp (Results 1 – 25 of 34) sorted by relevance

12

/freebsd/sys/compat/linuxkpi/common/include/linux/
H A Dfile.h71 extern void linux_file_free(struct linux_file *filp);
74 fput(struct linux_file *filp) in fput() argument
76 if (refcount_release(filp->_file == NULL ? in fput()
77 &filp->f_count : &filp->_file->f_count)) { in fput()
78 linux_file_free(filp); in fput()
83 file_count(struct linux_file *filp) in file_count() argument
85 return (filp->_file == NULL ? in file_count()
86 filp->f_count : filp->_file->f_count); in file_count()
109 fd_install(unsigned int fd, struct linux_file *filp) in fd_install() argument
114 filp->_file = NULL; in fd_install()
[all …]
H A Dfs.h119 #define fasync_helper(fd, filp, on, queue) \ argument
122 *(queue) = &(filp)->f_sigio; \
260 nonseekable_open(struct inode *inode, struct file *filp) in nonseekable_open() argument
266 simple_open(struct inode *inode, struct file *filp) in simple_open() argument
268 filp->private_data = inode->i_private; in simple_open()
401 __fops ## _open(struct inode *inode, struct file *filp) \
403 return (simple_attr_open(inode, filp, __get, __set, __fmt)); \
419 int simple_attr_open(struct inode *inode, struct file *filp,
423 int simple_attr_release(struct inode *inode, struct file *filp);
425 ssize_t simple_attr_read(struct file *filp, char __user *buf, size_t read_size,
[all …]
/freebsd/sys/compat/linuxkpi/common/src/
H A Dlinux_compat.c408 struct linux_file *filp; in linux_file_alloc() local
410 filp = kzalloc(sizeof(*filp), GFP_KERNEL); in linux_file_alloc()
413 filp->f_count = 1; in linux_file_alloc()
416 spin_lock_init(&filp->f_kqlock); in linux_file_alloc()
417 knlist_init(&filp->f_selinfo.si_note, &filp->f_kqlock, in linux_file_alloc()
420 return (filp); in linux_file_alloc()
424 linux_file_free(struct linux_file *filp) in linux_file_free() argument
426 if (filp->_file == NULL) { in linux_file_free()
427 if (filp->f_op != NULL && filp->f_op->release != NULL) in linux_file_free()
428 filp->f_op->release(filp->f_vnode, filp); in linux_file_free()
[all …]
H A Dlinux_simple_attr.c57 simple_attr_open(struct inode *inode, struct file *filp, in simple_attr_open() argument
72 filp->private_data = (void *) sattr; in simple_attr_open()
74 return (nonseekable_open(inode, filp)); in simple_attr_open()
78 simple_attr_release(struct inode *inode, struct file *filp) in simple_attr_release() argument
80 free(filp->private_data, M_LSATTR); in simple_attr_release()
102 simple_attr_read(struct file *filp, char __user *buf, size_t read_size, in simple_attr_read() argument
110 sattr = filp->private_data; in simple_attr_read()
150 simple_attr_write_common(struct file *filp, const char __user *ubuf, in simple_attr_write_common() argument
158 sattr = filp->private_data; in simple_attr_write_common()
198 simple_attr_write(struct file *filp, const char __user *buf, size_t write_size, in simple_attr_write() argument
[all …]
H A Dlinux_shmemfs.c69 struct linux_file *filp; in linux_shmem_file_setup() local
78 filp = &fileobj->file; in linux_shmem_file_setup()
81 filp->f_count = 1; in linux_shmem_file_setup()
82 filp->f_vnode = vp; in linux_shmem_file_setup()
83 filp->f_shmem = vm_pager_allocate(OBJT_SWAP, NULL, size, in linux_shmem_file_setup()
85 if (filp->f_shmem == NULL) { in linux_shmem_file_setup()
89 return (filp); in linux_shmem_file_setup()
/freebsd/sys/contrib/openzfs/module/os/linux/zfs/
H A Dzpl_file.c57 zpl_open(struct inode *ip, struct file *filp) in zpl_open() argument
63 error = generic_file_open(ip, filp); in zpl_open()
69 error = -zfs_open(ip, filp->f_mode, filp->f_flags, cr); in zpl_open()
78 zpl_release(struct inode *ip, struct file *filp) in zpl_release() argument
89 error = -zfs_close(ip, filp->f_flags, cr); in zpl_release()
98 zpl_iterate(struct file *filp, struct dir_context *ctx) in zpl_iterate() argument
106 error = -zfs_readdir(file_inode(filp), ctx, cr); in zpl_iterate()
119 zpl_fsync(struct file *filp, loff_t start, loff_t end, int datasync) in zpl_fsync() argument
121 struct inode *inode = filp->f_mapping->host; in zpl_fsync()
202 zpl_file_accessed(struct file *filp) in zpl_file_accessed() argument
[all …]
H A Dzfs_ioctl_os.c97 struct file *filp = priv; in zfsdev_private_set_state() local
99 filp->private_data = zs; in zfsdev_private_set_state()
105 struct file *filp = priv; in zfsdev_private_get_state() local
107 return (filp->private_data); in zfsdev_private_get_state()
111 zfsdev_open(struct inode *ino, struct file *filp) in zfsdev_open() argument
116 error = zfsdev_state_init(filp); in zfsdev_open()
123 zfsdev_release(struct inode *ino, struct file *filp) in zfsdev_release() argument
125 zfsdev_state_destroy(filp); in zfsdev_release()
131 zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg) in zfsdev_ioctl() argument
227 zfsdev_compat_ioctl(struct file *filp, unsigned cmd, unsigned long arg) in zfsdev_compat_ioctl() argument
[all …]
H A Dzfs_file_os.c46 struct file *filp; in zfs_file_open() local
55 filp = filp_open(path, flags, mode); in zfs_file_open()
60 if (IS_ERR(filp)) in zfs_file_open()
61 return (-PTR_ERR(filp)); in zfs_file_open()
63 *fpp = filp; in zfs_file_open()
235 zfs_file_getattr(zfs_file_t *filp, zfs_file_attr_t *zfattr) in zfs_file_getattr() argument
240 rc = vfs_getattr(&filp->f_path, &stat, STATX_BASIC_STATS, in zfs_file_getattr()
260 zfs_file_fsync(zfs_file_t *filp, int flags) in zfs_file_fsync() argument
268 error = -vfs_fsync(filp, datasync); in zfs_file_fsync()
H A Dzpl_ctldir.c44 zpl_common_open(struct inode *ip, struct file *filp) in zpl_common_open() argument
46 if (blk_mode_is_open_write(filp->f_mode)) in zpl_common_open()
49 return (generic_file_open(ip, filp)); in zpl_common_open()
56 zpl_root_iterate(struct file *filp, struct dir_context *ctx) in zpl_root_iterate() argument
58 zfsvfs_t *zfsvfs = ITOZSB(file_inode(filp)); in zpl_root_iterate()
68 if (!dir_emit_dots(filp, ctx)) in zpl_root_iterate()
289 zpl_snapdir_iterate(struct file *filp, struct dir_context *ctx) in zpl_snapdir_iterate() argument
291 zfsvfs_t *zfsvfs = ITOZSB(file_inode(filp)); in zpl_snapdir_iterate()
302 if (!dir_emit_dots(filp, ctx)) in zpl_snapdir_iterate()
554 zpl_shares_iterate(struct file *filp, struct dir_context *ctx) in zpl_shares_iterate() argument
[all …]
/freebsd/sys/contrib/openzfs/include/os/linux/kernel/linux/
H A Dvfs_compat.h68 struct file *filp, in lseek_execute() argument
74 if (offset < 0 && !(filp->f_mode & FMODE_UNSIGNED_OFFSET)) in lseek_execute()
76 if (offset < 0 && !(filp->f_op->fop_flags & FOP_UNSIGNED_OFFSET)) in lseek_execute()
83 if (offset != filp->f_pos) { in lseek_execute()
84 spin_lock(&filp->f_lock); in lseek_execute()
85 filp->f_pos = offset; in lseek_execute()
87 filp->f_version = 0; in lseek_execute()
89 spin_unlock(&filp->f_lock); in lseek_execute()
/freebsd/sys/contrib/openzfs/module/os/linux/spl/
H A Dspl-generic.c346 spl_getattr(struct file *filp, struct kstat *stat) in spl_getattr() argument
350 ASSERT(filp); in spl_getattr()
353 rc = vfs_getattr(&filp->f_path, stat, STATX_BASIC_STATS, in spl_getattr()
407 struct file *filp; in hostid_read() local
410 filp = filp_open(spl_hostid_path, 0, 0); in hostid_read()
412 if (IS_ERR(filp)) in hostid_read()
415 error = spl_getattr(filp, &stat); in hostid_read()
417 filp_close(filp, 0); in hostid_read()
423 filp_close(filp, 0); in hostid_read()
432 error = kernel_read(filp, &value, sizeof (value), &off); in hostid_read()
[all …]
H A Dspl-procfs-list.c170 procfs_list_open(struct inode *inode, struct file *filp) in procfs_list_open() argument
172 int rc = seq_open_private(filp, &procfs_list_seq_ops, in procfs_list_open()
177 struct seq_file *f = filp->private_data; in procfs_list_open()
187 procfs_list_write(struct file *filp, const char __user *buf, size_t len, in procfs_list_write() argument
190 struct seq_file *f = filp->private_data; in procfs_list_write()
H A Dspl-kstat.c460 proc_kstat_open(struct inode *inode, struct file *filp) in proc_kstat_open() argument
465 rc = seq_open(filp, &kstat_seq_ops); in proc_kstat_open()
469 f = filp->private_data; in proc_kstat_open()
476 proc_kstat_write(struct file *filp, const char __user *buf, size_t len, in proc_kstat_write() argument
479 struct seq_file *f = filp->private_data; in proc_kstat_write()
H A Dspl-proc.c290 proc_slab_open(struct inode *inode, struct file *filp) in proc_slab_open() argument
292 return (seq_open(filp, &slab_seq_ops)); in proc_slab_open()
/freebsd/sys/ofed/drivers/infiniband/core/
H A Dib_uverbs_main.c211 struct file *filp, char __user *buf, in ib_uverbs_event_read() argument
223 if (filp->f_flags & O_NONBLOCK) in ib_uverbs_event_read()
267 static ssize_t ib_uverbs_async_event_read(struct file *filp, char __user *buf, in ib_uverbs_async_event_read() argument
270 struct ib_uverbs_async_event_file *file = filp->private_data; in ib_uverbs_async_event_read()
272 return ib_uverbs_event_read(&file->ev_queue, filp, buf, count, pos, in ib_uverbs_async_event_read()
276 static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf, in ib_uverbs_comp_event_read() argument
280 filp->private_data; in ib_uverbs_comp_event_read()
282 return ib_uverbs_event_read(&comp_ev_file->ev_queue, filp, buf, count, in ib_uverbs_comp_event_read()
288 struct file *filp, in ib_uverbs_event_poll() argument
293 poll_wait(filp, &ev_queue->poll_wait, wait); in ib_uverbs_event_poll()
[all …]
H A Dib_rdma_core.c460 struct file *filp; in alloc_begin_fd_uobject()
474 filp = alloc_file(fd_type->flags, fd_type->fops); in alloc_begin_fd_uobject()
475 if (IS_ERR(filp)) { in alloc_begin_fd_uobject()
476 uobj = ERR_CAST(filp); in alloc_begin_fd_uobject()
479 uobj->object = filp; in alloc_begin_fd_uobject()
553 struct file *filp = uobj->object; in alloc_abort_fd_uobject()
555 fput(filp); in alloc_abort_fd_uobject() local
596 struct file *filp = uobj->object; in alloc_commit_fd_uobject()
608 filp->private_data = uobj; in alloc_commit_fd_uobject()
609 fd_install(fd, filp); in alloc_commit_fd_uobject()
462 struct file *filp; alloc_begin_fd_uobject() local
598 struct file *filp = uobj->object; alloc_commit_fd_uobject() local
663 struct file *filp = uobj->object; lookup_put_fd_uobject() local
739 uverbs_uobject_fd_release(struct inode * inode,struct file * filp) uverbs_uobject_fd_release() argument
[all...]
H A Dib_user_mad.c338 static ssize_t ib_umad_read(struct file *filp, char __user *buf, in ib_umad_read() argument
341 struct ib_umad_file *file = filp->private_data; in ib_umad_read()
353 if (filp->f_flags & O_NONBLOCK) in ib_umad_read()
451 static ssize_t ib_umad_write(struct file *filp, const char __user *buf, in ib_umad_write() argument
454 struct ib_umad_file *file = filp->private_data; in ib_umad_write()
612 static unsigned int ib_umad_poll(struct file *filp, struct poll_table_struct *wait) in ib_umad_poll() argument
614 struct ib_umad_file *file = filp->private_data; in ib_umad_poll()
619 poll_wait(filp, &file->recv_wait, wait); in ib_umad_poll()
889 static long ib_umad_ioctl(struct file *filp, unsigned int cmd, in ib_umad_ioctl() argument
894 return ib_umad_reg_agent(filp->private_data, (void __user *) arg, 0); in ib_umad_ioctl()
[all …]
H A Dib_ucm.c70 struct file *filp; member
405 if (file->filp->f_flags & O_NONBLOCK) in ib_ucm_event()
1101 static ssize_t ib_ucm_write(struct file *filp, const char __user *buf, in ib_ucm_write() argument
1104 struct ib_ucm_file *file = filp->private_data; in ib_ucm_write()
1108 if (WARN_ON_ONCE(!ib_safe_file_access(filp))) in ib_ucm_write()
1131 static unsigned int ib_ucm_poll(struct file *filp, in ib_ucm_poll() argument
1134 struct ib_ucm_file *file = filp->private_data; in ib_ucm_poll()
1137 poll_wait(filp, &file->poll_wait, wait); in ib_ucm_poll()
1153 static int ib_ucm_open(struct inode *inode, struct file *filp) in ib_ucm_open() argument
1167 filp->private_data = file; in ib_ucm_open()
[all …]
H A Dib_ucma.c65 struct file *filp; member
401 if (file->filp->f_flags & O_NONBLOCK) in ucma_get_event()
1608 static ssize_t ucma_write(struct file *filp, const char __user *buf, in ucma_write() argument
1611 struct ucma_file *file = filp->private_data; in ucma_write()
1615 if (WARN_ON_ONCE(!ib_safe_file_access(filp))) in ucma_write()
1640 static unsigned int ucma_poll(struct file *filp, struct poll_table_struct *wait) in ucma_poll() argument
1642 struct ucma_file *file = filp->private_data; in ucma_poll()
1645 poll_wait(filp, &file->poll_wait, wait); in ucma_poll()
1661 static int ucma_open(struct inode *inode, struct file *filp) in ucma_open() argument
1681 filp->private_data = file; in ucma_open()
[all …]
/freebsd/sys/contrib/dev/rtw88/
H A Ddebug.c22 ssize_t (*cb_write)(struct file *filp, const char __user *buffer,
114 static ssize_t rtw_debugfs_common_write(struct file *filp, in rtw_debugfs_common_write() argument
118 struct rtw_debugfs_priv *debugfs_priv = filp->private_data; in rtw_debugfs_common_write()
120 return debugfs_priv->cb_write(filp, buffer, count, loff); in rtw_debugfs_common_write()
123 static ssize_t rtw_debugfs_single_write(struct file *filp, in rtw_debugfs_single_write() argument
127 struct seq_file *seqpriv = (struct seq_file *)filp->private_data; in rtw_debugfs_single_write()
130 return debugfs_priv->cb_write(filp, buffer, count, loff); in rtw_debugfs_single_write()
133 static int rtw_debugfs_single_open_rw(struct inode *inode, struct file *filp) in rtw_debugfs_single_open_rw() argument
135 return single_open(filp, rtw_debugfs_single_show, inode->i_private); in rtw_debugfs_single_open_rw()
138 static int rtw_debugfs_close(struct inode *inode, struct file *filp) in rtw_debugfs_close() argument
[all …]
/freebsd/sys/ofed/include/rdma/
H A Dib.h109 static inline bool ib_safe_file_access(struct file *filp) in ib_safe_file_access() argument
117 return (filp->_file != NULL && in ib_safe_file_access()
118 filp->_file == td->td_fpop && in ib_safe_file_access()
119 filp->_file->f_cred == td->td_ucred); in ib_safe_file_access()
/freebsd/sys/dev/drm2/
H A Ddrm_gem.c171 drm_gem_remove_prime_handles(struct drm_gem_object *obj, struct drm_file *filp) in drm_gem_remove_prime_handles() argument
174 drm_prime_remove_buf_handle(&filp->prime, in drm_gem_remove_prime_handles()
178 drm_prime_remove_buf_handle(&filp->prime, in drm_gem_remove_prime_handles()
188 drm_gem_handle_delete(struct drm_file *filp, u32 handle) in drm_gem_handle_delete() argument
193 obj = drm_gem_names_remove(&filp->object_names, handle); in drm_gem_handle_delete()
200 drm_gem_remove_prime_handles(obj, filp); in drm_gem_handle_delete()
204 dev->driver->gem_close_object(obj, filp); in drm_gem_handle_delete()
284 drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp, in drm_gem_object_lookup() argument
289 obj = drm_gem_name_ref(&filp->object_names, handle, in drm_gem_object_lookup()
/freebsd/sys/dev/netmap/
H A Dnetmap_kloop.c453 struct file *filp; member
492 entry->filp = file; in sync_kloop_poll_table_queue_proc()
735 struct file *filp = NULL; in netmap_sync_kloop() local
740 filp = eventfd_fget( in netmap_sync_kloop()
742 if (IS_ERR(filp)) { in netmap_sync_kloop()
743 err = PTR_ERR(filp); in netmap_sync_kloop()
746 irq = eventfd_ctx_fileget(filp); in netmap_sync_kloop()
752 poll_ctx->entries[i].irq_filp = filp; in netmap_sync_kloop()
765 filp = eventfd_fget( in netmap_sync_kloop()
767 if (IS_ERR(filp)) { in netmap_sync_kloop()
[all …]
/freebsd/sys/compat/lindebugfs/
H A Dlindebugfs.c660 fops_str_open(struct inode *inode, struct file *filp) in fops_str_open() argument
663 return (simple_open(inode, filp)); in fops_str_open()
667 fops_str_read(struct file *filp, char __user *ubuf, size_t read_size, in fops_str_read() argument
674 if (filp->private_data == NULL) in fops_str_read()
677 str = *(char **)filp->private_data; in fops_str_read()
701 fops_str_write(struct file *filp, const char __user *buf, size_t write_size, in fops_str_write() argument
707 if (filp->private_data == NULL) in fops_str_write()
710 old = *(char **)filp->private_data; in fops_str_write()
738 filp->private_data = &new; in fops_str_write()
775 fops_blob_read(struct file *filp, char __user *ubuf, size_t read_size, loff_t *ppos) in fops_blob_read() argument
[all …]
/freebsd/sys/dev/mlx5/mlx5_ib/
H A Dmlx5_ib_devx.c2430 static ssize_t devx_async_cmd_event_read(struct file *filp, char __user *buf, in devx_async_cmd_event_read() argument
2433 struct devx_async_cmd_event_file *comp_ev_file = filp->private_data; in devx_async_cmd_event_read()
2444 if (filp->f_flags & O_NONBLOCK) in devx_async_cmd_event_read()
2484 static __poll_t devx_async_cmd_event_poll(struct file *filp, in devx_async_cmd_event_poll() argument
2487 struct devx_async_cmd_event_file *comp_ev_file = filp->private_data; in devx_async_cmd_event_poll()
2491 poll_wait(filp, &ev_queue->poll_wait, wait); in devx_async_cmd_event_poll()
2511 static ssize_t devx_async_event_read(struct file *filp, char __user *buf, in devx_async_event_read() argument
2514 struct devx_async_event_file *ev_file = filp->private_data; in devx_async_event_read()
2536 if (filp->f_flags & O_NONBLOCK) in devx_async_event_read()
2589 static __poll_t devx_async_event_poll(struct file *filp, in devx_async_event_poll() argument
[all …]

12