Lines Matching defs:file
19 #include <linux/file.h>
232 * "struct file" needs to be available at the right moment.
241 struct file *file;
247 file = pdeo->file;
248 pde->proc_ops->proc_release(file_inode(file), file);
281 static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence)
283 struct proc_dir_entry *pde = PDE(file_inode(file));
287 return pde->proc_ops->proc_lseek(file, offset, whence);
289 rv = pde->proc_ops->proc_lseek(file, offset, whence);
310 static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)
316 return read(file, buf, count, ppos);
320 static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
322 struct proc_dir_entry *pde = PDE(file_inode(file));
326 return pde_read(pde, file, buf, count, ppos);
328 rv = pde_read(pde, file, buf, count, ppos);
334 static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)
340 return write(file, buf, count, ppos);
344 static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
346 struct proc_dir_entry *pde = PDE(file_inode(file));
350 return pde_write(pde, file, buf, count, ppos);
352 rv = pde_write(pde, file, buf, count, ppos);
358 static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)
364 return poll(file, pts);
368 static __poll_t proc_reg_poll(struct file *file, struct poll_table_struct *pts)
370 struct proc_dir_entry *pde = PDE(file_inode(file));
374 return pde_poll(pde, file, pts);
376 rv = pde_poll(pde, file, pts);
382 static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)
388 return ioctl(file, cmd, arg);
392 static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
394 struct proc_dir_entry *pde = PDE(file_inode(file));
398 return pde_ioctl(pde, file, cmd, arg);
400 rv = pde_ioctl(pde, file, cmd, arg);
407 static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)
413 return compat_ioctl(file, cmd, arg);
417 static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
419 struct proc_dir_entry *pde = PDE(file_inode(file));
422 return pde_compat_ioctl(pde, file, cmd, arg);
424 rv = pde_compat_ioctl(pde, file, cmd, arg);
431 static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)
437 return mmap(file, vma);
441 static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma)
443 struct proc_dir_entry *pde = PDE(file_inode(file));
447 return pde_mmap(pde, file, vma);
449 rv = pde_mmap(pde, file, vma);
456 pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,
468 return get_area(file, orig_addr, len, pgoff, flags);
473 proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr,
477 struct proc_dir_entry *pde = PDE(file_inode(file));
481 return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);
483 rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);
489 static int proc_reg_open(struct inode *inode, struct file *file)
498 file->f_mode &= ~FMODE_LSEEK;
503 rv = open(inode, file);
513 * 2) rmmod isn't blocked by opening file in /proc and sitting on
516 * Save every "struct file" with custom ->release hook.
532 rv = open(inode, file);
537 pdeo->file = file;
552 static int proc_reg_release(struct inode *inode, struct file *file)
562 return release(inode, file);
569 if (pdeo->file == file) {