Searched refs:file (Results 1 - 200 of 12089) sorted by relevance

1234567891011>>

/linux-4.4.14/fs/ramfs/
H A DMakefile7 file-mmu-y := file-nommu.o
8 file-mmu-$(CONFIG_MMU) := file-mmu.o
9 ramfs-objs += inode.o $(file-mmu-y)
/linux-4.4.14/fs/debugfs/
H A DMakefile1 debugfs-objs := inode.o file.o
H A Dfile.c2 * file.c - part of debugfs, a tiny little debug file system
26 static ssize_t default_read_file(struct file *file, char __user *buf, default_read_file() argument
32 static ssize_t default_write_file(struct file *file, const char __user *buf, default_write_file() argument
76 * debugfs_create_u8 - create a debugfs file that is used to read and write an unsigned 8-bit value
77 * @name: a pointer to a string containing the name of the file to create.
78 * @mode: the permission that the file should have
79 * @parent: a pointer to the parent dentry for this file. This should be a
81 * file will be created in the root of the debugfs filesystem.
82 * @value: a pointer to the variable that the file should read to and write
85 * This function creates a file in debugfs with the given name that
90 * pointer must be passed to the debugfs_remove() function when the file is
122 * debugfs_create_u16 - create a debugfs file that is used to read and write an unsigned 16-bit value
123 * @name: a pointer to a string containing the name of the file to create.
124 * @mode: the permission that the file should have
125 * @parent: a pointer to the parent dentry for this file. This should be a
127 * file will be created in the root of the debugfs filesystem.
128 * @value: a pointer to the variable that the file should read to and write
131 * This function creates a file in debugfs with the given name that
136 * pointer must be passed to the debugfs_remove() function when the file is
168 * debugfs_create_u32 - create a debugfs file that is used to read and write an unsigned 32-bit value
169 * @name: a pointer to a string containing the name of the file to create.
170 * @mode: the permission that the file should have
171 * @parent: a pointer to the parent dentry for this file. This should be a
173 * file will be created in the root of the debugfs filesystem.
174 * @value: a pointer to the variable that the file should read to and write
177 * This function creates a file in debugfs with the given name that
182 * pointer must be passed to the debugfs_remove() function when the file is
215 * debugfs_create_u64 - create a debugfs file that is used to read and write an unsigned 64-bit value
216 * @name: a pointer to a string containing the name of the file to create.
217 * @mode: the permission that the file should have
218 * @parent: a pointer to the parent dentry for this file. This should be a
220 * file will be created in the root of the debugfs filesystem.
221 * @value: a pointer to the variable that the file should read to and write
224 * This function creates a file in debugfs with the given name that
229 * pointer must be passed to the debugfs_remove() function when the file is
262 * debugfs_create_ulong - create a debugfs file that is used to read and write
264 * @name: a pointer to a string containing the name of the file to create.
265 * @mode: the permission that the file should have
266 * @parent: a pointer to the parent dentry for this file. This should be a
268 * file will be created in the root of the debugfs filesystem.
269 * @value: a pointer to the variable that the file should read to and write
272 * This function creates a file in debugfs with the given name that
277 * pointer must be passed to the debugfs_remove() function when the file is
311 * debugfs_create_x{8,16,32,64} - create a debugfs file that is used to read and write an unsigned {8,16,32,64}-bit value
319 * debugfs_create_x8 - create a debugfs file that is used to read and write an unsigned 8-bit value
320 * @name: a pointer to a string containing the name of the file to create.
321 * @mode: the permission that the file should have
322 * @parent: a pointer to the parent dentry for this file. This should be a
324 * file will be created in the root of the debugfs filesystem.
325 * @value: a pointer to the variable that the file should read to and write
337 * debugfs_create_x16 - create a debugfs file that is used to read and write an unsigned 16-bit value
338 * @name: a pointer to a string containing the name of the file to create.
339 * @mode: the permission that the file should have
340 * @parent: a pointer to the parent dentry for this file. This should be a
342 * file will be created in the root of the debugfs filesystem.
343 * @value: a pointer to the variable that the file should read to and write
355 * debugfs_create_x32 - create a debugfs file that is used to read and write an unsigned 32-bit value
356 * @name: a pointer to a string containing the name of the file to create.
357 * @mode: the permission that the file should have
358 * @parent: a pointer to the parent dentry for this file. This should be a
360 * file will be created in the root of the debugfs filesystem.
361 * @value: a pointer to the variable that the file should read to and write
373 * debugfs_create_x64 - create a debugfs file that is used to read and write an unsigned 64-bit value
374 * @name: a pointer to a string containing the name of the file to create.
375 * @mode: the permission that the file should have
376 * @parent: a pointer to the parent dentry for this file. This should be a
378 * file will be created in the root of the debugfs filesystem.
379 * @value: a pointer to the variable that the file should read to and write
407 * debugfs_create_size_t - create a debugfs file that is used to read and write an size_t value
408 * @name: a pointer to a string containing the name of the file to create.
409 * @mode: the permission that the file should have
410 * @parent: a pointer to the parent dentry for this file. This should be a
412 * file will be created in the root of the debugfs filesystem.
413 * @value: a pointer to the variable that the file should read to and write
440 * debugfs_create_atomic_t - create a debugfs file that is used to read and
442 * @name: a pointer to a string containing the name of the file to create.
443 * @mode: the permission that the file should have
444 * @parent: a pointer to the parent dentry for this file. This should be a
446 * file will be created in the root of the debugfs filesystem.
447 * @value: a pointer to the variable that the file should read to and write
458 ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf, debugfs_read_file_bool() argument
462 bool *val = file->private_data; debugfs_read_file_bool()
474 ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf, debugfs_write_file_bool() argument
480 bool *val = file->private_data; debugfs_write_file_bool()
514 * debugfs_create_bool - create a debugfs file that is used to read and write a boolean value
515 * @name: a pointer to a string containing the name of the file to create.
516 * @mode: the permission that the file should have
517 * @parent: a pointer to the parent dentry for this file. This should be a
519 * file will be created in the root of the debugfs filesystem.
520 * @value: a pointer to the variable that the file should read to and write
523 * This function creates a file in debugfs with the given name that
528 * pointer must be passed to the debugfs_remove() function when the file is
545 static ssize_t read_file_blob(struct file *file, char __user *user_buf, read_file_blob() argument
548 struct debugfs_blob_wrapper *blob = file->private_data; read_file_blob()
560 * debugfs_create_blob - create a debugfs file that is used to read a binary blob
561 * @name: a pointer to a string containing the name of the file to create.
562 * @mode: the permission that the file should have
563 * @parent: a pointer to the parent dentry for this file. This should be a
565 * file will be created in the root of the debugfs filesystem.
569 * This function creates a file in debugfs with the given name that exports
574 * pointer must be passed to the debugfs_remove() function when the file is
614 static int u32_array_open(struct inode *inode, struct file *file) u32_array_open() argument
631 file->private_data = buf; u32_array_open()
634 return nonseekable_open(inode, file); u32_array_open()
637 static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len, u32_array_read() argument
640 size_t size = strlen(file->private_data); u32_array_read()
643 file->private_data, size); u32_array_read()
646 static int u32_array_release(struct inode *inode, struct file *file) u32_array_release() argument
648 kfree(file->private_data); u32_array_release()
662 * debugfs_create_u32_array - create a debugfs file that is used to read u32
664 * @name: a pointer to a string containing the name of the file to create.
665 * @mode: the permission that the file should have.
666 * @parent: a pointer to the parent dentry for this file. This should be a
668 * file will be created in the root of the debugfs filesystem.
672 * This function creates a file in debugfs with the given name that exports
674 * Writing is not supported. Seek within the file is also not supported.
701 * sequential file or create a debugfs file that only prints a regset32.
743 static int debugfs_open_regset32(struct inode *inode, struct file *file) debugfs_open_regset32() argument
745 return single_open(file, debugfs_show_regset32, inode->i_private); debugfs_open_regset32()
756 * debugfs_create_regset32 - create a debugfs file that returns register values
757 * @name: a pointer to a string containing the name of the file to create.
758 * @mode: the permission that the file should have
759 * @parent: a pointer to the parent dentry for this file. This should be a
761 * file will be created in the root of the debugfs filesystem.
766 * This function creates a file in debugfs with the given name that reports
771 * pointer must be passed to the debugfs_remove() function when the file is
795 static int debugfs_devm_entry_open(struct inode *inode, struct file *f) debugfs_devm_entry_open()
811 * debugfs_create_devm_seqfile - create a debugfs file that is bound to device.
813 * @dev: device related to this debugfs file.
814 * @name: name of the debugfs file.
815 * @parent: a pointer to the parent dentry for this file. This should be a
817 * file will be created in the root of the debugfs filesystem.
/linux-4.4.14/include/media/
H A Dv4l2-ioctl.h24 int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap);
27 int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh,
29 int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh,
31 int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh,
33 int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *file, void *fh,
35 int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh,
37 int (*vidioc_enum_fmt_sdr_cap) (struct file *file, void *fh,
39 int (*vidioc_enum_fmt_sdr_out) (struct file *file, void *fh,
43 int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh,
45 int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
47 int (*vidioc_g_fmt_vid_out) (struct file *file, void *fh,
49 int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
51 int (*vidioc_g_fmt_vbi_cap) (struct file *file, void *fh,
53 int (*vidioc_g_fmt_vbi_out) (struct file *file, void *fh,
55 int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
57 int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
59 int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,
61 int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,
63 int (*vidioc_g_fmt_sdr_cap) (struct file *file, void *fh,
65 int (*vidioc_g_fmt_sdr_out) (struct file *file, void *fh,
69 int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh,
71 int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh,
73 int (*vidioc_s_fmt_vid_out) (struct file *file, void *fh,
75 int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh,
77 int (*vidioc_s_fmt_vbi_cap) (struct file *file, void *fh,
79 int (*vidioc_s_fmt_vbi_out) (struct file *file, void *fh,
81 int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh,
83 int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh,
85 int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh,
87 int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh,
89 int (*vidioc_s_fmt_sdr_cap) (struct file *file, void *fh,
91 int (*vidioc_s_fmt_sdr_out) (struct file *file, void *fh,
95 int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh,
97 int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh,
99 int (*vidioc_try_fmt_vid_out) (struct file *file, void *fh,
101 int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh,
103 int (*vidioc_try_fmt_vbi_cap) (struct file *file, void *fh,
105 int (*vidioc_try_fmt_vbi_out) (struct file *file, void *fh,
107 int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh,
109 int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh,
111 int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh,
113 int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh,
115 int (*vidioc_try_fmt_sdr_cap) (struct file *file, void *fh,
117 int (*vidioc_try_fmt_sdr_out) (struct file *file, void *fh,
121 int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b);
122 int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b);
123 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
124 int (*vidioc_expbuf) (struct file *file, void *fh,
126 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
128 int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b);
129 int (*vidioc_prepare_buf)(struct file *file, void *fh, struct v4l2_buffer *b);
131 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
132 int (*vidioc_g_fbuf) (struct file *file, void *fh,
134 int (*vidioc_s_fbuf) (struct file *file, void *fh,
138 int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i);
139 int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);
144 int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
145 int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id norm);
146 int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
149 int (*vidioc_enum_input)(struct file *file, void *fh,
151 int (*vidioc_g_input) (struct file *file, void *fh, unsigned int *i);
152 int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i);
155 int (*vidioc_enum_output) (struct file *file, void *fh,
157 int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i);
158 int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i);
161 int (*vidioc_queryctrl) (struct file *file, void *fh,
163 int (*vidioc_query_ext_ctrl) (struct file *file, void *fh,
165 int (*vidioc_g_ctrl) (struct file *file, void *fh,
167 int (*vidioc_s_ctrl) (struct file *file, void *fh,
169 int (*vidioc_g_ext_ctrls) (struct file *file, void *fh,
171 int (*vidioc_s_ext_ctrls) (struct file *file, void *fh,
173 int (*vidioc_try_ext_ctrls) (struct file *file, void *fh,
175 int (*vidioc_querymenu) (struct file *file, void *fh,
179 int (*vidioc_enumaudio) (struct file *file, void *fh,
181 int (*vidioc_g_audio) (struct file *file, void *fh,
183 int (*vidioc_s_audio) (struct file *file, void *fh,
187 int (*vidioc_enumaudout) (struct file *file, void *fh,
189 int (*vidioc_g_audout) (struct file *file, void *fh,
191 int (*vidioc_s_audout) (struct file *file, void *fh,
193 int (*vidioc_g_modulator) (struct file *file, void *fh,
195 int (*vidioc_s_modulator) (struct file *file, void *fh,
198 int (*vidioc_cropcap) (struct file *file, void *fh,
200 int (*vidioc_g_crop) (struct file *file, void *fh,
202 int (*vidioc_s_crop) (struct file *file, void *fh,
204 int (*vidioc_g_selection) (struct file *file, void *fh,
206 int (*vidioc_s_selection) (struct file *file, void *fh,
209 int (*vidioc_g_jpegcomp) (struct file *file, void *fh,
211 int (*vidioc_s_jpegcomp) (struct file *file, void *fh,
213 int (*vidioc_g_enc_index) (struct file *file, void *fh,
215 int (*vidioc_encoder_cmd) (struct file *file, void *fh,
217 int (*vidioc_try_encoder_cmd) (struct file *file, void *fh,
219 int (*vidioc_decoder_cmd) (struct file *file, void *fh,
221 int (*vidioc_try_decoder_cmd) (struct file *file, void *fh,
225 int (*vidioc_g_parm) (struct file *file, void *fh,
227 int (*vidioc_s_parm) (struct file *file, void *fh,
231 int (*vidioc_g_tuner) (struct file *file, void *fh,
233 int (*vidioc_s_tuner) (struct file *file, void *fh,
235 int (*vidioc_g_frequency) (struct file *file, void *fh,
237 int (*vidioc_s_frequency) (struct file *file, void *fh,
239 int (*vidioc_enum_freq_bands) (struct file *file, void *fh,
243 int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh,
247 int (*vidioc_log_status) (struct file *file, void *fh);
249 int (*vidioc_s_hw_freq_seek) (struct file *file, void *fh,
254 int (*vidioc_g_register) (struct file *file, void *fh,
256 int (*vidioc_s_register) (struct file *file, void *fh,
259 int (*vidioc_g_chip_info) (struct file *file, void *fh,
263 int (*vidioc_enum_framesizes) (struct file *file, void *fh,
266 int (*vidioc_enum_frameintervals) (struct file *file, void *fh,
270 int (*vidioc_s_dv_timings) (struct file *file, void *fh,
272 int (*vidioc_g_dv_timings) (struct file *file, void *fh,
274 int (*vidioc_query_dv_timings) (struct file *file, void *fh,
276 int (*vidioc_enum_dv_timings) (struct file *file, void *fh,
278 int (*vidioc_dv_timings_cap) (struct file *file, void *fh,
280 int (*vidioc_g_edid) (struct file *file, void *fh, struct v4l2_edid *edid);
281 int (*vidioc_s_edid) (struct file *file, void *fh, struct v4l2_edid *edid);
289 long (*vidioc_default) (struct file *file, void *fh,
302 /* Log the file operations open, release, mmap and get_unmapped_area */
304 /* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */
329 extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
333 typedef long (*v4l2_kioctl)(struct file *file,
337 extern long video_usercopy(struct file *file, unsigned int cmd,
341 extern long video_ioctl2(struct file *file,
H A Dvideobuf2-v4l2.h69 unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait);
115 int vb2_ioctl_reqbufs(struct file *file, void *priv,
117 int vb2_ioctl_create_bufs(struct file *file, void *priv,
119 int vb2_ioctl_prepare_buf(struct file *file, void *priv,
121 int vb2_ioctl_querybuf(struct file *file, void *priv, struct v4l2_buffer *p);
122 int vb2_ioctl_qbuf(struct file *file, void *priv, struct v4l2_buffer *p);
123 int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p);
124 int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i);
125 int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i);
126 int vb2_ioctl_expbuf(struct file *file, void *priv,
131 int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma);
132 int vb2_fop_release(struct file *file);
133 int _vb2_fop_release(struct file *file, struct mutex *lock);
134 ssize_t vb2_fop_write(struct file *file, const char __user *buf,
136 ssize_t vb2_fop_read(struct file *file, char __user *buf,
138 unsigned int vb2_fop_poll(struct file *file, poll_table *wait);
140 unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr,
H A Dv4l2-mem2mem.h113 int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
116 int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
119 int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
121 int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
123 int v4l2_m2m_prepare_buf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
125 int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
128 int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
131 int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
133 int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
136 unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
139 int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
262 int v4l2_m2m_ioctl_reqbufs(struct file *file, void *priv,
264 int v4l2_m2m_ioctl_create_bufs(struct file *file, void *fh,
266 int v4l2_m2m_ioctl_querybuf(struct file *file, void *fh,
268 int v4l2_m2m_ioctl_expbuf(struct file *file, void *fh,
270 int v4l2_m2m_ioctl_qbuf(struct file *file, void *fh,
272 int v4l2_m2m_ioctl_dqbuf(struct file *file, void *fh,
274 int v4l2_m2m_ioctl_prepare_buf(struct file *file, void *fh,
276 int v4l2_m2m_ioctl_streamon(struct file *file, void *fh,
278 int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh,
280 int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma);
281 unsigned int v4l2_m2m_fop_poll(struct file *file, poll_table *wait);
/linux-4.4.14/fs/ocfs2/
H A Dmmap.h4 int ocfs2_mmap(struct file *file, struct vm_area_struct *vma);
H A Dioctl.h13 long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
14 long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);
H A Dlocks.c6 * Userspace file locking support
34 #include "file.h"
38 static int ocfs2_do_flock(struct file *file, struct inode *inode, ocfs2_do_flock() argument
42 struct ocfs2_file_private *fp = file->private_data; ocfs2_do_flock()
69 locks_lock_file_wait(file, ocfs2_do_flock()
75 ocfs2_file_unlock(file); ocfs2_do_flock()
78 ret = ocfs2_file_lock(file, level, trylock); ocfs2_do_flock()
87 ret = locks_lock_file_wait(file, fl); ocfs2_do_flock()
89 ocfs2_file_unlock(file); ocfs2_do_flock()
97 static int ocfs2_do_funlock(struct file *file, int cmd, struct file_lock *fl) ocfs2_do_funlock() argument
100 struct ocfs2_file_private *fp = file->private_data; ocfs2_do_funlock()
103 ocfs2_file_unlock(file); ocfs2_do_funlock()
104 ret = locks_lock_file_wait(file, fl); ocfs2_do_funlock()
113 int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl) ocfs2_flock() argument
115 struct inode *inode = file->f_mapping->host; ocfs2_flock()
125 return locks_lock_file_wait(file, fl); ocfs2_flock()
128 return ocfs2_do_funlock(file, cmd, fl); ocfs2_flock()
130 return ocfs2_do_flock(file, inode, cmd, fl); ocfs2_flock()
133 int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl) ocfs2_lock() argument
135 struct inode *inode = file->f_mapping->host; ocfs2_lock()
143 return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl); ocfs2_lock()
/linux-4.4.14/drivers/media/platform/vivid/
H A Dvivid-vid-out.h27 int vivid_g_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *f);
28 int vivid_try_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *f);
29 int vivid_s_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *f);
30 int vidioc_g_fmt_vid_out_mplane(struct file *file, void *priv, struct v4l2_format *f);
31 int vidioc_try_fmt_vid_out_mplane(struct file *file, void *priv, struct v4l2_format *f);
32 int vidioc_s_fmt_vid_out_mplane(struct file *file, void *priv, struct v4l2_format *f);
33 int vidioc_g_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *f);
34 int vidioc_try_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *f);
35 int vidioc_s_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *f);
36 int vivid_vid_out_g_selection(struct file *file, void *priv, struct v4l2_selection *sel);
37 int vivid_vid_out_s_selection(struct file *file, void *fh, struct v4l2_selection *s);
38 int vivid_vid_out_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cap);
39 int vidioc_enum_fmt_vid_out_overlay(struct file *file, void *priv, struct v4l2_fmtdesc *f);
40 int vidioc_g_fmt_vid_out_overlay(struct file *file, void *priv, struct v4l2_format *f);
41 int vidioc_try_fmt_vid_out_overlay(struct file *file, void *priv, struct v4l2_format *f);
42 int vidioc_s_fmt_vid_out_overlay(struct file *file, void *priv, struct v4l2_format *f);
43 int vivid_vid_out_overlay(struct file *file, void *fh, unsigned i);
44 int vivid_vid_out_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *a);
45 int vivid_vid_out_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *a);
46 int vidioc_enum_output(struct file *file, void *priv, struct v4l2_output *out);
47 int vidioc_g_output(struct file *file, void *priv, unsigned *i);
48 int vidioc_s_output(struct file *file, void *priv, unsigned i);
49 int vidioc_enumaudout(struct file *file, void *fh, struct v4l2_audioout *vout);
50 int vidioc_g_audout(struct file *file, void *fh, struct v4l2_audioout *vout);
51 int vidioc_s_audout(struct file *file, void *fh, const struct v4l2_audioout *vout);
52 int vivid_vid_out_s_std(struct file *file, void *priv, v4l2_std_id id);
53 int vivid_vid_out_s_dv_timings(struct file *file, void *_fh, struct v4l2_dv_timings *timings);
54 int vivid_vid_out_g_parm(struct file *file, void *priv, struct v4l2_streamparm *parm);
H A Dvivid-vid-cap.h32 int vivid_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f);
33 int vivid_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f);
34 int vivid_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f);
35 int vidioc_g_fmt_vid_cap_mplane(struct file *file, void *priv, struct v4l2_format *f);
36 int vidioc_try_fmt_vid_cap_mplane(struct file *file, void *priv, struct v4l2_format *f);
37 int vidioc_s_fmt_vid_cap_mplane(struct file *file, void *priv, struct v4l2_format *f);
38 int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f);
39 int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f);
40 int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f);
41 int vivid_vid_cap_g_selection(struct file *file, void *priv, struct v4l2_selection *sel);
42 int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selection *s);
43 int vivid_vid_cap_cropcap(struct file *file, void *priv, struct v4l2_cropcap *cap);
44 int vidioc_enum_fmt_vid_overlay(struct file *file, void *priv, struct v4l2_fmtdesc *f);
45 int vidioc_g_fmt_vid_overlay(struct file *file, void *priv, struct v4l2_format *f);
46 int vidioc_try_fmt_vid_overlay(struct file *file, void *priv, struct v4l2_format *f);
47 int vidioc_s_fmt_vid_overlay(struct file *file, void *priv, struct v4l2_format *f);
48 int vivid_vid_cap_overlay(struct file *file, void *fh, unsigned i);
49 int vivid_vid_cap_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *a);
50 int vivid_vid_cap_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *a);
51 int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *inp);
52 int vidioc_g_input(struct file *file, void *priv, unsigned *i);
53 int vidioc_s_input(struct file *file, void *priv, unsigned i);
54 int vidioc_enumaudio(struct file *file, void *fh, struct v4l2_audio *vin);
55 int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *vin);
56 int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *vin);
57 int vivid_video_g_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
58 int vivid_video_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
59 int vivid_video_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt);
60 int vivid_video_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt);
61 int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *id);
62 int vivid_vid_cap_s_std(struct file *file, void *priv, v4l2_std_id id);
63 int vivid_vid_cap_s_dv_timings(struct file *file, void *_fh, struct v4l2_dv_timings *timings);
64 int vidioc_query_dv_timings(struct file *file, void *_fh, struct v4l2_dv_timings *timings);
65 int vidioc_s_edid(struct file *file, void *_fh, struct v4l2_edid *edid);
66 int vidioc_enum_framesizes(struct file *file, void *fh, struct v4l2_frmsizeenum *fsize);
67 int vidioc_enum_frameintervals(struct file *file, void *priv, struct v4l2_frmivalenum *fival);
68 int vivid_vid_cap_g_parm(struct file *file, void *priv, struct v4l2_streamparm *parm);
69 int vivid_vid_cap_s_parm(struct file *file, void *priv, struct v4l2_streamparm *parm);
H A Dvivid-sdr-cap.h23 int vivid_sdr_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band);
24 int vivid_sdr_g_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
25 int vivid_sdr_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf);
26 int vivid_sdr_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt);
27 int vivid_sdr_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt);
28 int vidioc_enum_fmt_sdr_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f);
29 int vidioc_g_fmt_sdr_cap(struct file *file, void *fh, struct v4l2_format *f);
30 int vidioc_s_fmt_sdr_cap(struct file *file, void *fh, struct v4l2_format *f);
31 int vidioc_try_fmt_sdr_cap(struct file *file, void *fh, struct v4l2_format *f);
H A Dvivid-vbi-cap.h27 int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,
29 int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,
31 int vidioc_g_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_format *fmt);
32 int vidioc_try_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_format *fmt);
33 int vidioc_s_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_format *fmt);
34 int vidioc_g_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_sliced_vbi_cap *cap);
H A Dvivid-vid-common.h23 typedef int (*fmtfunc)(struct file *file, void *priv, struct v4l2_format *f);
30 int fmt_sp2mp_func(struct file *file, void *priv,
51 int vivid_enum_fmt_vid(struct file *file, void *priv, struct v4l2_fmtdesc *f);
52 int vidioc_enum_fmt_vid_mplane(struct file *file, void *priv, struct v4l2_fmtdesc *f);
53 int vidioc_enum_fmt_vid(struct file *file, void *priv, struct v4l2_fmtdesc *f);
54 int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id);
55 int vidioc_g_dv_timings(struct file *file, void *_fh, struct v4l2_dv_timings *timings);
56 int vidioc_enum_dv_timings(struct file *file, void *_fh, struct v4l2_enum_dv_timings *timings);
57 int vidioc_dv_timings_cap(struct file *file, void *_fh, struct v4l2_dv_timings_cap *cap);
58 int vidioc_g_edid(struct file *file, void *_fh, struct v4l2_edid *edid);
H A Dvivid-radio-rx.h23 ssize_t vivid_radio_rx_read(struct file *, char __user *, size_t, loff_t *);
24 unsigned int vivid_radio_rx_poll(struct file *file, struct poll_table_struct *wait);
26 int vivid_radio_rx_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band);
27 int vivid_radio_rx_s_hw_freq_seek(struct file *file, void *fh, const struct v4l2_hw_freq_seek *a);
28 int vivid_radio_rx_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt);
29 int vivid_radio_rx_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt);
H A Dvivid-vbi-out.h24 int vidioc_g_fmt_vbi_out(struct file *file, void *priv,
26 int vidioc_s_fmt_vbi_out(struct file *file, void *priv,
28 int vidioc_g_fmt_sliced_vbi_out(struct file *file, void *fh, struct v4l2_format *fmt);
29 int vidioc_try_fmt_sliced_vbi_out(struct file *file, void *fh, struct v4l2_format *fmt);
30 int vidioc_s_fmt_sliced_vbi_out(struct file *file, void *fh, struct v4l2_format *fmt);
/linux-4.4.14/tools/perf/util/
H A Ddata.h20 static inline bool perf_data_file__is_read(struct perf_data_file *file) perf_data_file__is_read() argument
22 return file->mode == PERF_DATA_MODE_READ; perf_data_file__is_read()
25 static inline bool perf_data_file__is_write(struct perf_data_file *file) perf_data_file__is_write() argument
27 return file->mode == PERF_DATA_MODE_WRITE; perf_data_file__is_write()
30 static inline int perf_data_file__is_pipe(struct perf_data_file *file) perf_data_file__is_pipe() argument
32 return file->is_pipe; perf_data_file__is_pipe()
35 static inline int perf_data_file__fd(struct perf_data_file *file) perf_data_file__fd() argument
37 return file->fd; perf_data_file__fd()
40 static inline unsigned long perf_data_file__size(struct perf_data_file *file) perf_data_file__size() argument
42 return file->size; perf_data_file__size()
45 int perf_data_file__open(struct perf_data_file *file);
46 void perf_data_file__close(struct perf_data_file *file);
47 ssize_t perf_data_file__write(struct perf_data_file *file,
H A Ddata.c12 static bool check_pipe(struct perf_data_file *file) check_pipe() argument
16 int fd = perf_data_file__is_read(file) ? check_pipe()
19 if (!file->path) { check_pipe()
23 if (!strcmp(file->path, "-")) check_pipe()
28 file->fd = fd; check_pipe()
30 return file->is_pipe = is_pipe; check_pipe()
33 static int check_backup(struct perf_data_file *file) check_backup() argument
37 if (!stat(file->path, &st) && st.st_size) { check_backup()
41 file->path); check_backup()
43 rename(file->path, oldname); check_backup()
49 static int open_file_read(struct perf_data_file *file) open_file_read() argument
55 fd = open(file->path, O_RDONLY); open_file_read()
59 pr_err("failed to open %s: %s", file->path, open_file_read()
61 if (err == ENOENT && !strcmp(file->path, "perf.data")) open_file_read()
70 if (!file->force && st.st_uid && (st.st_uid != geteuid())) { open_file_read()
72 file->path); open_file_read()
77 pr_info("zero-sized file (%s), nothing to do!\n", open_file_read()
78 file->path); open_file_read()
82 file->size = st.st_size; open_file_read()
90 static int open_file_write(struct perf_data_file *file) open_file_write() argument
95 if (check_backup(file)) open_file_write()
98 fd = open(file->path, O_CREAT|O_RDWR|O_TRUNC, S_IRUSR|S_IWUSR); open_file_write()
101 pr_err("failed to open %s : %s\n", file->path, open_file_write()
107 static int open_file(struct perf_data_file *file) open_file() argument
111 fd = perf_data_file__is_read(file) ? open_file()
112 open_file_read(file) : open_file_write(file); open_file()
114 file->fd = fd; open_file()
118 int perf_data_file__open(struct perf_data_file *file) perf_data_file__open() argument
120 if (check_pipe(file)) perf_data_file__open()
123 if (!file->path) perf_data_file__open()
124 file->path = "perf.data"; perf_data_file__open()
126 return open_file(file); perf_data_file__open()
129 void perf_data_file__close(struct perf_data_file *file) perf_data_file__close() argument
131 close(file->fd); perf_data_file__close()
134 ssize_t perf_data_file__write(struct perf_data_file *file, perf_data_file__write() argument
137 return writen(file->fd, buf, size); perf_data_file__write()
/linux-4.4.14/tools/testing/selftests/efivarfs/
H A Defivarfs.sh46 local file=$efivarfs_mount/$FUNCNAME-$test_guid
48 printf "$attrs\x00" > $file
50 if [ ! -e $file ]; then
51 echo "$file couldn't be created" >&2
55 if [ $(stat -c %s $file) -ne 5 ]; then
56 echo "$file has invalid size" >&2
63 local file=$efivarfs_mount/$FUNCNAME-$test_guid
65 : > $file
67 if [ ! -e $file ]; then
68 echo "$file can not be created without writing" >&2
75 local file=$efivarfs_mount/$FUNCNAME-$test_guid
76 ./create-read $file
82 local file=$efivarfs_mount/$FUNCNAME-$test_guid
84 printf "$attrs\x00" > $file
86 if [ ! -e $file ]; then
87 echo "$file couldn't be created" >&2
91 rm $file 2>/dev/null
93 chattr -i $file
94 rm $file
97 if [ -e $file ]; then
98 echo "$file couldn't be deleted" >&2
109 local file=$efivarfs_mount/$FUNCNAME-$test_guid
111 printf "$attrs\x00" > $file
113 if [ ! -e $file ]; then
114 echo "$file does not exist" >&2
118 chattr -i $file
119 printf "$attrs" > $file
121 if [ -e $file ]; then
122 echo "$file should have been deleted" >&2
129 local file=$efivarfs_mount/$FUNCNAME-$test_guid
130 ./open-unlink $file
141 local file=$efivarfs_mount/$f-$test_guid
143 printf "$attrs\x00" > $file
145 if [ ! -e $file ]; then
146 echo "$file could not be created" >&2
149 rm $file 2>/dev/null
151 chattr -i $file
152 rm $file
180 local file=$efivarfs_mount/$f
182 printf "$attrs\x00" 2>/dev/null > $file
184 if [ -e $file ]; then
185 echo "Creating $file should have failed" >&2
186 rm $file 2>/dev/null
188 chattr -i $file
189 rm $file
/linux-4.4.14/fs/omfs/
H A DMakefile4 omfs-y := bitmap.o dir.o file.o inode.o
/linux-4.4.14/drivers/xen/xenfs/
H A Dxenstored.c11 static ssize_t xsd_read(struct file *file, char __user *buf, xsd_read() argument
14 const char *str = (const char *)file->private_data; xsd_read()
18 static int xsd_release(struct inode *inode, struct file *file) xsd_release() argument
20 kfree(file->private_data); xsd_release()
24 static int xsd_kva_open(struct inode *inode, struct file *file) xsd_kva_open() argument
26 file->private_data = (void *)kasprintf(GFP_KERNEL, "0x%p", xsd_kva_open()
28 if (!file->private_data) xsd_kva_open()
33 static int xsd_kva_mmap(struct file *file, struct vm_area_struct *vma) xsd_kva_mmap() argument
55 static int xsd_port_open(struct inode *inode, struct file *file) xsd_port_open() argument
57 file->private_data = (void *)kasprintf(GFP_KERNEL, "%d", xsd_port_open()
59 if (!file->private_data) xsd_port_open()
/linux-4.4.14/include/linux/
H A Dfile.h12 struct file;
14 extern void fput(struct file *);
20 extern struct file *alloc_file(struct path *, fmode_t mode,
23 static inline void fput_light(struct file *file, int fput_needed) fput_light() argument
26 fput(file); fput_light()
30 struct file *file; member in struct:fd
39 fput(fd.file); fdput()
42 extern struct file *fget(unsigned int fd);
43 extern struct file *fget_raw(unsigned int fd);
50 return (struct fd){(struct file *)(v & ~3),v & 3}; __to_fd()
63 extern int f_dupfd(unsigned int from, struct file *file, unsigned flags);
64 extern int replace_fd(unsigned fd, struct file *file, unsigned flags);
67 extern void put_filp(struct file *);
71 extern void fd_install(unsigned int fd, struct file *file);
74 extern void __fput_sync(struct file *);
H A Dima.h18 extern int ima_file_check(struct file *file, int mask, int opened);
19 extern void ima_file_free(struct file *file);
20 extern int ima_file_mmap(struct file *file, unsigned long prot);
21 extern int ima_module_check(struct file *file);
22 extern int ima_fw_from_file(struct file *file, char *buf, size_t size);
30 static inline int ima_file_check(struct file *file, int mask, int opened) ima_file_check() argument
35 static inline void ima_file_free(struct file *file) ima_file_free() argument
40 static inline int ima_file_mmap(struct file *file, unsigned long prot) ima_file_mmap() argument
45 static inline int ima_module_check(struct file *file) ima_module_check() argument
50 static inline int ima_fw_from_file(struct file *file, char *buf, size_t size) ima_fw_from_file() argument
H A Ddlm_plock.h13 int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
15 int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
17 int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
H A Deventpoll.h20 struct file;
25 /* Used to initialize the epoll bits inside the "struct file" */ eventpoll_init_file()
26 static inline void eventpoll_init_file(struct file *file) eventpoll_init_file() argument
28 INIT_LIST_HEAD(&file->f_ep_links); eventpoll_init_file()
29 INIT_LIST_HEAD(&file->f_tfile_llink); eventpoll_init_file()
33 /* Used to release the epoll bits inside the "struct file" */
34 void eventpoll_release_file(struct file *file);
42 static inline void eventpoll_release(struct file *file) eventpoll_release() argument
50 * because the file in on the way to be removed and nobody ( but eventpoll_release()
51 * eventpoll ) has still a reference to this file. eventpoll_release()
53 if (likely(list_empty(&file->f_ep_links))) eventpoll_release()
57 * The file is being closed while it is still linked to an epoll eventpoll_release()
61 eventpoll_release_file(file); eventpoll_release()
66 static inline void eventpoll_init_file(struct file *file) {} eventpoll_release() argument
67 static inline void eventpoll_release(struct file *file) {} argument
H A Dseq_file_net.h15 int seq_open_net(struct inode *, struct file *,
17 int single_open_net(struct inode *, struct file *file,
19 int seq_release_net(struct inode *, struct file *);
20 int single_release_net(struct inode *, struct file *); seq_file_net()
H A Ddnotify.h15 struct file * dn_filp;
32 extern void dnotify_flush(struct file *, fl_owner_t);
33 extern int fcntl_dirnotify(int, struct file *, unsigned long);
37 static inline void dnotify_flush(struct file *filp, fl_owner_t id) dnotify_flush()
41 static inline int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) fcntl_dirnotify()
H A Dshmem_fs.h4 #include <linux/file.h>
17 unsigned long alloced; /* data pages alloced to file */
47 extern struct file *shmem_file_setup(const char *name,
49 extern struct file *shmem_kernel_file_setup(const char *name, loff_t size,
52 extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
69 extern int shmem_add_seals(struct file *file, unsigned int seals);
70 extern int shmem_get_seals(struct file *file);
71 extern long shmem_fcntl(struct file *file, unsigned int cmd, unsigned long arg);
75 static inline long shmem_fcntl(struct file *f, unsigned int c, unsigned long a) shmem_fcntl()
H A Dstmp3xxx_rtc_wdt.h6 * This file is released under the GPLv2.
H A Drtc-ds2404.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/fs/
H A Dfile_table.c10 #include <linux/file.h>
39 /* SLAB cache for file structures */
46 struct file *f = container_of(head, struct file, f_u.fu_rcuhead); file_free_rcu()
52 static inline void file_free(struct file *f) file_free()
93 /* Find an unused file structure and return a pointer to it.
94 * Returns an error pointer if some error happend e.g. we over file
103 struct file *get_empty_filp(void) get_empty_filp()
107 struct file *f; get_empty_filp()
145 pr_info("VFS: file-max limit %lu reached\n", get_max_files()); get_empty_filp()
152 * alloc_file - allocate and initialize a 'struct file'
154 * @path: the (dentry, vfsmount) pair for the new file
155 * @mode: the mode with which the new file will be opened
156 * @fop: the 'struct file_operations' for the new file
158 struct file *alloc_file(struct path *path, fmode_t mode, alloc_file()
161 struct file *file; alloc_file() local
163 file = get_empty_filp(); alloc_file()
164 if (IS_ERR(file)) alloc_file()
165 return file; alloc_file()
167 file->f_path = *path; alloc_file()
168 file->f_inode = path->dentry->d_inode; alloc_file()
169 file->f_mapping = path->dentry->d_inode->i_mapping; alloc_file()
176 file->f_mode = mode; alloc_file()
177 file->f_op = fop; alloc_file()
180 return file; alloc_file()
184 /* the real guts of fput() - releasing the last reference to file
186 static void __fput(struct file *file) __fput() argument
188 struct dentry *dentry = file->f_path.dentry; __fput()
189 struct vfsmount *mnt = file->f_path.mnt; __fput()
190 struct inode *inode = file->f_inode; __fput()
194 fsnotify_close(file); __fput()
197 * in the file cleanup chain. __fput()
199 eventpoll_release(file); __fput()
200 locks_remove_file(file); __fput()
202 if (unlikely(file->f_flags & FASYNC)) { __fput()
203 if (file->f_op->fasync) __fput()
204 file->f_op->fasync(-1, file, 0); __fput()
206 ima_file_free(file); __fput()
207 if (file->f_op->release) __fput()
208 file->f_op->release(inode, file); __fput()
209 security_file_free(file); __fput()
211 !(file->f_mode & FMODE_PATH))) { __fput()
214 fops_put(file->f_op); __fput()
215 put_pid(file->f_owner.pid); __fput()
216 if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) __fput()
218 if (file->f_mode & FMODE_WRITER) { __fput()
222 file->f_path.dentry = NULL; __fput()
223 file->f_path.mnt = NULL; __fput()
224 file->f_inode = NULL; __fput()
225 file_free(file); __fput()
238 __fput(llist_entry(node, struct file, f_u.fu_llist)); delayed_fput()
244 __fput(container_of(work, struct file, f_u.fu_rcuhead)); ____fput()
251 * not left us with opened struct file waiting for __fput() - execve()
264 void fput(struct file *file) fput() argument
266 if (atomic_long_dec_and_test(&file->f_count)) { fput()
270 init_task_work(&file->f_u.fu_rcuhead, ____fput); fput()
271 if (!task_work_add(task, &file->f_u.fu_rcuhead, true)) fput()
276 * fput to avoid leaking *file. fput()
280 if (llist_add(&file->f_u.fu_llist, &delayed_fput_list)) fput()
289 * for this specific struct file it won't involve anything that would
293 void __fput_sync(struct file *file) __fput_sync() argument
295 if (atomic_long_dec_and_test(&file->f_count)) { __fput_sync()
298 __fput(file); __fput_sync()
304 void put_filp(struct file *file) put_filp() argument
306 if (atomic_long_dec_and_test(&file->f_count)) { put_filp()
307 security_file_free(file); put_filp()
308 file_free(file); put_filp()
314 filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, files_init()
320 * One file with associated inode and dcache is very roughly 1K. Per default
H A Dread_write.c10 #include <linux/file.h>
24 typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
36 static inline int unsigned_offsets(struct file *file) unsigned_offsets() argument
38 return file->f_mode & FMODE_UNSIGNED_OFFSET; unsigned_offsets()
42 * vfs_setpos - update the file offset for lseek
43 * @file: file structure in question
44 * @offset: file offset to seek to
45 * @maxsize: maximum file size
47 * This is a low-level filesystem helper for updating the file offset to
49 * not equal to the current file offset.
53 loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize) vfs_setpos() argument
55 if (offset < 0 && !unsigned_offsets(file)) vfs_setpos()
60 if (offset != file->f_pos) { vfs_setpos()
61 file->f_pos = offset; vfs_setpos()
62 file->f_version = 0; vfs_setpos()
70 * @file: file structure to seek on
71 * @offset: file offset to seek to
73 * @size: max size of this file in file system
77 * maximum file size and a custom EOF position, for e.g. hashed directories
85 generic_file_llseek_size(struct file *file, loff_t offset, int whence, generic_file_llseek_size() argument
96 * f_pos value back to the file because a concurrent read(), generic_file_llseek_size()
100 return file->f_pos; generic_file_llseek_size()
106 spin_lock(&file->f_lock); generic_file_llseek_size()
107 offset = vfs_setpos(file, file->f_pos + offset, maxsize); generic_file_llseek_size()
108 spin_unlock(&file->f_lock); generic_file_llseek_size()
112 * In the generic case the entire file is data, so as long as generic_file_llseek_size()
113 * offset isn't at the end of the file then the offset is data. generic_file_llseek_size()
120 * There is a virtual hole at the end of the file, so as long as generic_file_llseek_size()
129 return vfs_setpos(file, offset, maxsize); generic_file_llseek_size()
135 * @file: file structure to seek on
136 * @offset: file offset to seek to
140 * filesystems. It just updates the file offset to the value specified by
143 loff_t generic_file_llseek(struct file *file, loff_t offset, int whence) generic_file_llseek() argument
145 struct inode *inode = file->f_mapping->host; generic_file_llseek()
147 return generic_file_llseek_size(file, offset, whence, generic_file_llseek()
155 * @file: file structure to seek on
156 * @offset: file offset to seek to
158 * @size: size of the file
161 loff_t fixed_size_llseek(struct file *file, loff_t offset, int whence, loff_t size) fixed_size_llseek() argument
165 return generic_file_llseek_size(file, offset, whence, fixed_size_llseek()
175 * @file: file structure to seek on
176 * @offset: file offset to seek to
180 * userspace expects the seek to succeed but the (device) file is actually not
184 loff_t noop_llseek(struct file *file, loff_t offset, int whence) noop_llseek() argument
186 return file->f_pos; noop_llseek()
190 loff_t no_llseek(struct file *file, loff_t offset, int whence) no_llseek() argument
196 loff_t default_llseek(struct file *file, loff_t offset, int whence) default_llseek() argument
198 struct inode *inode = file_inode(file); default_llseek()
208 retval = file->f_pos; default_llseek()
211 offset += file->f_pos; default_llseek()
215 * In the generic case the entire file is data, so as default_llseek()
216 * long as offset isn't at the end of the file then the default_llseek()
226 * There is a virtual hole at the end of the file, so default_llseek()
238 if (offset >= 0 || unsigned_offsets(file)) { default_llseek()
239 if (offset != file->f_pos) { default_llseek()
240 file->f_pos = offset; default_llseek()
241 file->f_version = 0; default_llseek()
251 loff_t vfs_llseek(struct file *file, loff_t offset, int whence) vfs_llseek() argument
253 loff_t (*fn)(struct file *, loff_t, int); vfs_llseek()
256 if (file->f_mode & FMODE_LSEEK) { vfs_llseek()
257 if (file->f_op->llseek) vfs_llseek()
258 fn = file->f_op->llseek; vfs_llseek()
260 return fn(file, offset, whence); vfs_llseek()
272 mutex_unlock(&f.file->f_pos_lock); fdput_pos()
280 if (!f.file) SYSCALL_DEFINE3()
285 loff_t res = vfs_llseek(f.file, offset, whence); SYSCALL_DEFINE3()
310 if (!f.file) SYSCALL_DEFINE5()
317 offset = vfs_llseek(f.file, ((loff_t) offset_high << 32) | offset_low, SYSCALL_DEFINE5()
332 ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos) vfs_iter_read() argument
337 if (!file->f_op->read_iter) vfs_iter_read()
340 init_sync_kiocb(&kiocb, file); vfs_iter_read()
344 ret = file->f_op->read_iter(&kiocb, iter); vfs_iter_read()
352 ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos) vfs_iter_write() argument
357 if (!file->f_op->write_iter) vfs_iter_write()
360 init_sync_kiocb(&kiocb, file); vfs_iter_write()
364 ret = file->f_op->write_iter(&kiocb, iter); vfs_iter_write()
377 int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t count) rw_verify_area() argument
383 inode = file_inode(file); rw_verify_area()
388 if (!unsigned_offsets(file)) rw_verify_area()
393 if (!unsigned_offsets(file)) rw_verify_area()
400 inode, file, pos, count); rw_verify_area()
404 retval = security_file_permission(file, rw_verify_area()
411 static ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos) new_sync_read()
428 ssize_t __vfs_read(struct file *file, char __user *buf, size_t count, __vfs_read() argument
431 if (file->f_op->read) __vfs_read()
432 return file->f_op->read(file, buf, count, pos); __vfs_read()
433 else if (file->f_op->read_iter) __vfs_read()
434 return new_sync_read(file, buf, count, pos); __vfs_read()
440 ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) vfs_read() argument
444 if (!(file->f_mode & FMODE_READ)) vfs_read()
446 if (!(file->f_mode & FMODE_CAN_READ)) vfs_read()
451 ret = rw_verify_area(READ, file, pos, count); vfs_read()
454 ret = __vfs_read(file, buf, count, pos); vfs_read()
456 fsnotify_access(file); vfs_read()
467 static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos) new_sync_write()
485 ssize_t __vfs_write(struct file *file, const char __user *p, size_t count, __vfs_write() argument
488 if (file->f_op->write) __vfs_write()
489 return file->f_op->write(file, p, count, pos); __vfs_write()
490 else if (file->f_op->write_iter) __vfs_write()
491 return new_sync_write(file, p, count, pos); __vfs_write()
497 ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) __kernel_write() argument
503 if (!(file->f_mode & FMODE_CAN_WRITE)) __kernel_write()
511 ret = __vfs_write(file, p, count, pos); __kernel_write()
514 fsnotify_modify(file); __kernel_write()
523 ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) vfs_write() argument
527 if (!(file->f_mode & FMODE_WRITE)) vfs_write()
529 if (!(file->f_mode & FMODE_CAN_WRITE)) vfs_write()
534 ret = rw_verify_area(WRITE, file, pos, count); vfs_write()
537 file_start_write(file); vfs_write()
538 ret = __vfs_write(file, buf, count, pos); vfs_write()
540 fsnotify_modify(file); vfs_write()
544 file_end_write(file); vfs_write()
552 static inline loff_t file_pos_read(struct file *file) file_pos_read() argument
554 return file->f_pos; file_pos_read()
557 static inline void file_pos_write(struct file *file, loff_t pos) file_pos_write() argument
559 file->f_pos = pos; file_pos_write()
567 if (f.file) { SYSCALL_DEFINE3()
568 loff_t pos = file_pos_read(f.file); SYSCALL_DEFINE3()
569 ret = vfs_read(f.file, buf, count, &pos); SYSCALL_DEFINE3()
571 file_pos_write(f.file, pos); SYSCALL_DEFINE3()
583 if (f.file) { SYSCALL_DEFINE3()
584 loff_t pos = file_pos_read(f.file); SYSCALL_DEFINE3()
585 ret = vfs_write(f.file, buf, count, &pos); SYSCALL_DEFINE3()
587 file_pos_write(f.file, pos); SYSCALL_DEFINE3()
604 if (f.file) { SYSCALL_DEFINE4()
606 if (f.file->f_mode & FMODE_PREAD) SYSCALL_DEFINE4()
607 ret = vfs_read(f.file, buf, count, &pos); SYSCALL_DEFINE4()
624 if (f.file) { SYSCALL_DEFINE4()
626 if (f.file->f_mode & FMODE_PWRITE) SYSCALL_DEFINE4()
627 ret = vfs_write(f.file, buf, count, &pos); SYSCALL_DEFINE4()
655 static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter, do_iter_readv_writev()
670 /* Do it by hand, with file-ops */ do_loop_readv_writev()
671 static ssize_t do_loop_readv_writev(struct file *filp, struct iov_iter *iter, do_loop_readv_writev()
774 static ssize_t do_readv_writev(int type, struct file *file, do_readv_writev() argument
794 ret = rw_verify_area(type, file, pos, tot_len); do_readv_writev()
799 fn = file->f_op->read; do_readv_writev()
800 iter_fn = file->f_op->read_iter; do_readv_writev()
802 fn = (io_fn_t)file->f_op->write; do_readv_writev()
803 iter_fn = file->f_op->write_iter; do_readv_writev()
804 file_start_write(file); do_readv_writev()
808 ret = do_iter_readv_writev(file, &iter, pos, iter_fn); do_readv_writev()
810 ret = do_loop_readv_writev(file, &iter, pos, fn); do_readv_writev()
813 file_end_write(file); do_readv_writev()
819 fsnotify_access(file); do_readv_writev()
821 fsnotify_modify(file); do_readv_writev()
826 ssize_t vfs_readv(struct file *file, const struct iovec __user *vec, vfs_readv() argument
829 if (!(file->f_mode & FMODE_READ)) vfs_readv()
831 if (!(file->f_mode & FMODE_CAN_READ)) vfs_readv()
834 return do_readv_writev(READ, file, vec, vlen, pos); vfs_readv()
839 ssize_t vfs_writev(struct file *file, const struct iovec __user *vec, vfs_writev() argument
842 if (!(file->f_mode & FMODE_WRITE)) vfs_writev()
844 if (!(file->f_mode & FMODE_CAN_WRITE)) vfs_writev()
847 return do_readv_writev(WRITE, file, vec, vlen, pos); vfs_writev()
858 if (f.file) { SYSCALL_DEFINE3()
859 loff_t pos = file_pos_read(f.file); SYSCALL_DEFINE3()
860 ret = vfs_readv(f.file, vec, vlen, &pos); SYSCALL_DEFINE3()
862 file_pos_write(f.file, pos); SYSCALL_DEFINE3()
878 if (f.file) { SYSCALL_DEFINE3()
879 loff_t pos = file_pos_read(f.file); SYSCALL_DEFINE3()
880 ret = vfs_writev(f.file, vec, vlen, &pos); SYSCALL_DEFINE3()
882 file_pos_write(f.file, pos); SYSCALL_DEFINE3()
909 if (f.file) { SYSCALL_DEFINE5()
911 if (f.file->f_mode & FMODE_PREAD) SYSCALL_DEFINE5()
912 ret = vfs_readv(f.file, vec, vlen, &pos); SYSCALL_DEFINE5()
933 if (f.file) { SYSCALL_DEFINE5()
935 if (f.file->f_mode & FMODE_PWRITE) SYSCALL_DEFINE5()
936 ret = vfs_writev(f.file, vec, vlen, &pos); SYSCALL_DEFINE5()
948 static ssize_t compat_do_readv_writev(int type, struct file *file, compat_do_readv_writev() argument
968 ret = rw_verify_area(type, file, pos, tot_len); compat_do_readv_writev()
973 fn = file->f_op->read; compat_do_readv_writev()
974 iter_fn = file->f_op->read_iter; compat_do_readv_writev()
976 fn = (io_fn_t)file->f_op->write; compat_do_readv_writev()
977 iter_fn = file->f_op->write_iter; compat_do_readv_writev()
978 file_start_write(file); compat_do_readv_writev()
982 ret = do_iter_readv_writev(file, &iter, pos, iter_fn); compat_do_readv_writev()
984 ret = do_loop_readv_writev(file, &iter, pos, fn); compat_do_readv_writev()
987 file_end_write(file); compat_do_readv_writev()
993 fsnotify_access(file); compat_do_readv_writev()
995 fsnotify_modify(file); compat_do_readv_writev()
1000 static size_t compat_readv(struct file *file, compat_readv() argument
1006 if (!(file->f_mode & FMODE_READ)) compat_readv()
1010 if (!(file->f_mode & FMODE_CAN_READ)) compat_readv()
1013 ret = compat_do_readv_writev(READ, file, vec, vlen, pos); compat_readv()
1030 if (!f.file) COMPAT_SYSCALL_DEFINE3()
1032 pos = f.file->f_pos; COMPAT_SYSCALL_DEFINE3()
1033 ret = compat_readv(f.file, vec, vlen, &pos); COMPAT_SYSCALL_DEFINE3()
1035 f.file->f_pos = pos; COMPAT_SYSCALL_DEFINE3()
1050 if (!f.file) __compat_sys_preadv64()
1053 if (f.file->f_mode & FMODE_PREAD) __compat_sys_preadv64()
1054 ret = compat_readv(f.file, vec, vlen, &pos); __compat_sys_preadv64()
1077 static size_t compat_writev(struct file *file, compat_writev() argument
1083 if (!(file->f_mode & FMODE_WRITE)) compat_writev()
1087 if (!(file->f_mode & FMODE_CAN_WRITE)) compat_writev()
1090 ret = compat_do_readv_writev(WRITE, file, vec, vlen, pos); compat_writev()
1107 if (!f.file) COMPAT_SYSCALL_DEFINE3()
1109 pos = f.file->f_pos; COMPAT_SYSCALL_DEFINE3()
1110 ret = compat_writev(f.file, vec, vlen, &pos); COMPAT_SYSCALL_DEFINE3()
1112 f.file->f_pos = pos; COMPAT_SYSCALL_DEFINE3()
1127 if (!f.file) __compat_sys_pwritev64()
1130 if (f.file->f_mode & FMODE_PWRITE) __compat_sys_pwritev64()
1131 ret = compat_writev(f.file, vec, vlen, &pos); __compat_sys_pwritev64()
1166 * Get input file, and verify that it is ok.. do_sendfile()
1170 if (!in.file) do_sendfile()
1172 if (!(in.file->f_mode & FMODE_READ)) do_sendfile()
1176 pos = in.file->f_pos; do_sendfile()
1179 if (!(in.file->f_mode & FMODE_PREAD)) do_sendfile()
1182 retval = rw_verify_area(READ, in.file, &pos, count); do_sendfile()
1188 * Get output file, and verify that it is ok.. do_sendfile()
1192 if (!out.file) do_sendfile()
1194 if (!(out.file->f_mode & FMODE_WRITE)) do_sendfile()
1197 in_inode = file_inode(in.file); do_sendfile()
1198 out_inode = file_inode(out.file); do_sendfile()
1199 out_pos = out.file->f_pos; do_sendfile()
1200 retval = rw_verify_area(WRITE, out.file, &out_pos, count); do_sendfile()
1221 * EAGAIN on a non-blocking file descriptor. do_sendfile()
1223 if (in.file->f_flags & O_NONBLOCK) do_sendfile()
1226 file_start_write(out.file); do_sendfile()
1227 retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl); do_sendfile()
1228 file_end_write(out.file); do_sendfile()
1233 fsnotify_access(in.file); do_sendfile()
1234 fsnotify_modify(out.file); do_sendfile()
1235 out.file->f_pos = out_pos; do_sendfile()
1239 in.file->f_pos = pos; do_sendfile()
H A Danon_inodes.c12 #include <linux/file.h>
55 * anon_inode_getfile - creates a new file instance by hooking it up to an
57 * of the file
59 * @name: [in] name of the "class" of the new file
60 * @fops: [in] file operations for the new file
61 * @priv: [in] private data for the new file (will be file's private_data)
64 * Creates a new file by hooking it on a single inode. This is useful for files
67 * hence saving memory and avoiding code duplication for the file/inode/dentry
68 * setup. Returns the newly created file* or an error pointer.
70 struct file *anon_inode_getfile(const char *name, anon_inode_getfile()
76 struct file *file; anon_inode_getfile() local
88 file = ERR_PTR(-ENOMEM); anon_inode_getfile()
105 file = alloc_file(&path, OPEN_FMODE(flags), fops); anon_inode_getfile()
106 if (IS_ERR(file)) anon_inode_getfile()
108 file->f_mapping = anon_inode_inode->i_mapping; anon_inode_getfile()
110 file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); anon_inode_getfile()
111 file->private_data = priv; anon_inode_getfile()
113 return file; anon_inode_getfile()
119 return file; anon_inode_getfile()
124 * anon_inode_getfd - creates a new file instance by hooking it up to an
126 * of the file
128 * @name: [in] name of the "class" of the new file
129 * @fops: [in] file operations for the new file
130 * @priv: [in] private data for the new file (will be file's private_data)
133 * Creates a new file by hooking it on a single inode. This is useful for files
136 * hence saving memory and avoiding code duplication for the file/inode/dentry
143 struct file *file; anon_inode_getfd() local
150 file = anon_inode_getfile(name, fops, priv, flags); anon_inode_getfd()
151 if (IS_ERR(file)) { anon_inode_getfd()
152 error = PTR_ERR(file); anon_inode_getfd()
155 fd_install(fd, file); anon_inode_getfd()
H A Deventfd.c8 #include <linux/file.h>
108 static int eventfd_release(struct inode *inode, struct file *file) eventfd_release() argument
110 struct eventfd_ctx *ctx = file->private_data; eventfd_release()
117 static unsigned int eventfd_poll(struct file *file, poll_table *wait) eventfd_poll() argument
119 struct eventfd_ctx *ctx = file->private_data; eventfd_poll()
123 poll_wait(file, &ctx->wqh, wait); eventfd_poll()
226 static ssize_t eventfd_read(struct file *file, char __user *buf, size_t count, eventfd_read() argument
229 struct eventfd_ctx *ctx = file->private_data; eventfd_read()
235 res = eventfd_ctx_read(ctx, file->f_flags & O_NONBLOCK, &cnt); eventfd_read()
242 static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t count, eventfd_write() argument
245 struct eventfd_ctx *ctx = file->private_data; eventfd_write()
260 else if (!(file->f_flags & O_NONBLOCK)) { eventfd_write()
290 static void eventfd_show_fdinfo(struct seq_file *m, struct file *f) eventfd_show_fdinfo()
313 * eventfd_fget - Acquire a reference of an eventfd file descriptor.
314 * @fd: [in] Eventfd file descriptor.
316 * Returns a pointer to the eventfd file structure in case of success, or the
319 * -EBADF : Invalid @fd file descriptor.
320 * -EINVAL : The @fd file descriptor is not an eventfd file.
322 struct file *eventfd_fget(int fd) eventfd_fget()
324 struct file *file; eventfd_fget() local
326 file = fget(fd); eventfd_fget()
327 if (!file) eventfd_fget()
329 if (file->f_op != &eventfd_fops) { eventfd_fget()
330 fput(file); eventfd_fget()
334 return file; eventfd_fget()
340 * @fd: [in] Eventfd file descriptor.
351 if (!f.file) eventfd_ctx_fdget()
353 ctx = eventfd_ctx_fileget(f.file); eventfd_ctx_fdget()
361 * @file: [in] Eventfd file pointer.
366 * -EINVAL : The @fd file descriptor is not an eventfd file.
368 struct eventfd_ctx *eventfd_ctx_fileget(struct file *file) eventfd_ctx_fileget() argument
370 if (file->f_op != &eventfd_fops) eventfd_ctx_fileget()
373 return eventfd_ctx_get(file->private_data); eventfd_ctx_fileget()
378 * eventfd_file_create - Creates an eventfd file pointer.
380 * @flags: Flags for the eventfd file.
382 * This function creates an eventfd file pointer, w/out installing it into
383 * the fd table. This is useful when the eventfd file is used during the
385 * creation. So the eventfd creation is split into the file pointer creation
386 * phase, and the file descriptor installation phase.
387 * In this way races with userspace closing the newly installed file descriptor
389 * Returns an eventfd file pointer, or a proper error pointer.
391 struct file *eventfd_file_create(unsigned int count, int flags) eventfd_file_create()
393 struct file *file; eventfd_file_create() local
412 file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, eventfd_file_create()
414 if (IS_ERR(file)) eventfd_file_create()
417 return file; eventfd_file_create()
423 struct file *file; SYSCALL_DEFINE2() local
430 file = eventfd_file_create(count, flags); SYSCALL_DEFINE2()
431 if (IS_ERR(file)) { SYSCALL_DEFINE2()
432 error = PTR_ERR(file); SYSCALL_DEFINE2()
435 fd_install(fd, file); SYSCALL_DEFINE2()
H A Dbinfmt_em86.c18 #include <linux/file.h>
28 struct file * file; load_em86() local
41 !bprm->file->f_op->mmap) { load_em86()
45 /* Need to be able to load the file after exec */ load_em86()
49 allow_write_access(bprm->file); load_em86()
50 fput(bprm->file); load_em86()
51 bprm->file = NULL; load_em86()
63 * (3) filename of emulated file (replace argv[0]) load_em86()
86 file = open_exec(interp); load_em86()
87 if (IS_ERR(file)) load_em86()
88 return PTR_ERR(file); load_em86()
90 bprm->file = file; load_em86()
/linux-4.4.14/drivers/staging/rts5208/
H A Dtrace.c8 void _rtsx_trace(struct rtsx_chip *chip, const char *file, const char *func, _rtsx_trace() argument
13 file = kbasename(file); _rtsx_trace()
14 dev_dbg(rtsx_dev(chip), "[%s][%s]:[%d]\n", file, func, line); _rtsx_trace() local
16 strncpy(msg->file, file, MSG_FILE_LEN - 1); _rtsx_trace()
/linux-4.4.14/drivers/gpu/drm/nouveau/
H A Dnouveau_ioctl.h4 long nouveau_compat_ioctl(struct file *, unsigned int cmd, unsigned long arg);
5 long nouveau_drm_ioctl(struct file *, unsigned int cmd, unsigned long arg);
/linux-4.4.14/arch/alpha/kernel/
H A Dbinfmt_loader.c3 #include <linux/file.h>
12 struct file *file; load_binary() local
21 allow_write_access(bprm->file); load_binary()
22 fput(bprm->file); load_binary()
23 bprm->file = NULL; load_binary()
27 file = open_exec("/sbin/loader"); load_binary()
28 retval = PTR_ERR(file); load_binary()
29 if (IS_ERR(file)) load_binary()
35 bprm->file = file; load_binary()
/linux-4.4.14/fs/lockd/
H A Dsvcsubs.c27 * Global file hash table
45 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) nlm_debug_print_file() argument
47 struct inode *inode = file_inode(file->f_file); nlm_debug_print_file()
58 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) nlm_debug_print_file() argument
74 * Lookup file info. If it doesn't exist, create a file info struct
75 * and open a (VFS) file for the given inode.
78 * Note that we open the file O_RDONLY even when creating write locks.
86 struct nlm_file *file; nlm_lookup_file() local
94 /* Lock file table */ nlm_lookup_file()
97 hlist_for_each_entry(file, &nlm_files[hash], f_list) nlm_lookup_file()
98 if (!nfs_compare_fh(&file->f_handle, f)) nlm_lookup_file()
101 nlm_debug_print_fh("creating file for", f); nlm_lookup_file()
104 file = kzalloc(sizeof(*file), GFP_KERNEL); nlm_lookup_file()
105 if (!file) nlm_lookup_file()
108 memcpy(&file->f_handle, f, sizeof(struct nfs_fh)); nlm_lookup_file()
109 mutex_init(&file->f_mutex); nlm_lookup_file()
110 INIT_HLIST_NODE(&file->f_list); nlm_lookup_file()
111 INIT_LIST_HEAD(&file->f_blocks); nlm_lookup_file()
113 /* Open the file. Note that this must not sleep for too long, else nlm_lookup_file()
117 * the file. nlm_lookup_file()
119 if ((nfserr = nlmsvc_ops->fopen(rqstp, f, &file->f_file)) != 0) { nlm_lookup_file()
124 hlist_add_head(&file->f_list, &nlm_files[hash]); nlm_lookup_file()
127 dprintk("lockd: found file %p (count %d)\n", file, file->f_count); nlm_lookup_file()
128 *result = file; nlm_lookup_file()
129 file->f_count++; nlm_lookup_file()
137 kfree(file); nlm_lookup_file()
142 * Delete a file after having released all locks, blocks and shares
145 nlm_delete_file(struct nlm_file *file) nlm_delete_file() argument
147 nlm_debug_print_file("closing file", file); nlm_delete_file()
148 if (!hlist_unhashed(&file->f_list)) { nlm_delete_file()
149 hlist_del(&file->f_list); nlm_delete_file()
150 nlmsvc_ops->fclose(file->f_file); nlm_delete_file()
151 kfree(file); nlm_delete_file()
153 printk(KERN_WARNING "lockd: attempt to release unknown file!\n"); nlm_delete_file()
158 * Loop over all locks on the given file and perform the specified
162 nlm_traverse_locks(struct nlm_host *host, struct nlm_file *file, nlm_traverse_locks() argument
165 struct inode *inode = nlmsvc_file_inode(file); nlm_traverse_locks()
173 file->f_locks = 0; nlm_traverse_locks()
180 file->f_locks++; nlm_traverse_locks()
190 if (vfs_lock_file(file->f_file, F_SETLK, &lock, NULL) < 0) { nlm_traverse_locks()
210 * Inspect a single file
213 nlm_inspect_file(struct nlm_host *host, struct nlm_file *file, nlm_host_match_fn_t match) nlm_inspect_file() argument
215 nlmsvc_traverse_blocks(host, file, match); nlm_inspect_file()
216 nlmsvc_traverse_shares(host, file, match); nlm_inspect_file()
217 return nlm_traverse_locks(host, file, match); nlm_inspect_file()
222 * shares on a given file.
225 nlm_file_inuse(struct nlm_file *file) nlm_file_inuse() argument
227 struct inode *inode = nlmsvc_file_inode(file); nlm_file_inuse()
231 if (file->f_count || !list_empty(&file->f_blocks) || file->f_shares) nlm_file_inuse()
244 file->f_locks = 0; nlm_file_inuse()
249 * Loop over all files in the file table.
253 int (*is_failover_file)(void *data, struct nlm_file *file)) nlm_traverse_files()
256 struct nlm_file *file; nlm_traverse_files() local
261 hlist_for_each_entry_safe(file, next, &nlm_files[i], f_list) { nlm_traverse_files()
262 if (is_failover_file && !is_failover_file(data, file)) nlm_traverse_files()
264 file->f_count++; nlm_traverse_files()
267 /* Traverse locks, blocks and shares of this file nlm_traverse_files()
268 * and update file->f_locks count */ nlm_traverse_files()
269 if (nlm_inspect_file(data, file, match)) nlm_traverse_files()
273 file->f_count--; nlm_traverse_files()
274 /* No more references to this file. Let go of it. */ nlm_traverse_files()
275 if (list_empty(&file->f_blocks) && !file->f_locks nlm_traverse_files()
276 && !file->f_shares && !file->f_count) { nlm_traverse_files()
277 hlist_del(&file->f_list); nlm_traverse_files()
278 nlmsvc_ops->fclose(file->f_file); nlm_traverse_files()
279 kfree(file); nlm_traverse_files()
288 * Release file. If there are no more remote locks on this file,
297 nlm_release_file(struct nlm_file *file) nlm_release_file() argument
300 file, file->f_count); nlm_release_file()
302 /* Lock file table */ nlm_release_file()
305 /* If there are no more locks etc, delete the file */ nlm_release_file()
306 if (--file->f_count == 0 && !nlm_file_inuse(file)) nlm_release_file()
307 nlm_delete_file(file); nlm_release_file()
413 nlmsvc_match_sb(void *datap, struct nlm_file *file) nlmsvc_match_sb() argument
417 return sb == file_inode(file->f_file)->i_sb; nlmsvc_match_sb()
421 * nlmsvc_unlock_all_by_sb - release locks held on this file system
424 * Release all locks held by clients accessing this file system.
252 nlm_traverse_files(void *data, nlm_host_match_fn_t match, int (*is_failover_file)(void *data, struct nlm_file *file)) nlm_traverse_files() argument
/linux-4.4.14/fs/kernfs/
H A DMakefile5 obj-y := mount.o inode.o dir.o file.o symlink.o
/linux-4.4.14/fs/bfs/
H A DMakefile7 bfs-objs := inode.o file.o dir.o
/linux-4.4.14/fs/efivarfs/
H A DMakefile7 efivarfs-objs := inode.o file.o super.o
H A Dfile.c17 static ssize_t efivarfs_file_write(struct file *file, efivarfs_file_write() argument
20 struct efivar_entry *var = file->private_data; efivarfs_file_write()
23 struct inode *inode = file->f_mapping->host; efivarfs_file_write()
51 d_delete(file->f_path.dentry); efivarfs_file_write()
52 dput(file->f_path.dentry); efivarfs_file_write()
67 static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, efivarfs_file_read() argument
70 struct efivar_entry *var = file->private_data; efivarfs_file_read()
108 efivarfs_ioc_getxflags(struct file *file, void __user *arg) efivarfs_ioc_getxflags() argument
110 struct inode *inode = file->f_mapping->host; efivarfs_ioc_getxflags()
124 efivarfs_ioc_setxflags(struct file *file, void __user *arg) efivarfs_ioc_setxflags() argument
126 struct inode *inode = file->f_mapping->host; efivarfs_ioc_setxflags()
147 error = mnt_want_write_file(file); efivarfs_ioc_setxflags()
155 mnt_drop_write_file(file); efivarfs_ioc_setxflags()
161 efivarfs_file_ioctl(struct file *file, unsigned int cmd, unsigned long p) efivarfs_file_ioctl() argument
167 return efivarfs_ioc_getxflags(file, arg); efivarfs_file_ioctl()
169 return efivarfs_ioc_setxflags(file, arg); efivarfs_file_ioctl()
/linux-4.4.14/fs/sysfs/
H A DMakefile5 obj-y := file.o dir.o symlink.o mount.o group.o
/linux-4.4.14/arch/arm/mach-rpc/
H A DMakefile5 # Object file lists.
/linux-4.4.14/arch/arm/mach-ebsa110/
H A DMakefile5 # Object file lists.
/linux-4.4.14/tools/testing/selftests/kcmp/
H A DMakefile10 $(RM) kcmp_test kcmp-test-file
/linux-4.4.14/scripts/kconfig/
H A Dutil.c13 /* file already present in list? If not add it */ file_lookup()
14 struct file *file_lookup(const char *name) file_lookup()
16 struct file *file; file_lookup() local
19 for (file = file_list; file; file = file->next) { file_lookup()
20 if (!strcmp(name, file->name)) { file_lookup()
22 return file; file_lookup()
26 file = xmalloc(sizeof(*file)); file_lookup()
27 memset(file, 0, sizeof(*file)); file_lookup()
28 file->name = file_name; file_lookup()
29 file->next = file_list; file_lookup()
30 file_list = file; file_lookup()
31 return file; file_lookup()
34 /* write a dependency file as used by kbuild to track dependencies */ file_write_dep()
39 struct file *file; file_write_dep() local
48 for (file = file_list; file; file = file->next) { file_write_dep()
49 if (file->next) file_write_dep()
50 fprintf(out, "\t%s \\\n", file->name); file_write_dep()
52 fprintf(out, "\t%s\n", file->name); file_write_dep()
/linux-4.4.14/fs/proc/
H A Dkmsg.c22 static int kmsg_open(struct inode * inode, struct file * file) kmsg_open() argument
27 static int kmsg_release(struct inode * inode, struct file * file) kmsg_release() argument
33 static ssize_t kmsg_read(struct file *file, char __user *buf, kmsg_read() argument
36 if ((file->f_flags & O_NONBLOCK) && kmsg_read()
42 static unsigned int kmsg_poll(struct file *file, poll_table *wait) kmsg_poll() argument
44 poll_wait(file, &log_wait, wait); kmsg_poll()
H A Dcmdline.c12 static int cmdline_proc_open(struct inode *inode, struct file *file) cmdline_proc_open() argument
14 return single_open(file, cmdline_proc_show, NULL); cmdline_proc_open()
H A Dcpuinfo.c7 static int cpuinfo_open(struct inode *inode, struct file *file) cpuinfo_open() argument
9 return seq_open(file, &cpuinfo_op); cpuinfo_open()
H A Dinode.c17 #include <linux/file.h>
149 struct file *file; close_pdeo() local
152 file = pdeo->file; close_pdeo()
153 pde->proc_fops->release(file_inode(file), file); close_pdeo() local
179 static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) proc_reg_llseek() argument
181 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_llseek()
184 loff_t (*llseek)(struct file *, loff_t, int); proc_reg_llseek()
188 rv = llseek(file, offset, whence); proc_reg_llseek()
194 static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) proc_reg_read() argument
196 ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); proc_reg_read()
197 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_read()
202 rv = read(file, buf, count, ppos); proc_reg_read()
208 static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) proc_reg_write() argument
210 ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); proc_reg_write()
211 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_write()
216 rv = write(file, buf, count, ppos); proc_reg_write()
222 static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) proc_reg_poll() argument
224 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_poll()
226 unsigned int (*poll)(struct file *, struct poll_table_struct *); proc_reg_poll()
230 rv = poll(file, pts); proc_reg_poll()
236 static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) proc_reg_unlocked_ioctl() argument
238 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_unlocked_ioctl()
240 long (*ioctl)(struct file *, unsigned int, unsigned long); proc_reg_unlocked_ioctl()
244 rv = ioctl(file, cmd, arg); proc_reg_unlocked_ioctl()
251 static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) proc_reg_compat_ioctl() argument
253 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_compat_ioctl()
255 long (*compat_ioctl)(struct file *, unsigned int, unsigned long); proc_reg_compat_ioctl()
259 rv = compat_ioctl(file, cmd, arg); proc_reg_compat_ioctl()
266 static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) proc_reg_mmap() argument
268 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_mmap()
270 int (*mmap)(struct file *, struct vm_area_struct *); proc_reg_mmap()
274 rv = mmap(file, vma); proc_reg_mmap()
281 proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, proc_reg_get_unmapped_area() argument
285 struct proc_dir_entry *pde = PDE(file_inode(file)); proc_reg_get_unmapped_area()
298 rv = get_area(file, orig_addr, len, pgoff, flags); proc_reg_get_unmapped_area()
306 static int proc_reg_open(struct inode *inode, struct file *file) proc_reg_open() argument
310 int (*open)(struct inode *, struct file *); proc_reg_open()
311 int (*release)(struct inode *, struct file *); proc_reg_open()
336 rv = open(inode, file); proc_reg_open()
340 pdeo->file = file; proc_reg_open()
352 static int proc_reg_release(struct inode *inode, struct file *file) proc_reg_release() argument
358 if (pdeo->file == file) { proc_reg_release()
H A Dsoftirqs.c27 static int softirqs_open(struct inode *inode, struct file *file) softirqs_open() argument
29 return single_open(file, show_softirqs, NULL); softirqs_open()
H A Dversion.c17 static int version_proc_open(struct inode *inode, struct file *file) version_proc_open() argument
19 return single_open(file, version_proc_show, NULL); version_proc_open()
H A Dfd.c9 #include <linux/file.h>
23 struct file *file = NULL; seq_show() local
37 file = fcheck_files(files, fd); seq_show()
38 if (file) { seq_show()
41 f_flags = file->f_flags; seq_show()
45 get_file(file); seq_show()
56 (long long)file->f_pos, f_flags, seq_show()
57 real_mount(file->f_path.mnt)->mnt_id); seq_show()
59 show_fd_locks(m, file, files); seq_show()
63 if (file->f_op->show_fdinfo) seq_show()
64 file->f_op->show_fdinfo(m, file); seq_show()
67 fput(file); seq_show()
71 static int seq_fdinfo_open(struct inode *inode, struct file *file) seq_fdinfo_open() argument
73 return single_open(file, seq_show, inode); seq_fdinfo_open()
101 struct file *file; tid_fd_revalidate() local
104 file = fcheck_files(files, fd); tid_fd_revalidate()
105 if (file) { tid_fd_revalidate()
106 unsigned f_mode = file->f_mode; tid_fd_revalidate()
162 struct file *fd_file; proc_fd_link()
229 static int proc_readfd_common(struct file *file, struct dir_context *ctx, proc_readfd_common() argument
232 struct task_struct *p = get_proc_task(file_inode(file)); proc_readfd_common()
239 if (!dir_emit_dots(file, ctx)) proc_readfd_common()
257 if (!proc_fill_cache(file, ctx, proc_readfd_common()
271 static int proc_readfd(struct file *file, struct dir_context *ctx) proc_readfd() argument
273 return proc_readfd_common(file, ctx, proc_fd_instantiate); proc_readfd()
350 static int proc_readfdinfo(struct file *file, struct dir_context *ctx) proc_readfdinfo() argument
352 return proc_readfd_common(file, ctx, proc_readfdinfo()
/linux-4.4.14/fs/nfs/
H A Dnfs42.h15 int nfs42_proc_allocate(struct file *, loff_t, loff_t);
16 int nfs42_proc_deallocate(struct file *, loff_t, loff_t);
17 loff_t nfs42_proc_llseek(struct file *, loff_t, int);
20 int nfs42_proc_clone(struct file *, struct file *, loff_t, loff_t, loff_t);
/linux-4.4.14/tools/power/acpi/os_specific/service_layers/
H A Doslibcfs.c3 * Module Name: oslibcfs - C library OSL for file I/O
60 * DESCRIPTION: Open a file for reading (ACPI_FILE_READING) or/and writing
66 ACPI_FILE file; acpi_os_open_file() local
82 file = fopen(path, modes_str); acpi_os_open_file()
83 if (!file) { acpi_os_open_file()
84 perror("Could not open file"); acpi_os_open_file()
87 return (file); acpi_os_open_file()
94 * PARAMETERS: file - An open file descriptor
98 * DESCRIPTION: Close a file opened via acpi_os_open_file.
102 void acpi_os_close_file(ACPI_FILE file) acpi_os_close_file() argument
104 fclose(file); acpi_os_close_file()
111 * PARAMETERS: file - An open file descriptor
118 * DESCRIPTION: Read from a file.
123 acpi_os_read_file(ACPI_FILE file, void *buffer, acpi_size size, acpi_size count) acpi_os_read_file() argument
127 length = fread(buffer, size, count, file); acpi_os_read_file()
129 perror("Error reading file"); acpi_os_read_file()
139 * PARAMETERS: file - An open file descriptor
146 * DESCRIPTION: Write to a file.
151 acpi_os_write_file(ACPI_FILE file, acpi_os_write_file() argument
156 length = fwrite(buffer, size, count, file); acpi_os_write_file()
158 perror("Error writing file"); acpi_os_write_file()
168 * PARAMETERS: file - An open file descriptor
170 * RETURN: Current file pointer position.
172 * DESCRIPTION: Get current file offset.
176 long acpi_os_get_file_offset(ACPI_FILE file) acpi_os_get_file_offset() argument
180 offset = ftell(file); acpi_os_get_file_offset()
188 * PARAMETERS: file - An open file descriptor
189 * offset - New file offset
190 * from - From begin/end of file
194 * DESCRIPTION: Set current file offset.
198 acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from) acpi_os_set_file_offset() argument
203 ret = fseek(file, offset, SEEK_SET); acpi_os_set_file_offset()
206 ret = fseek(file, offset, SEEK_END); acpi_os_set_file_offset()
/linux-4.4.14/drivers/ras/
H A Ddebugfs.c18 static int trace_open(struct inode *inode, struct file *file) trace_open() argument
21 return single_open(file, trace_show, NULL); trace_open()
24 static int trace_release(struct inode *inode, struct file *file) trace_release() argument
27 return single_release(inode, file); trace_release()
/linux-4.4.14/drivers/usb/gadget/function/
H A Duvc_v4l2.c68 uvc_v4l2_querycap(struct file *file, void *fh, struct v4l2_capability *cap) uvc_v4l2_querycap() argument
70 struct video_device *vdev = video_devdata(file); uvc_v4l2_querycap()
86 uvc_v4l2_get_format(struct file *file, void *fh, struct v4l2_format *fmt) uvc_v4l2_get_format() argument
88 struct video_device *vdev = video_devdata(file); uvc_v4l2_get_format()
105 uvc_v4l2_set_format(struct file *file, void *fh, struct v4l2_format *fmt) uvc_v4l2_set_format() argument
107 struct video_device *vdev = video_devdata(file); uvc_v4l2_set_format()
146 uvc_v4l2_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *b) uvc_v4l2_reqbufs() argument
148 struct video_device *vdev = video_devdata(file); uvc_v4l2_reqbufs()
159 uvc_v4l2_querybuf(struct file *file, void *fh, struct v4l2_buffer *b) uvc_v4l2_querybuf() argument
161 struct video_device *vdev = video_devdata(file); uvc_v4l2_querybuf()
169 uvc_v4l2_qbuf(struct file *file, void *fh, struct v4l2_buffer *b) uvc_v4l2_qbuf() argument
171 struct video_device *vdev = video_devdata(file); uvc_v4l2_qbuf()
184 uvc_v4l2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *b) uvc_v4l2_dqbuf() argument
186 struct video_device *vdev = video_devdata(file); uvc_v4l2_dqbuf()
190 return uvcg_dequeue_buffer(&video->queue, b, file->f_flags & O_NONBLOCK); uvc_v4l2_dqbuf()
194 uvc_v4l2_streamon(struct file *file, void *fh, enum v4l2_buf_type type) uvc_v4l2_streamon() argument
196 struct video_device *vdev = video_devdata(file); uvc_v4l2_streamon()
220 uvc_v4l2_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) uvc_v4l2_streamoff() argument
222 struct video_device *vdev = video_devdata(file); uvc_v4l2_streamoff()
250 uvc_v4l2_ioctl_default(struct file *file, void *fh, bool valid_prio, uvc_v4l2_ioctl_default() argument
253 struct video_device *vdev = video_devdata(file); uvc_v4l2_ioctl_default()
285 uvc_v4l2_open(struct file *file) uvc_v4l2_open() argument
287 struct video_device *vdev = video_devdata(file); uvc_v4l2_open()
299 file->private_data = &handle->vfh; uvc_v4l2_open()
306 uvc_v4l2_release(struct file *file) uvc_v4l2_release() argument
308 struct video_device *vdev = video_devdata(file); uvc_v4l2_release()
310 struct uvc_file_handle *handle = to_uvc_file_handle(file->private_data); uvc_v4l2_release()
320 file->private_data = NULL; uvc_v4l2_release()
329 uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma) uvc_v4l2_mmap() argument
331 struct video_device *vdev = video_devdata(file); uvc_v4l2_mmap()
338 uvc_v4l2_poll(struct file *file, poll_table *wait) uvc_v4l2_poll() argument
340 struct video_device *vdev = video_devdata(file); uvc_v4l2_poll()
343 return uvcg_queue_poll(&uvc->video.queue, file, wait); uvc_v4l2_poll()
347 static unsigned long uvcg_v4l2_get_unmapped_area(struct file *file, uvcg_v4l2_get_unmapped_area() argument
351 struct video_device *vdev = video_devdata(file); uvcg_v4l2_get_unmapped_area()
/linux-4.4.14/security/selinux/include/
H A Dinitial_sid_to_string.h1 /* This file is automatically generated. Do not edit. */
9 "file",
/linux-4.4.14/include/drm/
H A Ddrm_sysfs.h5 * This minimalistic include file is intended for users (read TTM) that
6 * don't want to include the full drmP.h file.
/linux-4.4.14/arch/sh/boards/mach-ecovec24/
H A DMakefile4 # This file is subject to the terms and conditions of the GNU General Public
5 # License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/parisc/include/asm/
H A Dfb.h8 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, fb_pgprotect() argument
H A Dmc146818rtc.h7 /* empty include file to satisfy the include in genrtc.c */
/linux-4.4.14/arch/parisc/oprofile/
H A Dinit.c2 * @file init.c
5 * @remark Read the file COPYING
/linux-4.4.14/arch/m32r/oprofile/
H A Dinit.c2 * @file init.c
5 * @remark Read the file COPYING
/linux-4.4.14/arch/arm/mach-omap2/
H A Ddss-common.h5 * NOTE: this is a transitional file to help with DT adaptation.
6 * This file will be removed when DSS supports DT.
/linux-4.4.14/arch/x86/include/uapi/asm/
H A Dsigcontext32.h4 /* This is a legacy file - all the type definitions are in sigcontext.h: */
/linux-4.4.14/arch/xtensa/include/asm/
H A Duser.h6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
16 /* This file usually defines a 'struct user' structure. However, it it only
17 * used for a.out file, which are not supported on Xtensa.
H A Dmodule.h4 * This file contains the module code specific to the Xtensa architecture.
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
H A Dbarrier.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Dbugs.h8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of
H A Dhw_irq.h4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
H A Dmmu.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Dsegment.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
H A Dserial.h6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
H A Dsignal.h6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
H A Dtypes.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
H A Ducontext.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
H A Dvga.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/fs/fuse/
H A DMakefile8 fuse-objs := dev.o dir.o file.o inode.o control.o
H A Dcontrol.c6 See the file COPYING.
22 static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file) fuse_ctl_file_conn_get() argument
26 fc = file_inode(file)->i_private; fuse_ctl_file_conn_get()
33 static ssize_t fuse_conn_abort_write(struct file *file, const char __user *buf, fuse_conn_abort_write() argument
36 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); fuse_conn_abort_write()
44 static ssize_t fuse_conn_waiting_read(struct file *file, char __user *buf, fuse_conn_waiting_read() argument
52 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); fuse_conn_waiting_read()
57 file->private_data = (void *)value; fuse_conn_waiting_read()
60 size = sprintf(tmp, "%ld\n", (long)file->private_data); fuse_conn_waiting_read()
64 static ssize_t fuse_conn_limit_read(struct file *file, char __user *buf, fuse_conn_limit_read() argument
73 static ssize_t fuse_conn_limit_write(struct file *file, const char __user *buf, fuse_conn_limit_write() argument
99 static ssize_t fuse_conn_max_background_read(struct file *file, fuse_conn_max_background_read() argument
106 fc = fuse_ctl_file_conn_get(file); fuse_conn_max_background_read()
113 return fuse_conn_limit_read(file, buf, len, ppos, val); fuse_conn_max_background_read()
116 static ssize_t fuse_conn_max_background_write(struct file *file, fuse_conn_max_background_write() argument
123 ret = fuse_conn_limit_write(file, buf, count, ppos, &val, fuse_conn_max_background_write()
126 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); fuse_conn_max_background_write()
136 static ssize_t fuse_conn_congestion_threshold_read(struct file *file, fuse_conn_congestion_threshold_read() argument
143 fc = fuse_ctl_file_conn_get(file); fuse_conn_congestion_threshold_read()
150 return fuse_conn_limit_read(file, buf, len, ppos, val); fuse_conn_congestion_threshold_read()
153 static ssize_t fuse_conn_congestion_threshold_write(struct file *file, fuse_conn_congestion_threshold_write() argument
160 ret = fuse_conn_limit_write(file, buf, count, ppos, &val, fuse_conn_congestion_threshold_write()
163 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); fuse_conn_congestion_threshold_write()
/linux-4.4.14/fs/minix/
H A DMakefile7 minix-objs := bitmap.o itree_v1.o itree_v2.o namei.o inode.o file.o dir.o
/linux-4.4.14/fs/adfs/
H A DMakefile7 adfs-objs := dir.o dir_f.o dir_fplus.o file.o inode.o map.o super.o
H A Dfile.c2 * linux/fs/adfs/file.c
7 * linux/fs/ext2/file.c
16 * linux/fs/minix/file.c
20 * adfs regular file handling primitives
/linux-4.4.14/fs/configfs/
H A DMakefile7 configfs-objs := inode.o file.o dir.o symlink.o mount.o item.o
/linux-4.4.14/fs/efs/
H A DMakefile7 efs-objs := super.o inode.o namei.o dir.o file.o symlink.o
/linux-4.4.14/arch/ia64/sn/kernel/sn2/
H A Dsn_proc_fs.c2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
21 static int partition_id_open(struct inode *inode, struct file *file) partition_id_open() argument
23 return single_open(file, partition_id_show, NULL); partition_id_open()
32 static int system_serial_number_open(struct inode *inode, struct file *file) system_serial_number_open() argument
34 return single_open(file, system_serial_number_show, NULL); system_serial_number_open()
43 static int licenseID_open(struct inode *inode, struct file *file) licenseID_open() argument
45 return single_open(file, licenseID_show, NULL); licenseID_open()
55 static int coherence_id_open(struct inode *inode, struct file *file) coherence_id_open() argument
57 return single_open(file, coherence_id_show, NULL); coherence_id_open()
61 extern int sn_topology_open(struct inode *, struct file *);
62 extern int sn_topology_release(struct inode *, struct file *);
/linux-4.4.14/tools/perf/util/include/asm/
H A Dcpufeature.h5 /* cpufeature.h ... dummy header file for including arch/x86/lib/memcpy_64.S */
H A Ddwarf2.h5 /* dwarf2.h ... dummy header file for including arch/x86/lib/mem{cpy,set}_64.S */
/linux-4.4.14/drivers/scsi/fnic/
H A Dfnic_debugfs.c49 * file system. If not already created, this routine will create the
95 * When Debugfs is configured this routine removes debugfs file system
111 * fnic_trace_ctrl_open - Open the trace_enable file for fnic_trace
112 * Or Open fc_trace_enable file for fc_trace
114 * @file: The file pointer to attach the trace enable/disable flag.
117 * This routine opens a debugsfs file trace_enable or fc_trace_enable.
122 static int fnic_trace_ctrl_open(struct inode *inode, struct file *filp) fnic_trace_ctrl_open()
131 * or fc_trace_clear debugfs file
132 * @filp: The file pointer to read from.
135 * @ppos: The position in the file to start reading from.
141 * It will start reading file at @ppos and
147 static ssize_t fnic_trace_ctrl_read(struct file *filp, fnic_trace_ctrl_read()
163 pr_err("fnic: Cannot read to any debugfs file\n"); fnic_trace_ctrl_read()
171 * fc_trace_clear debugfs file
172 * @filp: The file pointer to write from.
175 * @ppos: The position in the file to start writing to.
185 static ssize_t fnic_trace_ctrl_write(struct file *filp, fnic_trace_ctrl_write()
214 pr_err("fnic: cannot write to any debugfs file\n"); fnic_trace_ctrl_write()
231 * @file: The file pointer to attach the log output
234 * This routine is the entry point for the debugfs open file operation.
237 * the private_data field in @file.
244 struct file *file) fnic_trace_debugfs_open()
275 file->private_data = fnic_dbg_prt; fnic_trace_debugfs_open()
281 * fnic_trace_debugfs_lseek - Seek through a debugfs file
282 * @file: The file pointer to seek through.
287 * This routine is the entry point for the debugfs lseek file operation.
290 * figures out what the new offset of the debugfs file will be and assigns
291 * that value to the f_pos field of @file.
297 static loff_t fnic_trace_debugfs_lseek(struct file *file, fnic_trace_debugfs_lseek() argument
301 fnic_dbgfs_t *fnic_dbg_prt = file->private_data; fnic_trace_debugfs_lseek()
302 return fixed_size_llseek(file, offset, howto, fnic_trace_debugfs_lseek()
307 * fnic_trace_debugfs_read - Read a debugfs file
308 * @file: The file pointer to read from.
311 * @pos: The position in the file to start reading from.
315 * field of @file. It will start reading at @pos and copy up to @nbytes of
320 * less than @nbytes if the end of the file was reached).
322 static ssize_t fnic_trace_debugfs_read(struct file *file, fnic_trace_debugfs_read() argument
327 fnic_dbgfs_t *fnic_dbg_prt = file->private_data; fnic_trace_debugfs_read()
337 * debugfs file data
339 * @file: The file pointer that contains the buffer to release
343 * file was opened.
349 struct file *file) fnic_trace_debugfs_release()
351 fnic_dbgfs_t *fnic_dbg_prt = file->private_data; fnic_trace_debugfs_release()
371 * file system. If not already created, this routine will create the
372 * create file trace to log fnic trace buffer output into debugfs and
373 * it will also create file trace_enable to control enable/disable of
392 "Cannot create trace_enable file under debugfs\n"); fnic_trace_debugfs_init()
404 "Cannot create trace file under debugfs\n"); fnic_trace_debugfs_init()
415 * When Debugfs is configured this routine removes debugfs file system
433 * file system. If not already created, this routine will create the
434 * create file trace to log fnic fc trace buffer output into debugfs and
435 * it will also create file fc_trace_enable to control enable/disable of
455 pr_err("fnic: Failed create fc_trace_enable file\n"); fnic_fc_trace_debugfs_init()
466 pr_err("fnic: Failed to create fc_trace_enable file\n"); fnic_fc_trace_debugfs_init()
478 pr_err("fnic: Failed create fc_rdata_trace file\n"); fnic_fc_trace_debugfs_init()
490 pr_err("fnic: Failed to create fc_trace file\n"); fnic_fc_trace_debugfs_init()
501 * When Debugfs is configured this routine removes debugfs file system
521 * fnic_reset_stats_open - Open the reset_stats file
523 * @file: The file pointer to attach the stats reset flag.
526 * This routine opens a debugsfs file reset_stats and stores i_private data
528 * file oprations.
533 static int fnic_reset_stats_open(struct inode *inode, struct file *file) fnic_reset_stats_open() argument
543 file->private_data = debug; fnic_reset_stats_open()
549 * fnic_reset_stats_read - Read a reset_stats debugfs file
550 * @filp: The file pointer to read from.
553 * @ppos: The position in the file to start reading from.
557 * and stores into local @buf. It will start reading file at @ppos and
563 static ssize_t fnic_reset_stats_read(struct file *file, fnic_reset_stats_read() argument
567 struct stats_debug_info *debug = file->private_data; fnic_reset_stats_read()
578 * fnic_reset_stats_write - Write to reset_stats debugfs file
579 * @filp: The file pointer to write from.
582 * @ppos: The position in the file to start writing to.
591 static ssize_t fnic_reset_stats_write(struct file *file, fnic_reset_stats_write() argument
595 struct stats_debug_info *debug = file->private_data; fnic_reset_stats_write()
643 * debugfs file data
645 * @file: The file pointer that contains the buffer to release
649 * file was opened.
655 struct file *file) fnic_reset_stats_release()
657 struct stats_debug_info *debug = file->private_data; fnic_reset_stats_release()
663 * fnic_stats_debugfs_open - Open the stats file for specific host
666 * @file: The file pointer to attach the specific host statistics.
669 * This routine opens a debugsfs file stats of specific host and print
676 struct file *file) fnic_stats_debugfs_open()
697 file->private_data = debug; fnic_stats_debugfs_open()
703 * fnic_stats_debugfs_read - Read a debugfs file
704 * @file: The file pointer to read from.
707 * @pos: The position in the file to start reading from.
711 * field of @file. It will start reading at @pos and copy up to @nbytes of
716 * less than @nbytes if the end of the file was reached).
718 static ssize_t fnic_stats_debugfs_read(struct file *file, fnic_stats_debugfs_read() argument
723 struct stats_debug_info *debug = file->private_data; fnic_stats_debugfs_read()
733 * debugfs file data
735 * @file: The file pointer that contains the buffer to release
739 * file was opened.
745 struct file *file) fnic_stats_debugfs_release()
747 struct stats_debug_info *debug = file->private_data; fnic_stats_debugfs_release()
769 * fnic_stats_init - Initialize stats struct and create stats file per fnic
772 * When Debugfs is configured this routine sets up the stats file per fnic
773 * It will create file stats and reset_stats under statistics/host# directory
800 printk(KERN_DEBUG "Cannot create host stats file\n"); fnic_stats_debugfs_init()
810 printk(KERN_DEBUG "Cannot create host stats file\n"); fnic_stats_debugfs_init()
821 * When Debugfs is configured this routine removes debugfs file system
243 fnic_trace_debugfs_open(struct inode *inode, struct file *file) fnic_trace_debugfs_open() argument
348 fnic_trace_debugfs_release(struct inode *inode, struct file *file) fnic_trace_debugfs_release() argument
654 fnic_reset_stats_release(struct inode *inode, struct file *file) fnic_reset_stats_release() argument
675 fnic_stats_debugfs_open(struct inode *inode, struct file *file) fnic_stats_debugfs_open() argument
744 fnic_stats_debugfs_release(struct inode *inode, struct file *file) fnic_stats_debugfs_release() argument
/linux-4.4.14/arch/x86/include/asm/numachip/
H A Dnumachip.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Numascale NumaConnect-specific header file
/linux-4.4.14/arch/xtensa/platforms/iss/include/platform/
H A Dhardware.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
12 * This file contains the default configuration of ISS.
H A Dserial.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/fs/notify/
H A Dfdinfo.h8 struct file;
13 void inotify_show_fdinfo(struct seq_file *m, struct file *f);
17 void fanotify_show_fdinfo(struct seq_file *m, struct file *f);
/linux-4.4.14/arch/powerpc/include/asm/
H A Dfb.h8 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, fb_pgprotect() argument
11 vma->vm_page_prot = phys_mem_access_prot(file, off >> PAGE_SHIFT, fb_pgprotect()
/linux-4.4.14/arch/mips/include/asm/
H A Dide.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * This file contains the MIPS architecture specific IDE code.
H A Dwbflush.h2 * Header file for using the wbflush routine
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
H A Dcache.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Ddma-coherence.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Derrno.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Dfb.h8 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, fb_pgprotect() argument
H A Dhardirq.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Dhw_irq.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Dmc146818rtc.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
H A Dreboot.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-generic/
H A Dcpu-feature-overrides.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
11 /* Intentionally empty file ... */
/linux-4.4.14/sound/usb/usx2y/
H A Dus122l.h12 struct file *first;
14 struct file *master;
15 struct file *slave;
/linux-4.4.14/net/batman-adv/
H A Ddebugfs.c121 static int batadv_log_open(struct inode *inode, struct file *file) batadv_log_open() argument
126 nonseekable_open(inode, file); batadv_log_open()
127 file->private_data = inode->i_private; batadv_log_open()
131 static int batadv_log_release(struct inode *inode, struct file *file) batadv_log_release() argument
142 static ssize_t batadv_log_read(struct file *file, char __user *buf, batadv_log_read() argument
145 struct batadv_priv *bat_priv = file->private_data; batadv_log_read()
151 if ((file->f_flags & O_NONBLOCK) && batadv_log_empty(debug_log)) batadv_log_read()
197 static unsigned int batadv_log_poll(struct file *file, poll_table *wait) batadv_log_poll() argument
199 struct batadv_priv *bat_priv = file->private_data; batadv_log_poll()
202 poll_wait(file, &debug_log->queue_wait, wait); batadv_log_poll()
260 static int batadv_algorithms_open(struct inode *inode, struct file *file) batadv_algorithms_open() argument
262 return single_open(file, batadv_algo_seq_print_text, NULL); batadv_algorithms_open()
265 static int batadv_originators_open(struct inode *inode, struct file *file) batadv_originators_open() argument
269 return single_open(file, batadv_orig_seq_print_text, net_dev); batadv_originators_open()
275 * @inode: inode pointer to debugfs file
276 * @file: pointer to the seq_file
279 struct file *file) batadv_originators_hardif_open()
283 return single_open(file, batadv_orig_hardif_seq_print_text, net_dev); batadv_originators_hardif_open()
286 static int batadv_gateways_open(struct inode *inode, struct file *file) batadv_gateways_open() argument
290 return single_open(file, batadv_gw_client_seq_print_text, net_dev); batadv_gateways_open()
293 static int batadv_transtable_global_open(struct inode *inode, struct file *file) batadv_transtable_global_open() argument
297 return single_open(file, batadv_tt_global_seq_print_text, net_dev); batadv_transtable_global_open()
301 static int batadv_bla_claim_table_open(struct inode *inode, struct file *file) batadv_bla_claim_table_open() argument
305 return single_open(file, batadv_bla_claim_table_seq_print_text, batadv_bla_claim_table_open()
310 struct file *file) batadv_bla_backbone_table_open()
314 return single_open(file, batadv_bla_backbone_table_seq_print_text, batadv_bla_backbone_table_open()
322 * batadv_dat_cache_open - Prepare file handler for reads from dat_chache
324 * @file: file handle to be initialized
326 static int batadv_dat_cache_open(struct inode *inode, struct file *file) batadv_dat_cache_open() argument
330 return single_open(file, batadv_dat_cache_seq_print_text, net_dev); batadv_dat_cache_open()
334 static int batadv_transtable_local_open(struct inode *inode, struct file *file) batadv_transtable_local_open() argument
338 return single_open(file, batadv_tt_local_seq_print_text, net_dev); batadv_transtable_local_open()
347 static int batadv_nc_nodes_open(struct inode *inode, struct file *file) batadv_nc_nodes_open() argument
351 return single_open(file, batadv_nc_nodes_seq_print_text, net_dev); batadv_nc_nodes_open()
440 struct dentry *file; batadv_debugfs_init() local
450 file = debugfs_create_file(((*bat_debug)->attr).name, batadv_debugfs_init()
454 if (!file) { batadv_debugfs_init()
455 pr_err("Can't add general debugfs file: %s\n", batadv_debugfs_init()
481 struct dentry *file; batadv_debugfs_add_hardif() local
492 file = debugfs_create_file(((*bat_debug)->attr).name, batadv_debugfs_add_hardif()
497 if (!file) batadv_debugfs_add_hardif()
526 struct dentry *file; batadv_debugfs_add_meshif() local
542 file = debugfs_create_file(((*bat_debug)->attr).name, batadv_debugfs_add_meshif()
546 if (!file) { batadv_debugfs_add_meshif()
547 batadv_err(dev, "Can't add debugfs file: %s/%s\n", batadv_debugfs_add_meshif()
278 batadv_originators_hardif_open(struct inode *inode, struct file *file) batadv_originators_hardif_open() argument
309 batadv_bla_backbone_table_open(struct inode *inode, struct file *file) batadv_bla_backbone_table_open() argument
/linux-4.4.14/fs/afs/
H A Dafs_fs.h15 #define AFS_FS_PORT 7000 /* AFS file server port */
19 FSFETCHDATA = 130, /* AFS Fetch file data */
20 FSFETCHSTATUS = 132, /* AFS Fetch file status */
21 FSSTOREDATA = 133, /* AFS Store file data */
22 FSSTORESTATUS = 135, /* AFS Store file status */
23 FSREMOVEFILE = 136, /* AFS Remove a file */
24 FSCREATEFILE = 137, /* AFS Create a file */
25 FSRENAME = 138, /* AFS Rename or move a file or directory */
34 FSSETLOCK = 156, /* AFS Request a file lock */
35 FSEXTENDLOCK = 157, /* AFS Extend a file lock */
36 FSRELEASELOCK = 158, /* AFS Release a file lock */
37 FSLOOKUP = 161, /* AFS lookup file in directory */
38 FSFETCHDATA64 = 65537, /* AFS Fetch file data */
39 FSSTOREDATA64 = 65538, /* AFS Store file data */
44 VNOVNODE = 102, /* no such file/dir (vnode) */
/linux-4.4.14/drivers/oprofile/
H A Devent_buffer.h2 * @file event_buffer.h
5 * @remark Read the file COPYING
23 * file offsets, dcookies, context information, and ESCAPE codes.
27 /* wake up the process sleeping on the event file */
36 * file reading code.
H A Doprofile_files.c2 * @file oprofile_files.c
5 * @remark Read the file COPYING
30 static ssize_t timeout_read(struct file *file, char __user *buf, timeout_read() argument
38 static ssize_t timeout_write(struct file *file, char const __user *buf, timeout_write() argument
68 static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset) depth_read() argument
75 static ssize_t depth_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) depth_write() argument
105 static ssize_t pointer_size_read(struct file *file, char __user *buf, size_t count, loff_t *offset) pointer_size_read() argument
117 static ssize_t cpu_type_read(struct file *file, char __user *buf, size_t count, loff_t *offset) cpu_type_read() argument
129 static ssize_t enable_read(struct file *file, char __user *buf, size_t count, loff_t *offset) enable_read() argument
135 static ssize_t enable_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) enable_write() argument
166 static ssize_t dump_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) dump_write() argument
H A Dbuffer_sync.h2 * @file buffer_sync.h
5 * @remark Read the file COPYING
H A Doprofile_stats.h2 * @file oprofile_stats.h
5 * @remark Read the file COPYING
/linux-4.4.14/scripts/mod/
H A DMakefile6 devicetable-offsets-file := devicetable-offsets.h
23 echo " * This file was generated by Kbuild"; \
32 $(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s
35 targets += $(devicetable-offsets-file) devicetable-offsets.s
40 $(obj)/file2alias.o: $(obj)/$(devicetable-offsets-file)
/linux-4.4.14/security/integrity/ima/
H A Dima_main.c20 #include <linux/file.h>
74 * - Opening a file for write when already open for read,
76 * - Opening a file for read when already open for write,
77 * could result in a file measurement error.
80 static void ima_rdwr_violation_check(struct file *file, ima_rdwr_violation_check() argument
86 struct inode *inode = file_inode(file); ima_rdwr_violation_check()
87 fmode_t mode = file->f_mode; ima_rdwr_violation_check()
106 *pathname = ima_d_path(&file->f_path, pathbuf); ima_rdwr_violation_check()
109 ima_add_violation(file, *pathname, iint, ima_rdwr_violation_check()
112 ima_add_violation(file, *pathname, iint, ima_rdwr_violation_check()
117 struct inode *inode, struct file *file) ima_check_last_writer()
119 fmode_t mode = file->f_mode; ima_check_last_writer()
130 ima_update_xattr(iint, file); ima_check_last_writer()
138 * @file: pointer to file structure being freed
142 void ima_file_free(struct file *file) ima_file_free() argument
144 struct inode *inode = file_inode(file); ima_file_free()
154 ima_check_last_writer(iint, inode, file); ima_file_free()
157 static int process_measurement(struct file *file, int mask, int function, process_measurement() argument
160 struct inode *inode = file_inode(file); process_measurement()
198 ima_rdwr_violation_check(file, iint, action & IMA_MEASURE, process_measurement()
226 rc = ima_collect_measurement(iint, file, xattr_ptr, &xattr_len); process_measurement()
228 if (file->f_flags & O_DIRECT) process_measurement()
234 pathname = ima_d_path(&file->f_path, &pathbuf); process_measurement()
237 ima_store_measurement(iint, file, pathname, process_measurement()
240 rc = ima_appraise_measurement(function, iint, file, pathname, process_measurement()
261 * @file: pointer to the file to be measured (May be NULL)
267 * On success return 0. On integrity appraisal error, assuming the file
270 int ima_file_mmap(struct file *file, unsigned long prot) ima_file_mmap() argument
272 if (file && (prot & PROT_EXEC)) ima_file_mmap()
273 return process_measurement(file, MAY_EXEC, MMAP_CHECK, 0); ima_file_mmap()
281 * The OS protects against an executable file, already open for write,
282 * from being executed in deny_write_access() and an executable file,
287 * On success return 0. On integrity appraisal error, assuming the file
292 return process_measurement(bprm->file, MAY_EXEC, BPRM_CHECK, 0); ima_bprm_check()
297 * @file: pointer to the file to be measured
302 * On success return 0. On integrity appraisal error, assuming the file
305 int ima_file_check(struct file *file, int mask, int opened) ima_file_check() argument
307 return process_measurement(file, ima_file_check()
315 * @file: pointer to the file to be measured/appraised
319 * On success return 0. On integrity appraisal error, assuming the file
322 int ima_module_check(struct file *file) ima_module_check() argument
324 if (!file) { ima_module_check()
332 return process_measurement(file, MAY_EXEC, MODULE_CHECK, 0); ima_module_check()
335 int ima_fw_from_file(struct file *file, char *buf, size_t size) ima_fw_from_file() argument
337 if (!file) { ima_fw_from_file()
343 return process_measurement(file, MAY_EXEC, FIRMWARE_CHECK, 0); ima_fw_from_file()
116 ima_check_last_writer(struct integrity_iint_cache *iint, struct inode *inode, struct file *file) ima_check_last_writer() argument
/linux-4.4.14/drivers/misc/mic/host/
H A Dmic_fops.h16 * the file called "COPYING".
24 int mic_open(struct inode *inode, struct file *filp);
25 int mic_release(struct inode *inode, struct file *filp);
26 ssize_t mic_read(struct file *filp, char __user *buf,
28 long mic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
29 int mic_mmap(struct file *f, struct vm_area_struct *vma);
30 unsigned int mic_poll(struct file *f, poll_table *wait);
/linux-4.4.14/drivers/infiniband/core/
H A Duser_mad.c9 * General Public License (GPL) Version 2, available from the file
72 * device special file is opened, we take a reference on the
150 static int hdr_size(struct ib_umad_file *file) hdr_size() argument
152 return file->use_pkey_index ? sizeof (struct ib_user_mad_hdr) : hdr_size()
156 /* caller must hold file->mutex */ __get_agent()
157 static struct ib_mad_agent *__get_agent(struct ib_umad_file *file, int id) __get_agent() argument
159 return file->agents_dead ? NULL : file->agent[id]; __get_agent()
162 static int queue_packet(struct ib_umad_file *file, queue_packet() argument
168 mutex_lock(&file->mutex); queue_packet()
173 if (agent == __get_agent(file, packet->mad.hdr.id)) { queue_packet()
174 list_add_tail(&packet->list, &file->recv_list); queue_packet()
175 wake_up_interruptible(&file->recv_wait); queue_packet()
180 mutex_unlock(&file->mutex); queue_packet()
185 static void dequeue_send(struct ib_umad_file *file, dequeue_send() argument
188 spin_lock_irq(&file->send_lock); dequeue_send()
190 spin_unlock_irq(&file->send_lock); dequeue_send()
196 struct ib_umad_file *file = agent->context; send_handler() local
199 dequeue_send(file, packet); send_handler()
206 if (!queue_packet(file, agent, packet)) send_handler()
215 struct ib_umad_file *file = agent->context; recv_handler() local
229 packet->mad.hdr.length = hdr_size(file) + mad_recv_wc->mad_len; recv_handler()
250 if (queue_packet(file, agent, packet)) recv_handler()
260 static ssize_t copy_recv_mad(struct ib_umad_file *file, char __user *buf, copy_recv_mad() argument
272 count < hdr_size(file) + packet->length) || copy_recv_mad()
274 count < hdr_size(file) + seg_size)) copy_recv_mad()
277 if (copy_to_user(buf, &packet->mad, hdr_size(file))) copy_recv_mad()
280 buf += hdr_size(file); copy_recv_mad()
290 if (count < hdr_size(file) + packet->length) { copy_recv_mad()
310 return hdr_size(file) + packet->length; copy_recv_mad()
313 static ssize_t copy_send_mad(struct ib_umad_file *file, char __user *buf, copy_send_mad() argument
316 ssize_t size = hdr_size(file) + packet->length; copy_send_mad()
321 if (copy_to_user(buf, &packet->mad, hdr_size(file))) copy_send_mad()
324 buf += hdr_size(file); copy_send_mad()
332 static ssize_t ib_umad_read(struct file *filp, char __user *buf, ib_umad_read()
335 struct ib_umad_file *file = filp->private_data; ib_umad_read() local
339 if (count < hdr_size(file)) ib_umad_read()
342 mutex_lock(&file->mutex); ib_umad_read()
344 while (list_empty(&file->recv_list)) { ib_umad_read()
345 mutex_unlock(&file->mutex); ib_umad_read()
350 if (wait_event_interruptible(file->recv_wait, ib_umad_read()
351 !list_empty(&file->recv_list))) ib_umad_read()
354 mutex_lock(&file->mutex); ib_umad_read()
357 packet = list_entry(file->recv_list.next, struct ib_umad_packet, list); ib_umad_read()
360 mutex_unlock(&file->mutex); ib_umad_read()
363 ret = copy_recv_mad(file, buf, packet, count); ib_umad_read()
365 ret = copy_send_mad(file, buf, packet, count); ib_umad_read()
369 mutex_lock(&file->mutex); ib_umad_read()
370 list_add(&packet->list, &file->recv_list); ib_umad_read()
371 mutex_unlock(&file->mutex); ib_umad_read()
412 static int is_duplicate(struct ib_umad_file *file, is_duplicate() argument
419 list_for_each_entry(sent_packet, &file->send_list, list) { is_duplicate()
445 static ssize_t ib_umad_write(struct file *filp, const char __user *buf, ib_umad_write()
448 struct ib_umad_file *file = filp->private_data; ib_umad_write() local
458 if (count < hdr_size(file) + IB_MGMT_RMPP_HDR) ib_umad_write()
465 if (copy_from_user(&packet->mad, buf, hdr_size(file))) { ib_umad_write()
475 buf += hdr_size(file); ib_umad_write()
482 mutex_lock(&file->mutex); ib_umad_write()
484 agent = __get_agent(file, packet->mad.hdr.id); ib_umad_write()
494 ah_attr.port_num = file->port->port_num; ib_umad_write()
524 data_len = count - hdr_size(file) - hdr_len; ib_umad_write()
571 spin_lock_irq(&file->send_lock); ib_umad_write()
572 list_add_tail(&packet->list, &file->send_list); ib_umad_write()
573 spin_unlock_irq(&file->send_lock); ib_umad_write()
575 spin_lock_irq(&file->send_lock); ib_umad_write()
576 ret = is_duplicate(file, packet); ib_umad_write()
578 list_add_tail(&packet->list, &file->send_list); ib_umad_write()
579 spin_unlock_irq(&file->send_lock); ib_umad_write()
590 mutex_unlock(&file->mutex); ib_umad_write()
594 dequeue_send(file, packet); ib_umad_write()
600 mutex_unlock(&file->mutex); ib_umad_write()
606 static unsigned int ib_umad_poll(struct file *filp, struct poll_table_struct *wait) ib_umad_poll()
608 struct ib_umad_file *file = filp->private_data; ib_umad_poll() local
613 poll_wait(filp, &file->recv_wait, wait); ib_umad_poll()
615 if (!list_empty(&file->recv_list)) ib_umad_poll()
621 static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg, ib_umad_reg_agent() argument
630 mutex_lock(&file->port->file_mutex); ib_umad_reg_agent()
631 mutex_lock(&file->mutex); ib_umad_reg_agent()
633 if (!file->port->ib_dev) { ib_umad_reg_agent()
634 dev_notice(file->port->dev, ib_umad_reg_agent()
646 dev_notice(file->port->dev, ib_umad_reg_agent()
654 if (!__get_agent(file, agent_id)) ib_umad_reg_agent()
657 dev_notice(file->port->dev, ib_umad_reg_agent()
682 agent = ib_register_mad_agent(file->port->ib_dev, file->port->port_num, ib_umad_reg_agent()
686 send_handler, recv_handler, file, 0); ib_umad_reg_agent()
699 if (!file->already_used) { ib_umad_reg_agent()
700 file->already_used = 1; ib_umad_reg_agent()
701 if (!file->use_pkey_index) { ib_umad_reg_agent()
702 dev_warn(file->port->dev, ib_umad_reg_agent()
705 dev_warn(file->port->dev, ib_umad_reg_agent()
710 file->agent[agent_id] = agent; ib_umad_reg_agent()
714 mutex_unlock(&file->mutex); ib_umad_reg_agent()
719 mutex_unlock(&file->port->file_mutex); ib_umad_reg_agent()
724 static int ib_umad_reg_agent2(struct ib_umad_file *file, void __user *arg) ib_umad_reg_agent2() argument
732 mutex_lock(&file->port->file_mutex); ib_umad_reg_agent2()
733 mutex_lock(&file->mutex); ib_umad_reg_agent2()
735 if (!file->port->ib_dev) { ib_umad_reg_agent2()
736 dev_notice(file->port->dev, ib_umad_reg_agent2()
748 dev_notice(file->port->dev, ib_umad_reg_agent2()
756 dev_notice(file->port->dev, ib_umad_reg_agent2()
770 if (!__get_agent(file, agent_id)) ib_umad_reg_agent2()
773 dev_notice(file->port->dev, ib_umad_reg_agent2()
785 dev_notice(file->port->dev, ib_umad_reg_agent2()
798 agent = ib_register_mad_agent(file->port->ib_dev, file->port->port_num, ib_umad_reg_agent2()
802 send_handler, recv_handler, file, ib_umad_reg_agent2()
817 if (!file->already_used) { ib_umad_reg_agent2()
818 file->already_used = 1; ib_umad_reg_agent2()
819 file->use_pkey_index = 1; ib_umad_reg_agent2()
822 file->agent[agent_id] = agent; ib_umad_reg_agent2()
826 mutex_unlock(&file->mutex); ib_umad_reg_agent2()
831 mutex_unlock(&file->port->file_mutex); ib_umad_reg_agent2()
837 static int ib_umad_unreg_agent(struct ib_umad_file *file, u32 __user *arg) ib_umad_unreg_agent() argument
846 mutex_lock(&file->port->file_mutex); ib_umad_unreg_agent()
847 mutex_lock(&file->mutex); ib_umad_unreg_agent()
849 if (id >= IB_UMAD_MAX_AGENTS || !__get_agent(file, id)) { ib_umad_unreg_agent()
854 agent = file->agent[id]; ib_umad_unreg_agent()
855 file->agent[id] = NULL; ib_umad_unreg_agent()
858 mutex_unlock(&file->mutex); ib_umad_unreg_agent()
863 mutex_unlock(&file->port->file_mutex); ib_umad_unreg_agent()
868 static long ib_umad_enable_pkey(struct ib_umad_file *file) ib_umad_enable_pkey() argument
872 mutex_lock(&file->mutex); ib_umad_enable_pkey()
873 if (file->already_used) ib_umad_enable_pkey()
876 file->use_pkey_index = 1; ib_umad_enable_pkey()
877 mutex_unlock(&file->mutex); ib_umad_enable_pkey()
882 static long ib_umad_ioctl(struct file *filp, unsigned int cmd, ib_umad_ioctl()
900 static long ib_umad_compat_ioctl(struct file *filp, unsigned int cmd, ib_umad_compat_ioctl()
922 * everything else is purely local to the file being created, so
925 * file structure being operated on;
927 static int ib_umad_open(struct inode *inode, struct file *filp) ib_umad_open()
930 struct ib_umad_file *file; ib_umad_open() local
941 file = kzalloc(sizeof *file, GFP_KERNEL); ib_umad_open()
942 if (!file) ib_umad_open()
945 mutex_init(&file->mutex); ib_umad_open()
946 spin_lock_init(&file->send_lock); ib_umad_open()
947 INIT_LIST_HEAD(&file->recv_list); ib_umad_open()
948 INIT_LIST_HEAD(&file->send_list); ib_umad_open()
949 init_waitqueue_head(&file->recv_wait); ib_umad_open()
951 file->port = port; ib_umad_open()
952 filp->private_data = file; ib_umad_open()
954 list_add_tail(&file->port_list, &port->file_list); ib_umad_open()
958 list_del(&file->port_list); ib_umad_open()
959 kfree(file); ib_umad_open()
970 static int ib_umad_close(struct inode *inode, struct file *filp) ib_umad_close()
972 struct ib_umad_file *file = filp->private_data; ib_umad_close() local
973 struct ib_umad_device *dev = file->port->umad_dev; ib_umad_close()
978 mutex_lock(&file->port->file_mutex); ib_umad_close()
979 mutex_lock(&file->mutex); ib_umad_close()
981 already_dead = file->agents_dead; ib_umad_close()
982 file->agents_dead = 1; ib_umad_close()
984 list_for_each_entry_safe(packet, tmp, &file->recv_list, list) { ib_umad_close()
990 list_del(&file->port_list); ib_umad_close()
992 mutex_unlock(&file->mutex); ib_umad_close()
996 if (file->agent[i]) ib_umad_close()
997 ib_unregister_mad_agent(file->agent[i]); ib_umad_close()
999 mutex_unlock(&file->port->file_mutex); ib_umad_close()
1001 kfree(file); ib_umad_close()
1021 static int ib_umad_sm_open(struct inode *inode, struct file *filp) ib_umad_sm_open()
1068 static int ib_umad_sm_close(struct inode *inode, struct file *filp) ib_umad_sm_close()
1243 struct ib_umad_file *file; ib_umad_kill_port() local
1259 list_for_each_entry(file, &port->file_list, port_list) { ib_umad_kill_port()
1260 mutex_lock(&file->mutex); ib_umad_kill_port()
1261 file->agents_dead = 1; ib_umad_kill_port()
1262 mutex_unlock(&file->mutex); ib_umad_kill_port()
1265 if (file->agent[id]) ib_umad_kill_port()
1266 ib_unregister_mad_agent(file->agent[id]); ib_umad_kill_port()
H A Duverbs_main.c10 * General Public License (GPL) Version 2, available from the file
44 #include <linux/file.h>
83 static ssize_t (*uverbs_cmd_table[])(struct ib_uverbs_file *file,
124 static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
153 struct ib_uverbs_event_file *file = ib_uverbs_release_event_file() local
156 kfree(file); ib_uverbs_release_event_file()
159 void ib_uverbs_release_ucq(struct ib_uverbs_file *file, ib_uverbs_release_ucq() argument
176 spin_lock_irq(&file->async_file->lock); ib_uverbs_release_ucq()
181 spin_unlock_irq(&file->async_file->lock); ib_uverbs_release_ucq()
184 void ib_uverbs_release_uevent(struct ib_uverbs_file *file, ib_uverbs_release_uevent() argument
189 spin_lock_irq(&file->async_file->lock); ib_uverbs_release_uevent()
194 spin_unlock_irq(&file->async_file->lock); ib_uverbs_release_uevent()
209 static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, ib_uverbs_cleanup_ucontext() argument
253 ib_uverbs_release_uevent(file, &uqp->uevent); ib_uverbs_cleanup_ucontext()
264 ib_uverbs_release_uevent(file, uevent); ib_uverbs_cleanup_ucontext()
276 ib_uverbs_release_ucq(file, ev_file, ucq); ib_uverbs_cleanup_ucontext()
288 mutex_lock(&file->device->xrcd_tree_mutex); ib_uverbs_cleanup_ucontext()
295 ib_uverbs_dealloc_xrcd(file->device, xrcd); ib_uverbs_cleanup_ucontext()
298 mutex_unlock(&file->device->xrcd_tree_mutex); ib_uverbs_cleanup_ucontext()
320 struct ib_uverbs_file *file = ib_uverbs_release_file() local
325 srcu_key = srcu_read_lock(&file->device->disassociate_srcu); ib_uverbs_release_file()
326 ib_dev = srcu_dereference(file->device->ib_dev, ib_uverbs_release_file()
327 &file->device->disassociate_srcu); ib_uverbs_release_file()
330 srcu_read_unlock(&file->device->disassociate_srcu, srcu_key); ib_uverbs_release_file()
332 if (atomic_dec_and_test(&file->device->refcount)) ib_uverbs_release_file()
333 ib_uverbs_comp_dev(file->device); ib_uverbs_release_file()
335 kfree(file); ib_uverbs_release_file()
338 static ssize_t ib_uverbs_event_read(struct file *filp, char __user *buf, ib_uverbs_event_read()
341 struct ib_uverbs_event_file *file = filp->private_data; ib_uverbs_event_read() local
346 spin_lock_irq(&file->lock); ib_uverbs_event_read()
348 while (list_empty(&file->event_list)) { ib_uverbs_event_read()
349 spin_unlock_irq(&file->lock); ib_uverbs_event_read()
354 if (wait_event_interruptible(file->poll_wait, ib_uverbs_event_read()
355 (!list_empty(&file->event_list) || ib_uverbs_event_read()
360 !file->uverbs_file->device->ib_dev))) ib_uverbs_event_read()
364 if (list_empty(&file->event_list) && ib_uverbs_event_read()
365 !file->uverbs_file->device->ib_dev) ib_uverbs_event_read()
368 spin_lock_irq(&file->lock); ib_uverbs_event_read()
371 event = list_entry(file->event_list.next, struct ib_uverbs_event, list); ib_uverbs_event_read()
373 if (file->is_async) ib_uverbs_event_read()
382 list_del(file->event_list.next); ib_uverbs_event_read()
389 spin_unlock_irq(&file->lock); ib_uverbs_event_read()
403 static unsigned int ib_uverbs_event_poll(struct file *filp, ib_uverbs_event_poll()
407 struct ib_uverbs_event_file *file = filp->private_data; ib_uverbs_event_poll() local
409 poll_wait(filp, &file->poll_wait, wait); ib_uverbs_event_poll()
411 spin_lock_irq(&file->lock); ib_uverbs_event_poll()
412 if (!list_empty(&file->event_list)) ib_uverbs_event_poll()
414 spin_unlock_irq(&file->lock); ib_uverbs_event_poll()
419 static int ib_uverbs_event_fasync(int fd, struct file *filp, int on) ib_uverbs_event_fasync()
421 struct ib_uverbs_event_file *file = filp->private_data; ib_uverbs_event_fasync() local
423 return fasync_helper(fd, filp, on, &file->async_queue); ib_uverbs_event_fasync()
426 static int ib_uverbs_event_close(struct inode *inode, struct file *filp) ib_uverbs_event_close()
428 struct ib_uverbs_event_file *file = filp->private_data; ib_uverbs_event_close() local
432 mutex_lock(&file->uverbs_file->device->lists_mutex); ib_uverbs_event_close()
433 spin_lock_irq(&file->lock); ib_uverbs_event_close()
434 closed_already = file->is_closed; ib_uverbs_event_close()
435 file->is_closed = 1; ib_uverbs_event_close()
436 list_for_each_entry_safe(entry, tmp, &file->event_list, list) { ib_uverbs_event_close()
441 spin_unlock_irq(&file->lock); ib_uverbs_event_close()
443 list_del(&file->list); ib_uverbs_event_close()
444 if (file->is_async) ib_uverbs_event_close()
445 ib_unregister_event_handler(&file->uverbs_file-> ib_uverbs_event_close()
448 mutex_unlock(&file->uverbs_file->device->lists_mutex); ib_uverbs_event_close()
450 kref_put(&file->uverbs_file->ref, ib_uverbs_release_file); ib_uverbs_event_close()
451 kref_put(&file->ref, ib_uverbs_release_event_file); ib_uverbs_event_close()
467 struct ib_uverbs_event_file *file = cq_context; ib_uverbs_comp_handler() local
472 if (!file) ib_uverbs_comp_handler()
475 spin_lock_irqsave(&file->lock, flags); ib_uverbs_comp_handler()
476 if (file->is_closed) { ib_uverbs_comp_handler()
477 spin_unlock_irqrestore(&file->lock, flags); ib_uverbs_comp_handler()
483 spin_unlock_irqrestore(&file->lock, flags); ib_uverbs_comp_handler()
492 list_add_tail(&entry->list, &file->event_list); ib_uverbs_comp_handler()
494 spin_unlock_irqrestore(&file->lock, flags); ib_uverbs_comp_handler()
496 wake_up_interruptible(&file->poll_wait); ib_uverbs_comp_handler()
497 kill_fasync(&file->async_queue, SIGIO, POLL_IN); ib_uverbs_comp_handler()
500 static void ib_uverbs_async_handler(struct ib_uverbs_file *file, ib_uverbs_async_handler() argument
508 spin_lock_irqsave(&file->async_file->lock, flags); ib_uverbs_async_handler()
509 if (file->async_file->is_closed) { ib_uverbs_async_handler()
510 spin_unlock_irqrestore(&file->async_file->lock, flags); ib_uverbs_async_handler()
516 spin_unlock_irqrestore(&file->async_file->lock, flags); ib_uverbs_async_handler()
525 list_add_tail(&entry->list, &file->async_file->event_list); ib_uverbs_async_handler()
528 spin_unlock_irqrestore(&file->async_file->lock, flags); ib_uverbs_async_handler()
530 wake_up_interruptible(&file->async_file->poll_wait); ib_uverbs_async_handler()
531 kill_fasync(&file->async_file->async_queue, SIGIO, POLL_IN); ib_uverbs_async_handler()
575 struct ib_uverbs_file *file = ib_uverbs_event_handler() local
578 ib_uverbs_async_handler(file, event->element.port_num, event->event, ib_uverbs_event_handler()
582 void ib_uverbs_free_async_event_file(struct ib_uverbs_file *file) ib_uverbs_free_async_event_file() argument
584 kref_put(&file->async_file->ref, ib_uverbs_release_event_file); ib_uverbs_free_async_event_file()
585 file->async_file = NULL; ib_uverbs_free_async_event_file()
588 struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file, ib_uverbs_alloc_event_file()
593 struct file *filp; ib_uverbs_alloc_event_file()
630 /* At that point async file stuff was fully set */ ib_uverbs_alloc_event_file()
649 * Look up a completion event file by FD. If lookup is successful,
650 * takes a ref to the event file struct that it returns; if
658 if (!f.file) ib_uverbs_lookup_comp_file()
661 if (f.file->f_op != &uverbs_event_fops) ib_uverbs_lookup_comp_file()
664 ev_file = f.file->private_data; ib_uverbs_lookup_comp_file()
677 static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, ib_uverbs_write()
680 struct ib_uverbs_file *file = filp->private_data; ib_uverbs_write() local
696 srcu_key = srcu_read_lock(&file->device->disassociate_srcu); ib_uverbs_write()
697 ib_dev = srcu_dereference(file->device->ib_dev, ib_uverbs_write()
698 &file->device->disassociate_srcu); ib_uverbs_write()
724 if (!file->ucontext && ib_uverbs_write()
740 ret = uverbs_cmd_table[command](file, ib_dev, ib_uverbs_write()
767 if (!file->ucontext) { ib_uverbs_write()
828 ret = uverbs_ex_cmd_table[command](file, ib_uverbs_write()
839 srcu_read_unlock(&file->device->disassociate_srcu, srcu_key); ib_uverbs_write()
843 static int ib_uverbs_mmap(struct file *filp, struct vm_area_struct *vma) ib_uverbs_mmap()
845 struct ib_uverbs_file *file = filp->private_data; ib_uverbs_mmap() local
850 srcu_key = srcu_read_lock(&file->device->disassociate_srcu); ib_uverbs_mmap()
851 ib_dev = srcu_dereference(file->device->ib_dev, ib_uverbs_mmap()
852 &file->device->disassociate_srcu); ib_uverbs_mmap()
858 if (!file->ucontext) ib_uverbs_mmap()
861 ret = ib_dev->mmap(file->ucontext, vma); ib_uverbs_mmap()
863 srcu_read_unlock(&file->device->disassociate_srcu, srcu_key); ib_uverbs_mmap()
871 * everything else is purely local to the file being created, so
877 static int ib_uverbs_open(struct inode *inode, struct file *filp) ib_uverbs_open()
880 struct ib_uverbs_file *file; ib_uverbs_open() local
911 file = kzalloc(sizeof(*file), GFP_KERNEL); ib_uverbs_open()
912 if (!file) { ib_uverbs_open()
920 file->device = dev; ib_uverbs_open()
921 file->ucontext = NULL; ib_uverbs_open()
922 file->async_file = NULL; ib_uverbs_open()
923 kref_init(&file->ref); ib_uverbs_open()
924 mutex_init(&file->mutex); ib_uverbs_open()
926 filp->private_data = file; ib_uverbs_open()
928 list_add_tail(&file->list, &dev->uverbs_file_list); ib_uverbs_open()
946 static int ib_uverbs_close(struct inode *inode, struct file *filp) ib_uverbs_close()
948 struct ib_uverbs_file *file = filp->private_data; ib_uverbs_close() local
949 struct ib_uverbs_device *dev = file->device; ib_uverbs_close()
952 mutex_lock(&file->device->lists_mutex); ib_uverbs_close()
953 ucontext = file->ucontext; ib_uverbs_close()
954 file->ucontext = NULL; ib_uverbs_close()
955 if (!file->is_closed) { ib_uverbs_close()
956 list_del(&file->list); ib_uverbs_close()
957 file->is_closed = 1; ib_uverbs_close()
959 mutex_unlock(&file->device->lists_mutex); ib_uverbs_close()
961 ib_uverbs_cleanup_ucontext(file, ucontext); ib_uverbs_close()
963 if (file->async_file) ib_uverbs_close()
964 kref_put(&file->async_file->ref, ib_uverbs_release_event_file); ib_uverbs_close()
966 kref_put(&file->ref, ib_uverbs_release_file); ib_uverbs_close()
1162 struct ib_uverbs_file *file; ib_uverbs_free_hw_resources() local
1176 file = list_first_entry(&uverbs_dev->uverbs_file_list, ib_uverbs_free_hw_resources()
1178 file->is_closed = 1; ib_uverbs_free_hw_resources()
1179 ucontext = file->ucontext; ib_uverbs_free_hw_resources()
1180 list_del(&file->list); ib_uverbs_free_hw_resources()
1181 file->ucontext = NULL; ib_uverbs_free_hw_resources()
1182 kref_get(&file->ref); ib_uverbs_free_hw_resources()
1189 ib_uverbs_event_handler(&file->event_handler, &event); ib_uverbs_free_hw_resources()
1192 ib_uverbs_cleanup_ucontext(file, ucontext); ib_uverbs_free_hw_resources()
1196 kref_put(&file->ref, ib_uverbs_release_file); ib_uverbs_free_hw_resources()
/linux-4.4.14/drivers/net/wireless/mediatek/mt7601u/
H A Ddebugfs.c41 mt7601u_ampdu_stat_read(struct seq_file *file, void *data) mt7601u_ampdu_stat_read() argument
43 struct mt7601u_dev *dev = file->private; mt7601u_ampdu_stat_read()
47 seq_printf(file, #name ":\t%llu\n", dev->stats.grp[off]) mt7601u_ampdu_stat_read()
70 seq_puts(file, "Aggregations stats:\n"); mt7601u_ampdu_stat_read()
73 seq_printf(file, "%08llx ", mt7601u_ampdu_stat_read()
75 seq_putc(file, '\n'); mt7601u_ampdu_stat_read()
78 seq_printf(file, "recent average AMPDU len: %d\n", mt7601u_ampdu_stat_read()
85 mt7601u_ampdu_stat_open(struct inode *inode, struct file *f) mt7601u_ampdu_stat_open()
98 mt7601u_eeprom_param_read(struct seq_file *file, void *data) mt7601u_eeprom_param_read() argument
100 struct mt7601u_dev *dev = file->private; mt7601u_eeprom_param_read()
105 seq_printf(file, "RF freq offset: %hhx\n", dev->ee->rf_freq_off); mt7601u_eeprom_param_read()
106 seq_printf(file, "RSSI offset: %hhx %hhx\n", mt7601u_eeprom_param_read()
108 seq_printf(file, "Reference temp: %hhx\n", dev->ee->ref_temp); mt7601u_eeprom_param_read()
109 seq_printf(file, "LNA gain: %hhx\n", dev->ee->lna_gain); mt7601u_eeprom_param_read()
110 seq_printf(file, "Reg channels: %hhu-%hhu\n", dev->ee->reg.start, mt7601u_eeprom_param_read()
113 seq_puts(file, "Per rate power:\n"); mt7601u_eeprom_param_read()
115 seq_printf(file, "\t raw:%02hhx bw20:%02hhx bw40:%02hhx\n", mt7601u_eeprom_param_read()
118 seq_printf(file, "\t raw:%02hhx bw20:%02hhx bw40:%02hhx\n", mt7601u_eeprom_param_read()
121 seq_printf(file, "\t raw:%02hhx bw20:%02hhx bw40:%02hhx\n", mt7601u_eeprom_param_read()
124 seq_puts(file, "Per channel power:\n"); mt7601u_eeprom_param_read()
126 seq_printf(file, "\t tx_power ch%u:%02hhx ch%u:%02hhx\n", mt7601u_eeprom_param_read()
133 seq_puts(file, "TSSI:\n"); mt7601u_eeprom_param_read()
134 seq_printf(file, "\t slope:%02hhx\n", td->slope); mt7601u_eeprom_param_read()
135 seq_printf(file, "\t offset=%02hhx %02hhx %02hhx\n", mt7601u_eeprom_param_read()
137 seq_printf(file, "\t delta_off:%08x\n", td->tx0_delta_offset); mt7601u_eeprom_param_read()
143 mt7601u_eeprom_param_open(struct inode *inode, struct file *f) mt7601u_eeprom_param_open()
/linux-4.4.14/fs/hfsplus/
H A Dioctl.c24 * the platform firmware which file to boot from
26 static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags) hfsplus_ioctl_bless() argument
28 struct dentry *dentry = file->f_path.dentry; hfsplus_ioctl_bless()
46 * hard links - the firmware wants the ID of the hard link file, hfsplus_ioctl_bless()
59 static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) hfsplus_ioctl_getflags() argument
61 struct inode *inode = file_inode(file); hfsplus_ioctl_getflags()
75 static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) hfsplus_ioctl_setflags() argument
77 struct inode *inode = file_inode(file); hfsplus_ioctl_setflags()
82 err = mnt_want_write_file(file); hfsplus_ioctl_setflags()
131 mnt_drop_write_file(file); hfsplus_ioctl_setflags()
136 long hfsplus_ioctl(struct file *file, unsigned int cmd, unsigned long arg) hfsplus_ioctl() argument
142 return hfsplus_ioctl_getflags(file, argp); hfsplus_ioctl()
144 return hfsplus_ioctl_setflags(file, argp); hfsplus_ioctl()
146 return hfsplus_ioctl_bless(file, argp); hfsplus_ioctl()
/linux-4.4.14/drivers/usb/mon/
H A Dmon_stat.c26 static int mon_stat_open(struct inode *inode, struct file *file) mon_stat_open() argument
41 file->private_data = sp; mon_stat_open()
45 static ssize_t mon_stat_read(struct file *file, char __user *buf, mon_stat_read() argument
48 struct snap *sp = file->private_data; mon_stat_read()
53 static int mon_stat_release(struct inode *inode, struct file *file) mon_stat_release() argument
55 struct snap *sp = file->private_data; mon_stat_release()
56 file->private_data = NULL; mon_stat_release()
/linux-4.4.14/arch/blackfin/boot/
H A Dinstall.sh5 # This file is subject to the terms and conditions of the GNU General Public
6 # License. See the file "COPYING" in the main directory of this archive
18 # $2 - kernel image file
19 # $3 - kernel map file
26 echo " *** Missing file: $1" 1>&2
47 local file=$1
48 [ -f ${file} ] || return 0
49 local stamp=$(stat -c %Y ${file} 2>/dev/null)
50 mv ${file} ${file}.${stamp:-old}
/linux-4.4.14/fs/ecryptfs/
H A Dfile.c26 #include <linux/file.h>
43 * returns without any errors. This is to be used only for file reads.
51 struct file *file = iocb->ki_filp; ecryptfs_read_update_atime() local
55 path = ecryptfs_dentry_to_lower_path(file->f_path.dentry); ecryptfs_read_update_atime()
101 * @file: The eCryptfs directory file
104 static int ecryptfs_readdir(struct file *file, struct dir_context *ctx) ecryptfs_readdir() argument
107 struct file *lower_file; ecryptfs_readdir()
108 struct inode *inode = file_inode(file); ecryptfs_readdir()
114 lower_file = ecryptfs_file_to_lower(file); ecryptfs_readdir()
175 * @inode: inode speciying file to open
176 * @file: Structure to return filled in
178 * Opens the file specified by inode.
182 static int ecryptfs_open(struct inode *inode, struct file *file) ecryptfs_open() argument
186 struct dentry *ecryptfs_dentry = file->f_path.dentry; ecryptfs_open()
193 ecryptfs_set_file_private(file, file_info); ecryptfs_open()
212 "the lower file for the dentry with name " ecryptfs_open()
218 == O_RDONLY && (file->f_flags & O_ACCMODE) != O_RDONLY) { ecryptfs_open()
220 printk(KERN_WARNING "%s: Lower file is RO; eCryptfs " ecryptfs_open()
221 "file must hence be opened RO\n", __func__); ecryptfs_open()
225 file, ecryptfs_inode_to_private(inode)->lower_file); ecryptfs_open()
245 ecryptfs_file_to_private(file)); ecryptfs_open()
250 static int ecryptfs_flush(struct file *file, fl_owner_t td) ecryptfs_flush() argument
252 struct file *lower_file = ecryptfs_file_to_lower(file); ecryptfs_flush()
255 filemap_write_and_wait(file->f_mapping); ecryptfs_flush()
262 static int ecryptfs_release(struct inode *inode, struct file *file) ecryptfs_release() argument
266 ecryptfs_file_to_private(file)); ecryptfs_release()
271 ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync) ecryptfs_fsync() argument
275 rc = filemap_write_and_wait(file->f_mapping); ecryptfs_fsync()
279 return vfs_fsync(ecryptfs_file_to_lower(file), datasync); ecryptfs_fsync()
282 static int ecryptfs_fasync(int fd, struct file *file, int flag) ecryptfs_fasync() argument
285 struct file *lower_file = NULL; ecryptfs_fasync()
287 lower_file = ecryptfs_file_to_lower(file); ecryptfs_fasync()
294 ecryptfs_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ecryptfs_unlocked_ioctl() argument
296 struct file *lower_file = ecryptfs_file_to_lower(file); ecryptfs_unlocked_ioctl()
309 fsstack_copy_attr_all(file_inode(file), file_inode(lower_file)); ecryptfs_unlocked_ioctl()
319 ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ecryptfs_compat_ioctl() argument
321 struct file *lower_file = ecryptfs_file_to_lower(file); ecryptfs_compat_ioctl()
333 fsstack_copy_attr_all(file_inode(file), file_inode(lower_file)); ecryptfs_compat_ioctl()
H A DMakefile7 ecryptfs-y := dentry.o file.o inode.o main.o super.o mmap.o read_write.o \
/linux-4.4.14/fs/nfsd/
H A Dfault_inject.c19 char *file; member in struct:nfsd_fault_inject_op
27 static ssize_t fault_inject_read(struct file *file, char __user *buf, fault_inject_read() argument
34 struct nfsd_fault_inject_op *op = file_inode(file)->i_private; fault_inject_read()
43 static ssize_t fault_inject_write(struct file *file, const char __user *buf, fault_inject_write() argument
50 struct nfsd_fault_inject_op *op = file_inode(file)->i_private; fault_inject_write()
70 op->file, write_buf, val); fault_inject_write()
74 pr_info("NFSD Fault Injection: %s (all)", op->file); fault_inject_write()
77 op->file, val); fault_inject_write()
79 pr_info("NFSD: %s: found %llu", op->file, val); fault_inject_write()
97 .file = "forget_clients",
103 .file = "forget_locks",
109 .file = "forget_openowners",
115 .file = "forget_delegations",
121 .file = "recall_delegations",
142 if (!debugfs_create_file(op->file, mode, debug_dir, op, &fops_nfsd)) nfsd_fault_inject_init()
/linux-4.4.14/include/uapi/linux/
H A Dfalloc.h9 * FALLOC_FL_COLLAPSE_RANGE is used to remove a range of a file
10 * without leaving a hole in the file. The contents of the file beyond
13 * resulting in a file layout that looks like the range that was
14 * removed never existed. As such collapsing a range of a file changes
15 * the size of the file, reducing it by the same length of the range
22 * filesystem or file.
24 * Attempting to collapse a range that crosses the end of the file is
31 * FALLOC_FL_ZERO_RANGE is used to convert a range of file to zeros preferably
33 * span holes in the file, and the entire range is preferable converted to
34 * unwritten extents - even though file system may choose to zero out the
36 * while the range remains allocated for the file.
45 * FALLOC_FL_INSERT_RANGE is use to insert space within the file size without
46 * overwriting any existing data. The contents of the file beyond offset are
48 * operation will increase the size of the file by len bytes.
53 * the filesystem and/or the configuration of the filesystem or file.
56 * the file is considered an illegal operation - just use ftruncate(2) or
/linux-4.4.14/fs/ceph/
H A Dioctl.c14 * get and set the file layout
16 static long ceph_ioctl_get_layout(struct file *file, void __user *arg) ceph_ioctl_get_layout() argument
18 struct ceph_inode_info *ci = ceph_inode(file_inode(file)); ceph_ioctl_get_layout()
22 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); ceph_ioctl_get_layout()
63 static long ceph_ioctl_set_layout(struct file *file, void __user *arg) ceph_ioctl_set_layout() argument
65 struct inode *inode = file_inode(file); ceph_ioctl_set_layout()
69 struct ceph_inode_info *ci = ceph_inode(file_inode(file)); ceph_ioctl_set_layout()
77 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); ceph_ioctl_set_layout()
135 static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) ceph_ioctl_set_layout_policy() argument
137 struct inode *inode = file_inode(file); ceph_ioctl_set_layout_policy()
176 * number, network address) for a given file offset.
178 static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) ceph_ioctl_get_dataloc() argument
181 struct inode *inode = file_inode(file); ceph_ioctl_get_dataloc()
242 static long ceph_ioctl_lazyio(struct file *file) ceph_ioctl_lazyio() argument
244 struct ceph_file_info *fi = file->private_data; ceph_ioctl_lazyio()
245 struct inode *inode = file_inode(file); ceph_ioctl_lazyio()
254 dout("ioctl_layzio: file %p marked lazy\n", file); ceph_ioctl_lazyio()
258 dout("ioctl_layzio: file %p already lazy\n", file); ceph_ioctl_lazyio()
263 static long ceph_ioctl_syncio(struct file *file) ceph_ioctl_syncio() argument
265 struct ceph_file_info *fi = file->private_data; ceph_ioctl_syncio()
271 long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ceph_ioctl() argument
273 dout("ioctl file %p cmd %u arg %lu\n", file, cmd, arg); ceph_ioctl()
276 return ceph_ioctl_get_layout(file, (void __user *)arg); ceph_ioctl()
279 return ceph_ioctl_set_layout(file, (void __user *)arg); ceph_ioctl()
282 return ceph_ioctl_set_layout_policy(file, (void __user *)arg); ceph_ioctl()
285 return ceph_ioctl_get_dataloc(file, (void __user *)arg); ceph_ioctl()
288 return ceph_ioctl_lazyio(file); ceph_ioctl()
291 return ceph_ioctl_syncio(file); ceph_ioctl()
/linux-4.4.14/drivers/staging/dgnc/
H A Ddgnc_mgmt.h21 int dgnc_mgmt_open(struct inode *inode, struct file *file);
22 int dgnc_mgmt_close(struct inode *inode, struct file *file);
23 long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
/linux-4.4.14/drivers/media/pci/cx23885/
H A Dcx23885-ioctl.h23 int cx23885_g_chip_info(struct file *file, void *fh,
27 int cx23885_g_register(struct file *file, void *fh,
31 int cx23885_s_register(struct file *file, void *fh,
/linux-4.4.14/drivers/net/wireless/libertas/
H A Ddebugfs.c24 static ssize_t write_file_dummy(struct file *file, const char __user *buf, write_file_dummy() argument
32 static ssize_t lbs_dev_info(struct file *file, char __user *userbuf, lbs_dev_info() argument
35 struct lbs_private *priv = file->private_data; lbs_dev_info()
54 static ssize_t lbs_sleepparams_write(struct file *file, lbs_sleepparams_write() argument
58 struct lbs_private *priv = file->private_data; lbs_sleepparams_write()
95 static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf, lbs_sleepparams_read() argument
98 struct lbs_private *priv = file->private_data; lbs_sleepparams_read()
123 static ssize_t lbs_host_sleep_write(struct file *file, lbs_host_sleep_write() argument
127 struct lbs_private *priv = file->private_data; lbs_host_sleep_write()
169 static ssize_t lbs_host_sleep_read(struct file *file, char __user *userbuf, lbs_host_sleep_read() argument
172 struct lbs_private *priv = file->private_data; lbs_host_sleep_read()
225 struct file *file, char __user *userbuf, lbs_threshold_read()
230 struct lbs_private *priv = file->private_data; lbs_threshold_read()
277 struct file *file, lbs_threshold_write()
283 struct lbs_private *priv = file->private_data; lbs_threshold_write()
351 static ssize_t lbs_lowrssi_read(struct file *file, char __user *userbuf, lbs_lowrssi_read() argument
355 file, userbuf, count, ppos); lbs_lowrssi_read()
359 static ssize_t lbs_lowrssi_write(struct file *file, const char __user *userbuf, lbs_lowrssi_write() argument
363 file, userbuf, count, ppos); lbs_lowrssi_write()
367 static ssize_t lbs_lowsnr_read(struct file *file, char __user *userbuf, lbs_lowsnr_read() argument
371 file, userbuf, count, ppos); lbs_lowsnr_read()
375 static ssize_t lbs_lowsnr_write(struct file *file, const char __user *userbuf, lbs_lowsnr_write() argument
379 file, userbuf, count, ppos); lbs_lowsnr_write()
383 static ssize_t lbs_failcount_read(struct file *file, char __user *userbuf, lbs_failcount_read() argument
387 file, userbuf, count, ppos); lbs_failcount_read()
391 static ssize_t lbs_failcount_write(struct file *file, const char __user *userbuf, lbs_failcount_write() argument
395 file, userbuf, count, ppos); lbs_failcount_write()
399 static ssize_t lbs_highrssi_read(struct file *file, char __user *userbuf, lbs_highrssi_read() argument
403 file, userbuf, count, ppos); lbs_highrssi_read()
407 static ssize_t lbs_highrssi_write(struct file *file, const char __user *userbuf, lbs_highrssi_write() argument
411 file, userbuf, count, ppos); lbs_highrssi_write()
415 static ssize_t lbs_highsnr_read(struct file *file, char __user *userbuf, lbs_highsnr_read() argument
419 file, userbuf, count, ppos); lbs_highsnr_read()
423 static ssize_t lbs_highsnr_write(struct file *file, const char __user *userbuf, lbs_highsnr_write() argument
427 file, userbuf, count, ppos); lbs_highsnr_write()
430 static ssize_t lbs_bcnmiss_read(struct file *file, char __user *userbuf, lbs_bcnmiss_read() argument
434 file, userbuf, count, ppos); lbs_bcnmiss_read()
438 static ssize_t lbs_bcnmiss_write(struct file *file, const char __user *userbuf, lbs_bcnmiss_write() argument
442 file, userbuf, count, ppos); lbs_bcnmiss_write()
446 static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf, lbs_rdmac_read() argument
449 struct lbs_private *priv = file->private_data; lbs_rdmac_read()
470 static ssize_t lbs_rdmac_write(struct file *file, lbs_rdmac_write() argument
474 struct lbs_private *priv = file->private_data; lbs_rdmac_write()
493 static ssize_t lbs_wrmac_write(struct file *file, lbs_wrmac_write() argument
498 struct lbs_private *priv = file->private_data; lbs_wrmac_write()
527 static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf, lbs_rdbbp_read() argument
530 struct lbs_private *priv = file->private_data; lbs_rdbbp_read()
552 static ssize_t lbs_rdbbp_write(struct file *file, lbs_rdbbp_write() argument
556 struct lbs_private *priv = file->private_data; lbs_rdbbp_write()
575 static ssize_t lbs_wrbbp_write(struct file *file, lbs_wrbbp_write() argument
580 struct lbs_private *priv = file->private_data; lbs_wrbbp_write()
609 static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf, lbs_rdrf_read() argument
612 struct lbs_private *priv = file->private_data; lbs_rdrf_read()
634 static ssize_t lbs_rdrf_write(struct file *file, lbs_rdrf_write() argument
638 struct lbs_private *priv = file->private_data; lbs_rdrf_write()
657 static ssize_t lbs_wrrf_write(struct file *file, lbs_wrrf_write() argument
662 struct lbs_private *priv = file->private_data; lbs_wrrf_write()
850 * @file: file to read
857 static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf, lbs_debugfs_read() argument
873 d = file->private_data; lbs_debugfs_read()
897 * @f: file pointer
900 * @ppos: file position
904 static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf, lbs_debugfs_write()
969 * lbs_debug_init - create debug proc file
224 lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask, struct file *file, char __user *userbuf, size_t count, loff_t *ppos) lbs_threshold_read() argument
276 lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask, struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) lbs_threshold_write() argument
/linux-4.4.14/tools/power/acpi/tools/acpidump/
H A Dapfiles.c74 * RETURN: Open file handle
76 * DESCRIPTION: Open a text output file for acpidump. Checks if file already
83 ACPI_FILE file; ap_open_output_file() local
85 /* If file exists, prompt for overwrite */ ap_open_output_file()
91 /* Point stdout to the file */ ap_open_output_file()
93 file = acpi_os_open_file(pathname, ACPI_FILE_WRITING); ap_open_output_file()
94 if (!file) { ap_open_output_file()
95 acpi_log_error("Could not open output file: %s\n", pathname); ap_open_output_file()
99 /* Save the file and path */ ap_open_output_file()
101 gbl_output_file = file; ap_open_output_file()
115 * DESCRIPTION: Write an ACPI table to a binary file. Builds the output
124 ACPI_FILE file; ap_write_to_binary_file() local
157 ("Writing [%4.4s] to binary file: %s 0x%X (%u) bytes\n", ap_write_to_binary_file()
161 /* Open the file and dump the entire table in binary mode */ ap_write_to_binary_file()
163 file = acpi_os_open_file(filename, ap_write_to_binary_file()
165 if (!file) { ap_write_to_binary_file()
166 acpi_log_error("Could not open output file: %s\n", filename); ap_write_to_binary_file()
170 actual = acpi_os_write_file(file, table, 1, table_length); ap_write_to_binary_file()
172 acpi_log_error("Error writing binary output file: %s\n", ap_write_to_binary_file()
174 acpi_os_close_file(file); ap_write_to_binary_file()
178 acpi_os_close_file(file); ap_write_to_binary_file()
187 * out_file_size - Where the file size is returned
191 * DESCRIPTION: Open a file and read it entirely into a new buffer
199 ACPI_FILE file; ap_get_table_from_file() local
205 file = ap_get_table_from_file()
207 if (!file) { ap_get_table_from_file()
208 acpi_log_error("Could not open input file: %s\n", pathname); ap_get_table_from_file()
212 /* Need file size to allocate a buffer */ ap_get_table_from_file()
214 file_size = cm_get_file_size(file); ap_get_table_from_file()
216 acpi_log_error("Could not get input file size: %s\n", pathname); ap_get_table_from_file()
220 /* Allocate a buffer for the entire file */ ap_get_table_from_file()
224 acpi_log_error("Could not allocate file buffer of size: %u\n", ap_get_table_from_file()
229 /* Read the entire file */ ap_get_table_from_file()
231 actual = acpi_os_read_file(file, buffer, 1, file_size); ap_get_table_from_file()
233 acpi_log_error("Could not read input file: %s\n", pathname); ap_get_table_from_file()
242 acpi_os_close_file(file); ap_get_table_from_file()
/linux-4.4.14/drivers/md/bcache/
H A Dsysfs.h50 #define sysfs_printf(file, fmt, ...) \
52 if (attr == &sysfs_ ## file) \
56 #define sysfs_print(file, var) \
58 if (attr == &sysfs_ ## file) \
62 #define sysfs_hprint(file, val) \
64 if (attr == &sysfs_ ## file) { \
75 #define sysfs_strtoul(file, var) \
77 if (attr == &sysfs_ ## file) \
81 #define sysfs_strtoul_clamp(file, var, min, max) \
83 if (attr == &sysfs_ ## file) \
104 #define sysfs_hatoi(file, var) \
106 if (attr == &sysfs_ ## file) \
/linux-4.4.14/arch/um/drivers/
H A Dmmapper_kern.c28 static ssize_t mmapper_read(struct file *file, char __user *buf, size_t count, mmapper_read() argument
34 static ssize_t mmapper_write(struct file *file, const char __user *buf, mmapper_write() argument
43 static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg) mmapper_ioctl() argument
48 static int mmapper_mmap(struct file *file, struct vm_area_struct *vma) mmapper_mmap() argument
72 static int mmapper_open(struct inode *inode, struct file *file) mmapper_open() argument
77 static int mmapper_release(struct inode *inode, struct file *file) mmapper_release() argument
H A Dhostaudio_kern.c68 /* /dev/dsp file operations */
70 static ssize_t hostaudio_read(struct file *file, char __user *buffer, hostaudio_read() argument
73 struct hostaudio_state *state = file->private_data; hostaudio_read()
97 static ssize_t hostaudio_write(struct file *file, const char __user *buffer, hostaudio_write() argument
100 struct hostaudio_state *state = file->private_data; hostaudio_write()
126 static unsigned int hostaudio_poll(struct file *file, hostaudio_poll() argument
138 static long hostaudio_ioctl(struct file *file, hostaudio_ioctl() argument
141 struct hostaudio_state *state = file->private_data; hostaudio_ioctl()
181 static int hostaudio_open(struct inode *inode, struct file *file) hostaudio_open() argument
197 if (file->f_mode & FMODE_READ) hostaudio_open()
199 if (file->f_mode & FMODE_WRITE) hostaudio_open()
213 file->private_data = state; hostaudio_open()
217 static int hostaudio_release(struct inode *inode, struct file *file) hostaudio_release() argument
219 struct hostaudio_state *state = file->private_data; hostaudio_release()
230 /* /dev/mixer file operations */
232 static long hostmixer_ioctl_mixdev(struct file *file, hostmixer_ioctl_mixdev() argument
235 struct hostmixer_state *state = file->private_data; hostmixer_ioctl_mixdev()
244 static int hostmixer_open_mixdev(struct inode *inode, struct file *file) hostmixer_open_mixdev() argument
258 if (file->f_mode & FMODE_READ) hostmixer_open_mixdev()
260 if (file->f_mode & FMODE_WRITE) hostmixer_open_mixdev()
278 file->private_data = state; hostmixer_open_mixdev()
282 static int hostmixer_release(struct inode *inode, struct file *file) hostmixer_release() argument
284 struct hostmixer_state *state = file->private_data; hostmixer_release()
/linux-4.4.14/include/linux/ceph/
H A Ddebugfs.h8 static int name##_open(struct inode *inode, struct file *file) \
10 return single_open(file, name, inode->i_private); \
/linux-4.4.14/arch/sh/mm/
H A Dcache-debugfs.c6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
25 static int cache_seq_show(struct seq_file *file, void *iter) cache_seq_show() argument
27 unsigned int cache_type = (unsigned int)file->private; cache_seq_show()
43 seq_printf(file, "disabled\n"); cache_seq_show()
70 seq_printf(file, "-----------------------------------------\n"); cache_seq_show()
71 seq_printf(file, "Way %d\n", way); cache_seq_show()
72 seq_printf(file, "-----------------------------------------\n"); cache_seq_show()
84 seq_printf(file, "%3d: %c 0x%lx\n", cache_seq_show()
97 static int cache_debugfs_open(struct inode *inode, struct file *file) cache_debugfs_open() argument
99 return single_open(file, cache_seq_show, inode->i_private); cache_debugfs_open()
/linux-4.4.14/arch/mips/ath25/
H A Dprom.c2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
14 * Prom setup file for AR5312/AR231x SoCs
/linux-4.4.14/sound/pci/ctxfi/
H A Dcthw20k1.h4 * This source file is released under GPL v2 license (no other versions).
5 * See the COPYING file included in the main directory of this source
11 * This file contains the definition of hardware access methord.
H A Dcthw20k2.h4 * This source file is released under GPL v2 license (no other versions).
5 * See the COPYING file included in the main directory of this source
11 * This file contains the definition of hardware access methord.
H A Dctpcm.h4 * This source file is released under GPL v2 license (no other versions).
5 * See the COPYING file included in the main directory of this source
11 * This file contains the definition of the pcm device functions.
/linux-4.4.14/fs/fat/
H A DMakefile9 fat-y := cache.o dir.o fatent.o file.o inode.o misc.o nfs.o
/linux-4.4.14/fs/hpfs/
H A DMakefile7 hpfs-objs := alloc.o anode.o buffer.o dentry.o dir.o dnode.o ea.o file.o \
/linux-4.4.14/fs/nilfs2/
H A DMakefile2 nilfs2-y := inode.o file.o dir.o super.o namei.o page.o mdt.o \
H A Dexport.h9 * struct nilfs_fid - NILFS file id type
12 * @gen: file generation (version) for NFS
/linux-4.4.14/mm/
H A Dfadvise.c11 #include <linux/file.h>
40 if (!f.file) SYSCALL_DEFINE4()
43 inode = file_inode(f.file); SYSCALL_DEFINE4()
49 mapping = f.file->f_mapping; SYSCALL_DEFINE4()
82 f.file->f_ra.ra_pages = bdi->ra_pages; SYSCALL_DEFINE4()
83 spin_lock(&f.file->f_lock); SYSCALL_DEFINE4()
84 f.file->f_mode &= ~FMODE_RANDOM; SYSCALL_DEFINE4()
85 spin_unlock(&f.file->f_lock); SYSCALL_DEFINE4()
88 spin_lock(&f.file->f_lock); SYSCALL_DEFINE4()
89 f.file->f_mode |= FMODE_RANDOM; SYSCALL_DEFINE4()
90 spin_unlock(&f.file->f_lock); SYSCALL_DEFINE4()
93 f.file->f_ra.ra_pages = bdi->ra_pages * 2; SYSCALL_DEFINE4()
94 spin_lock(&f.file->f_lock); SYSCALL_DEFINE4()
95 f.file->f_mode &= ~FMODE_RANDOM; SYSCALL_DEFINE4()
96 spin_unlock(&f.file->f_lock); SYSCALL_DEFINE4()
112 force_page_cache_readahead(mapping, f.file, start_index, SYSCALL_DEFINE4()
/linux-4.4.14/security/tomoyo/
H A Dsecurityfs_if.c29 * @file: Pointer to "struct file".
39 static ssize_t tomoyo_write_self(struct file *file, const char __user *buf, tomoyo_write_self() argument
98 * @file: Pointer to "struct file".
105 static ssize_t tomoyo_read_self(struct file *file, char __user *buf, tomoyo_read_self() argument
132 * @file: Pointer to "struct file".
136 static int tomoyo_open(struct inode *inode, struct file *file) tomoyo_open() argument
138 const int key = ((u8 *) file_inode(file)->i_private) tomoyo_open()
140 return tomoyo_open_control(key, file); tomoyo_open()
146 * @file: Pointer to "struct file".
149 static int tomoyo_release(struct inode *inode, struct file *file) tomoyo_release() argument
151 tomoyo_close_control(file->private_data); tomoyo_release()
158 * @file: Pointer to "struct file".
164 static unsigned int tomoyo_poll(struct file *file, poll_table *wait) tomoyo_poll() argument
166 return tomoyo_poll_control(file, wait); tomoyo_poll()
172 * @file: Pointer to "struct file".
179 static ssize_t tomoyo_read(struct file *file, char __user *buf, size_t count, tomoyo_read() argument
182 return tomoyo_read_control(file->private_data, buf, count); tomoyo_read()
188 * @file: Pointer to "struct file".
195 static ssize_t tomoyo_write(struct file *file, const char __user *buf, tomoyo_write() argument
198 return tomoyo_write_control(file->private_data, buf, count); tomoyo_write()
220 * @name: The name of the interface file.
221 * @mode: The permission of the interface file.
/linux-4.4.14/fs/affs/
H A DMakefile9 affs-objs := super.o namei.o inode.o file.o dir.o amigaffs.o bitmap.o symlink.o
/linux-4.4.14/fs/sysv/
H A DMakefile7 sysv-objs := ialloc.o balloc.o inode.o itree.o file.o dir.o \
/linux-4.4.14/fs/udf/
H A DMakefile7 udf-objs := balloc.o dir.o file.o ialloc.o inode.o lowlevel.o namei.o \
/linux-4.4.14/fs/ufs/
H A DMakefile7 ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \
H A Dfile.c2 * linux/fs/ufs/file.c
10 * linux/fs/ext2/file.c
19 * linux/fs/minix/file.c
23 * ext2 fs regular file handling primitives
/linux-4.4.14/include/asm-generic/
H A Dbugs.h4 * This file is included by 'init/main.c' to check for
H A Ddevice.h4 * This file is released under the GPLv2
H A Duser.h4 * This file may define a 'struct user' structure. However, it is only
H A Dsimd.h6 * instructions or access the SIMD register file
8 * As architectures typically don't preserve the SIMD register file when
/linux-4.4.14/arch/m68k/include/asm/
H A Dfb.h11 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, fb_pgprotect() argument
17 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, fb_pgprotect() argument
/linux-4.4.14/arch/h8300/include/asm/
H A Dmc146818rtc.h7 /* empty include file to satisfy the include in genrtc.c/ide-geometry.c */
/linux-4.4.14/arch/ia64/include/asm/
H A Dmc146818rtc.h8 /* empty include file to satisfy the include in genrtc.c */
/linux-4.4.14/arch/avr32/include/asm/
H A Dpci.h4 /* We don't support PCI yet, but some drivers require this file anyway */
/linux-4.4.14/arch/arm/mach-integrator/
H A DMakefile5 # Object file lists.
/linux-4.4.14/sound/soc/codecs/
H A Dadau1701.h2 * header file for ADAU1701 SigmaDSP processor
/linux-4.4.14/drivers/net/wireless/ath/ath9k/
H A Ddebug.c71 static ssize_t ath9k_debugfs_read_buf(struct file *file, char __user *user_buf, ath9k_debugfs_read_buf() argument
74 u8 *buf = file->private_data; ath9k_debugfs_read_buf()
78 static int ath9k_debugfs_release_buf(struct inode *inode, struct file *file) ath9k_debugfs_release_buf() argument
80 vfree(file->private_data); ath9k_debugfs_release_buf()
86 static ssize_t read_file_debug(struct file *file, char __user *user_buf, read_file_debug() argument
89 struct ath_softc *sc = file->private_data; read_file_debug()
98 static ssize_t write_file_debug(struct file *file, const char __user *user_buf, write_file_debug() argument
101 struct ath_softc *sc = file->private_data; write_file_debug()
132 static ssize_t read_file_ani(struct file *file, char __user *user_buf, read_file_ani() argument
135 struct ath_softc *sc = file->private_data; read_file_ani()
187 static ssize_t write_file_ani(struct file *file, write_file_ani() argument
191 struct ath_softc *sc = file->private_data; write_file_ani()
230 static ssize_t read_file_bt_ant_diversity(struct file *file, read_file_bt_ant_diversity() argument
234 struct ath_softc *sc = file->private_data; read_file_bt_ant_diversity()
243 static ssize_t write_file_bt_ant_diversity(struct file *file, write_file_bt_ant_diversity() argument
247 struct ath_softc *sc = file->private_data; write_file_bt_ant_diversity()
299 static ssize_t read_file_antenna_diversity(struct file *file, read_file_antenna_diversity() argument
303 struct ath_softc *sc = file->private_data; read_file_antenna_diversity()
404 static int read_file_dma(struct seq_file *file, void *data) read_file_dma() argument
406 struct ieee80211_hw *hw = dev_get_drvdata(file->private); read_file_dma()
420 seq_puts(file, "Raw DMA Debug values:\n"); read_file_dma()
424 seq_puts(file, "\n"); read_file_dma()
427 seq_printf(file, "%d: %08x ", i, val[i]); read_file_dma()
430 seq_puts(file, "\n\n"); read_file_dma()
431 seq_puts(file, "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n"); read_file_dma()
444 seq_printf(file, "%2d %2x %1x %2x %2x\n", read_file_dma()
451 seq_puts(file, "\n"); read_file_dma()
453 seq_printf(file, "qcu_stitch state: %2x qcu_fetch state: %2x\n", read_file_dma()
455 seq_printf(file, "qcu_complete state: %2x dcu_complete state: %2x\n", read_file_dma()
457 seq_printf(file, "dcu_arb state: %2x dcu_fp state: %2x\n", read_file_dma()
459 seq_printf(file, "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n", read_file_dma()
461 seq_printf(file, "txfifo_valid_0: %1d txfifo_valid_1: %1d\n", read_file_dma()
463 seq_printf(file, "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n", read_file_dma()
466 seq_printf(file, "pcu observe: 0x%x\n", REG_READ_D(ah, AR_OBS_BUS_1)); read_file_dma()
467 seq_printf(file, "AR_CR: 0x%x\n", REG_READ_D(ah, AR_CR)); read_file_dma()
527 static int read_file_interrupt(struct seq_file *file, void *data) read_file_interrupt() argument
529 struct ieee80211_hw *hw = dev_get_drvdata(file->private); read_file_interrupt()
534 seq_printf(file, "%21s: %10u\n", a, \ read_file_interrupt()
566 seq_puts(file, "SYNC_CAUSE stats:\n"); read_file_interrupt()
591 static int read_file_xmit(struct seq_file *file, void *data) read_file_xmit() argument
593 struct ieee80211_hw *hw = dev_get_drvdata(file->private); read_file_xmit()
596 seq_printf(file, "%30s %10s%10s%10s\n\n", "BE", "BK", "VI", "VO"); read_file_xmit()
625 struct seq_file *file) print_queue()
629 seq_printf(file, "%s: %d ", "qnum", txq->axq_qnum); print_queue()
630 seq_printf(file, "%s: %2d ", "qdepth", txq->axq_depth); print_queue()
631 seq_printf(file, "%s: %2d ", "ampdu-depth", txq->axq_ampdu_depth); print_queue()
632 seq_printf(file, "%s: %3d ", "pending", txq->pending_frames); print_queue()
633 seq_printf(file, "%s: %d\n", "stopped", txq->stopped); print_queue()
638 static int read_file_queues(struct seq_file *file, void *data) read_file_queues() argument
640 struct ieee80211_hw *hw = dev_get_drvdata(file->private); read_file_queues()
650 seq_printf(file, "(%s): ", qname[i]); read_file_queues()
651 print_queue(sc, txq, file); read_file_queues()
654 seq_puts(file, "(CAB): "); read_file_queues()
655 print_queue(sc, sc->beacon.cabq, file); read_file_queues()
660 static int read_file_misc(struct seq_file *file, void *data) read_file_misc() argument
662 struct ieee80211_hw *hw = dev_get_drvdata(file->private); read_file_misc()
670 seq_printf(file, "BSSID: %pM\n", common->curbssid); read_file_misc()
671 seq_printf(file, "BSSID-MASK: %pM\n", common->bssidmask); read_file_misc()
672 seq_printf(file, "OPMODE: %s\n", read_file_misc()
679 seq_printf(file, "RXFILTER: 0x%x", rxfilter); read_file_misc()
682 seq_puts(file, " UCAST"); read_file_misc()
684 seq_puts(file, " MCAST"); read_file_misc()
686 seq_puts(file, " BCAST"); read_file_misc()
688 seq_puts(file, " CONTROL"); read_file_misc()
690 seq_puts(file, " BEACON"); read_file_misc()
692 seq_puts(file, " PROM"); read_file_misc()
694 seq_puts(file, " PROBEREQ"); read_file_misc()
696 seq_puts(file, " PHYERR"); read_file_misc()
698 seq_puts(file, " MYBEACON"); read_file_misc()
700 seq_puts(file, " COMP_BAR"); read_file_misc()
702 seq_puts(file, " PSPOLL"); read_file_misc()
704 seq_puts(file, " PHYRADAR"); read_file_misc()
706 seq_puts(file, " MCAST_BCAST_ALL"); read_file_misc()
708 seq_puts(file, " CONTROL_WRAPPER"); read_file_misc()
710 seq_puts(file, "\n"); read_file_misc()
714 seq_printf(file, "INTERRUPT-MASK: 0x%x", reg); read_file_misc()
717 seq_puts(file, " SWBA"); read_file_misc()
719 seq_puts(file, " BMISS"); read_file_misc()
721 seq_puts(file, " CST"); read_file_misc()
723 seq_puts(file, " RX"); read_file_misc()
725 seq_puts(file, " RXHP"); read_file_misc()
727 seq_puts(file, " RXLP"); read_file_misc()
729 seq_puts(file, " BB_WATCHDOG"); read_file_misc()
731 seq_puts(file, "\n"); read_file_misc()
739 seq_printf(file, ath_for_each_chanctx()
744 seq_printf(file, " ADHOC: %i OCB: %i TOTAL: %hi BEACON-VIF: %hi\n", ath_for_each_chanctx()
752 static int read_file_reset(struct seq_file *file, void *data) read_file_reset() argument
754 struct ieee80211_hw *hw = dev_get_drvdata(file->private); read_file_reset()
777 seq_printf(file, "%17s: %2d\n", reset_cause[i], read_file_reset()
826 static ssize_t read_file_regidx(struct file *file, char __user *user_buf, read_file_regidx() argument
829 struct ath_softc *sc = file->private_data; read_file_regidx()
837 static ssize_t write_file_regidx(struct file *file, const char __user *user_buf, write_file_regidx() argument
840 struct ath_softc *sc = file->private_data; write_file_regidx()
865 static ssize_t read_file_regval(struct file *file, char __user *user_buf, read_file_regval() argument
868 struct ath_softc *sc = file->private_data; read_file_regval()
881 static ssize_t write_file_regval(struct file *file, const char __user *user_buf, write_file_regval() argument
884 struct ath_softc *sc = file->private_data; write_file_regval()
914 static int open_file_regdump(struct inode *inode, struct file *file) open_file_regdump() argument
935 file->private_data = buf; open_file_regdump()
948 static int read_file_dump_nfcal(struct seq_file *file, void *data) read_file_dump_nfcal() argument
950 struct ieee80211_hw *hw = dev_get_drvdata(file->private); read_file_dump_nfcal()
960 seq_printf(file, "Channel Noise Floor : %d\n", ah->noise); read_file_dump_nfcal()
961 seq_puts(file, "Chain | privNF | # Readings | NF Readings\n"); read_file_dump_nfcal()
968 seq_printf(file, " %d\t %d\t %d\t\t", i, h[i].privNF, nread); read_file_dump_nfcal()
970 seq_printf(file, " %d", h[i].nfCalBuffer[j]); read_file_dump_nfcal()
971 seq_puts(file, "\n"); read_file_dump_nfcal()
977 static int open_file_dump_nfcal(struct inode *inode, struct file *f) open_file_dump_nfcal()
991 static ssize_t read_file_btcoex(struct file *file, char __user *user_buf, read_file_btcoex() argument
994 struct ath_softc *sc = file->private_data; read_file_btcoex()
1026 static ssize_t read_file_ackto(struct file *file, char __user *user_buf, read_file_ackto() argument
1029 struct ath_softc *sc = file->private_data; read_file_ackto()
1050 static ssize_t read_file_wow(struct file *file, char __user *user_buf, read_file_wow() argument
1053 struct ath_softc *sc = file->private_data; read_file_wow()
1074 static ssize_t write_file_wow(struct file *file, const char __user *user_buf, write_file_wow() argument
1077 struct ath_softc *sc = file->private_data; write_file_wow()
1111 static ssize_t read_file_tpc(struct file *file, char __user *user_buf, read_file_tpc() argument
1114 struct ath_softc *sc = file->private_data; read_file_tpc()
1136 static ssize_t write_file_tpc(struct file *file, const char __user *user_buf, write_file_tpc() argument
1139 struct ath_softc *sc = file->private_data; write_file_tpc()
624 print_queue(struct ath_softc *sc, struct ath_txq *txq, struct seq_file *file) print_queue() argument
/linux-4.4.14/drivers/isdn/hardware/eicon/
H A Ddivasi.c73 static ssize_t um_idi_read(struct file *file, char __user *buf, size_t count,
75 static ssize_t um_idi_write(struct file *file, const char __user *buf,
77 static unsigned int um_idi_poll(struct file *file, poll_table *wait);
78 static int um_idi_open(struct inode *inode, struct file *file);
79 static int um_idi_release(struct inode *inode, struct file *file);
104 static int um_idi_proc_open(struct inode *inode, struct file *file) um_idi_proc_open() argument
106 return single_open(file, um_idi_proc_show, NULL); um_idi_proc_open()
231 um_idi_read(struct file *file, char __user *buf, size_t count, loff_t *offset) um_idi_read() argument
237 if (!file->private_data) { um_idi_read()
243 (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file-> um_idi_read()
256 ret = diva_um_idi_read(file->private_data, um_idi_read()
257 file, data, count, um_idi_read()
291 static int um_idi_open_adapter(struct file *file, int adapter_nr) um_idi_open_adapter() argument
295 divas_um_idi_create_entity((dword) adapter_nr, (void *) file); um_idi_open_adapter()
297 if (!(file->private_data = e)) { um_idi_open_adapter()
312 um_idi_write(struct file *file, const char __user *buf, size_t count, um_idi_write() argument
320 if (!file->private_data) { um_idi_write()
326 if (!(um_idi_open_adapter(file, adapter_nr))) um_idi_write()
334 (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file-> um_idi_write()
350 ret = diva_um_idi_write(file->private_data, um_idi_write()
351 file, data, count, um_idi_write()
370 static unsigned int um_idi_poll(struct file *file, poll_table *wait) um_idi_poll() argument
374 if (!file->private_data) { um_idi_poll()
380 diva_um_id_get_os_context(file->private_data))) um_idi_poll()
385 poll_wait(file, &p_os->read_wait, wait); um_idi_poll()
391 switch (diva_user_mode_idi_ind_ready(file->private_data, file)) { um_idi_poll()
402 static int um_idi_open(struct inode *inode, struct file *file) um_idi_open() argument
408 static int um_idi_release(struct inode *inode, struct file *file) um_idi_release() argument
414 if (!(file->private_data)) { um_idi_release()
420 (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->private_data))) { um_idi_release()
427 if ((ret = remove_entity(file->private_data))) { um_idi_release()
432 ((int) adapter_nr, file->private_data)) { um_idi_release()
/linux-4.4.14/include/sound/
H A Dhwdep.h30 /* hwdep file ops; all ops can be NULL */
32 long long (*llseek)(struct snd_hwdep *hw, struct file *file,
38 int (*open)(struct snd_hwdep *hw, struct file * file);
39 int (*release)(struct snd_hwdep *hw, struct file * file);
40 unsigned int (*poll)(struct snd_hwdep *hw, struct file *file,
42 int (*ioctl)(struct snd_hwdep *hw, struct file *file,
44 int (*ioctl_compat)(struct snd_hwdep *hw, struct file *file,
46 int (*mmap)(struct snd_hwdep *hw, struct file *file,
/linux-4.4.14/sound/core/
H A Dtimer_compat.c21 /* This file included from timer.c */
35 static int snd_timer_user_info_compat(struct file *file, snd_timer_user_info_compat() argument
42 tu = file->private_data; snd_timer_user_info_compat()
69 static int snd_timer_user_status_compat(struct file *file, snd_timer_user_status_compat() argument
75 tu = file->private_data; snd_timer_user_status_compat()
94 #define snd_timer_user_status_x32(file, s) \
95 snd_timer_user_status(file, s)
109 static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) snd_timer_user_ioctl_compat() argument
130 return snd_timer_user_ioctl(file, cmd, (unsigned long)argp); snd_timer_user_ioctl_compat()
132 return snd_timer_user_info_compat(file, argp); snd_timer_user_ioctl_compat()
134 return snd_timer_user_status_compat(file, argp); snd_timer_user_ioctl_compat()
137 return snd_timer_user_status_x32(file, argp); snd_timer_user_ioctl_compat()
/linux-4.4.14/tools/power/acpi/common/
H A Dcmfsize.c3 * Module Name: cfsize - Common get file size function
56 * PARAMETERS: file - Open file descriptor
60 * DESCRIPTION: Get the size of a file. Uses seek-to-EOF. File must be open.
61 * Does not disturb the current file pointer.
64 u32 cm_get_file_size(ACPI_FILE file) cm_get_file_size() argument
70 /* Save the current file pointer, seek to EOF to obtain file size */ cm_get_file_size()
72 current_offset = acpi_os_get_file_offset(file); cm_get_file_size()
77 status = acpi_os_set_file_offset(file, 0, ACPI_FILE_END); cm_get_file_size()
82 file_size = acpi_os_get_file_offset(file); cm_get_file_size()
87 /* Restore original file pointer */ cm_get_file_size()
89 status = acpi_os_set_file_offset(file, current_offset, ACPI_FILE_BEGIN); cm_get_file_size()
97 acpi_log_error("Could not get file offset"); cm_get_file_size()
101 acpi_log_error("Could not set file offset"); cm_get_file_size()
/linux-4.4.14/drivers/media/usb/uvc/
H A Duvc_debugfs.c32 static int uvc_debugfs_stats_open(struct inode *inode, struct file *file) uvc_debugfs_stats_open() argument
43 file->private_data = buf; uvc_debugfs_stats_open()
47 static ssize_t uvc_debugfs_stats_read(struct file *file, char __user *user_buf, uvc_debugfs_stats_read() argument
50 struct uvc_debugfs_buffer *buf = file->private_data; uvc_debugfs_stats_read()
56 static int uvc_debugfs_stats_release(struct inode *inode, struct file *file) uvc_debugfs_stats_release() argument
58 kfree(file->private_data); uvc_debugfs_stats_release()
59 file->private_data = NULL; uvc_debugfs_stats_release()
101 uvc_printk(KERN_INFO, "Unable to create debugfs stats file.\n"); uvc_debugfs_init_stream()
/linux-4.4.14/drivers/parisc/
H A Deisa_eeprom.c34 static loff_t eisa_eeprom_llseek(struct file *file, loff_t offset, int origin) eisa_eeprom_llseek() argument
36 return fixed_size_llseek(file, offset, origin, HPEE_MAX_LENGTH); eisa_eeprom_llseek()
39 static ssize_t eisa_eeprom_read(struct file * file, eisa_eeprom_read() argument
66 static int eisa_eeprom_open(struct inode *inode, struct file *file) eisa_eeprom_open() argument
68 if (file->f_mode & FMODE_WRITE) eisa_eeprom_open()
74 static int eisa_eeprom_release(struct inode *inode, struct file *file) eisa_eeprom_release() argument
80 * The various file operations we support.
/linux-4.4.14/net/irda/irnet/
H A Dirnet_ppp.h6 * This file contains all definitions and declarations necessary for the
8 * This file is a private header, so other modules don't want to know
21 /* /dev/irnet file constants */
54 struct file *,
59 struct file *,
64 struct file *),
66 struct file *);
68 dev_irnet_write(struct file *,
72 dev_irnet_read(struct file *,
77 dev_irnet_poll(struct file *,
80 dev_irnet_ioctl(struct file *,
/linux-4.4.14/drivers/misc/cxl/
H A Dapi.c13 #include <linux/file.h>
39 * filesystem like the user api has, and even if we do associate a file cxl_dev_context_init()
218 /* wrappers around afu_* file ops which are EXPORTED */ cxl_fd_open()
219 int cxl_fd_open(struct inode *inode, struct file *file) cxl_fd_open() argument
221 return afu_open(inode, file); cxl_fd_open()
224 int cxl_fd_release(struct inode *inode, struct file *file) cxl_fd_release() argument
226 return afu_release(inode, file); cxl_fd_release()
229 long cxl_fd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) cxl_fd_ioctl() argument
231 return afu_ioctl(file, cmd, arg); cxl_fd_ioctl()
234 int cxl_fd_mmap(struct file *file, struct vm_area_struct *vm) cxl_fd_mmap() argument
236 return afu_mmap(file, vm); cxl_fd_mmap()
239 unsigned int cxl_fd_poll(struct file *file, struct poll_table_struct *poll) cxl_fd_poll() argument
241 return afu_poll(file, poll); cxl_fd_poll()
244 ssize_t cxl_fd_read(struct file *file, char __user *buf, size_t count, cxl_fd_read() argument
247 return afu_read(file, buf, count, off); cxl_fd_read()
253 /* Get a struct file and fd for a context and attach the ops */ cxl_get_fd()
254 struct file *cxl_get_fd(struct cxl_context *ctx, struct file_operations *fops, cxl_get_fd()
257 struct file *file; cxl_get_fd() local
269 * Patch the file ops. Needs to be careful that this is rentrant safe. cxl_get_fd()
282 file = anon_inode_getfile("cxl", fops, ctx, flags); cxl_get_fd()
283 if (IS_ERR(file)) cxl_get_fd()
286 file->f_mapping = ctx->mapping; cxl_get_fd()
289 return file; cxl_get_fd()
297 struct cxl_context *cxl_fops_get_context(struct file *file) cxl_fops_get_context() argument
299 return file->private_data; cxl_fops_get_context()
/linux-4.4.14/drivers/media/common/saa7146/
H A Dsaa7146_fops.c193 /* file operations */
195 static int fops_open(struct file *file) fops_open() argument
197 struct video_device *vdev = video_devdata(file); fops_open()
198 struct saa7146_dev *dev = video_drvdata(file); fops_open()
202 DEB_EE("file:%p, dev:%s\n", file, video_device_node_name(vdev)); fops_open()
226 file->private_data = &fh->fh; fops_open()
232 result = saa7146_vbi_uops.open(dev,file); fops_open()
234 dev->ext_vv_data->vbi_fops.open(file); fops_open()
237 result = saa7146_video_uops.open(dev,file); fops_open()
254 file->private_data = NULL; fops_open()
260 static int fops_release(struct file *file) fops_release() argument
262 struct video_device *vdev = video_devdata(file); fops_release()
263 struct saa7146_fh *fh = file->private_data; fops_release()
266 DEB_EE("file:%p\n", file); fops_release()
272 saa7146_vbi_uops.release(dev,file); fops_release()
274 dev->ext_vv_data->vbi_fops.release(file); fops_release()
276 saa7146_video_uops.release(dev,file); fops_release()
282 file->private_data = NULL; fops_release()
290 static int fops_mmap(struct file *file, struct vm_area_struct * vma) fops_mmap() argument
292 struct video_device *vdev = video_devdata(file); fops_mmap()
293 struct saa7146_fh *fh = file->private_data; fops_mmap()
299 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: file:%p, vma:%p\n", fops_mmap()
300 file, vma); fops_mmap()
305 DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, vma:%p\n", fops_mmap()
306 file, vma); fops_mmap()
323 static unsigned int __fops_poll(struct file *file, struct poll_table_struct *wait) __fops_poll() argument
325 struct video_device *vdev = video_devdata(file); __fops_poll()
326 struct saa7146_fh *fh = file->private_data; __fops_poll()
329 unsigned int res = v4l2_ctrl_poll(file, wait); __fops_poll()
331 DEB_EE("file:%p, poll:%p\n", file, wait); __fops_poll()
337 return res | videobuf_poll_stream(file, &fh->vbi_q, wait); __fops_poll()
352 poll_wait(file, &buf->done, wait); __fops_poll()
362 static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait) fops_poll() argument
364 struct video_device *vdev = video_devdata(file); fops_poll()
368 res = __fops_poll(file, wait); fops_poll()
373 static ssize_t fops_read(struct file *file, char __user *data, size_t count, loff_t *ppos) fops_read() argument
375 struct video_device *vdev = video_devdata(file); fops_read()
376 struct saa7146_fh *fh = file->private_data; fops_read()
382 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: file:%p, data:%p, count:%lun", fops_read()
383 file, data, (unsigned long)count); fops_read()
385 return saa7146_video_uops.read(file,data,count,ppos); fops_read()
388 DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, data:%p, count:%lu\n", fops_read()
389 file, data, (unsigned long)count); fops_read()
394 ret = saa7146_vbi_uops.read(file, data, count, ppos); fops_read()
404 static ssize_t fops_write(struct file *file, const char __user *data, size_t count, loff_t *ppos) fops_write() argument
406 struct video_device *vdev = video_devdata(file); fops_write()
407 struct saa7146_fh *fh = file->private_data; fops_write()
417 ret = fh->dev->ext_vv_data->vbi_fops.write(file, data, count, ppos); fops_write()
/linux-4.4.14/drivers/misc/sgi-gru/
H A Dgruprocfs.c6 * This file supports the /proc interfaces for the GRU driver
120 static ssize_t statistics_write(struct file *file, const char __user *userbuf, statistics_write() argument
146 static ssize_t mcs_statistics_write(struct file *file, mcs_statistics_write() argument
160 static ssize_t options_write(struct file *file, const char __user *userbuf, options_write() argument
172 static int cch_seq_show(struct seq_file *file, void *data) cch_seq_show() argument
181 seq_printf(file, "#%5s%5s%6s%7s%9s%6s%8s%8s\n", "gid", "bid", cch_seq_show()
188 seq_printf(file, " %5d%5d%6d%7d%9d%6d%8d%8s\n", cch_seq_show()
201 static int gru_seq_show(struct seq_file *file, void *data) gru_seq_show() argument
207 seq_printf(file, "#%5s%5s%7s%6s%6s%8s%6s%6s\n", "gid", "nid", gru_seq_show()
209 seq_printf(file, "#%5s%5s%7s%6s%6s%8s%6s%6s\n", "", "", "busy", gru_seq_show()
216 seq_printf(file, " %5d%5d%7ld%6ld%6ld%8ld%6ld%6ld\n", gru_seq_show()
225 static void seq_stop(struct seq_file *file, void *data) seq_stop() argument
229 static void *seq_start(struct seq_file *file, loff_t *gid) seq_start() argument
236 static void *seq_next(struct seq_file *file, void *data, loff_t *gid) seq_next() argument
258 static int statistics_open(struct inode *inode, struct file *file) statistics_open() argument
260 return single_open(file, statistics_show, NULL); statistics_open()
263 static int mcs_statistics_open(struct inode *inode, struct file *file) mcs_statistics_open() argument
265 return single_open(file, mcs_statistics_show, NULL); mcs_statistics_open()
268 static int options_open(struct inode *inode, struct file *file) options_open() argument
270 return single_open(file, options_show, NULL); options_open()
273 static int cch_open(struct inode *inode, struct file *file) cch_open() argument
275 return seq_open(file, &cch_seq_ops); cch_open()
278 static int gru_open(struct inode *inode, struct file *file) gru_open() argument
280 return seq_open(file, &gru_seq_ops); gru_open()
/linux-4.4.14/arch/x86/entry/vdso/
H A Dvdso.lds.S3 * We #include the file to define the layout details.
5 * This file defines the version script giving the user-exported symbols in
H A Dvdsox32.lds.S3 * We #include the file to define the layout details.
5 * This file defines the version script giving the user-exported symbols in
/linux-4.4.14/arch/x86/include/asm/
H A Dfb.h8 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, fb_pgprotect() argument
/linux-4.4.14/arch/x86/oprofile/
H A Dop_counter.h2 * @file op_counter.h
5 * @remark Read the file COPYING
/linux-4.4.14/arch/x86/realmode/
H A DMakefile4 # This file is subject to the terms and conditions of the GNU General Public
5 # License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/xtensa/boot/boot-uboot/
H A DMakefile2 # This file is subject to the terms and conditions of the GNU General Public
3 # License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/xtensa/boot/dts/
H A DMakefile4 # This file is subject to the terms and conditions of the GNU General Public
5 # License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/xtensa/include/uapi/asm/
H A Dpoll.h4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
H A Dsetup.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/xtensa/oprofile/
H A Dbacktrace.c2 * @file backtrace.c
6 * @remark Read the file COPYING
H A Dinit.c2 * @file init.c
5 * @remark Read the file COPYING
/linux-4.4.14/arch/xtensa/platforms/xtfpga/include/platform/
H A Dserial.h4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/sound/core/seq/oss/
H A Dseq_oss.c56 static int odev_open(struct inode *inode, struct file *file); unregister_proc()
57 static int odev_release(struct inode *inode, struct file *file); unregister_proc()
58 static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset); unregister_proc()
59 static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset); unregister_proc()
60 static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); unregister_proc()
61 static unsigned int odev_poll(struct file *file, poll_table * wait); unregister_proc()
127 odev_open(struct inode *inode, struct file *file) odev_open() argument
137 rc = snd_seq_oss_open(file, level); odev_open()
144 odev_release(struct inode *inode, struct file *file) odev_release() argument
148 if ((dp = file->private_data) == NULL) odev_release()
159 odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset) odev_read() argument
162 dp = file->private_data; odev_read()
170 odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) odev_write() argument
173 dp = file->private_data; odev_write()
176 return snd_seq_oss_write(dp, buf, count, file); odev_write()
180 odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) odev_ioctl() argument
183 dp = file->private_data; odev_ioctl()
196 odev_poll(struct file *file, poll_table * wait) odev_poll() argument
199 dp = file->private_data; odev_poll()
202 return snd_seq_oss_poll(dp, file, wait); odev_poll()
/linux-4.4.14/fs/coda/
H A Dcoda_int.h5 struct file;
14 int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync);
/linux-4.4.14/include/linux/platform_data/
H A Di2c-imx.h2 * i2c.h - i.MX I2C driver header file
6 * This file is released under the GPLv2
/linux-4.4.14/arch/mips/include/asm/mach-ar7/
H A Dirq.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-bcm63xx/
H A Dspaces.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-bmips/
H A Dspaces.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-db1x00/
H A Dirq.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-emma2rh/
H A Dirq.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-ip28/
H A Dspaces.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-netlogic/
H A Dirq.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-paravirt/
H A Dirq.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-pmcs-msp71xx/
H A Dcpu-feature-overrides.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-sead3/
H A Dkernel-entry-init.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-tx39xx/
H A Dspaces.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
/linux-4.4.14/arch/mips/include/asm/mach-tx49xx/
H A Dspaces.h2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive

Completed in 4866 milliseconds

1234567891011>>