Lines Matching refs:file
261 struct file *ia_file;
324 struct file *ki_filp;
336 static inline int iocb_flags(struct file *file);
338 static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) in init_sync_kiocb()
370 int (*readpage)(struct file *, struct page *);
378 int (*readpages)(struct file *filp, struct address_space *mapping,
381 int (*write_begin)(struct file *, struct address_space *mapping,
384 int (*write_end)(struct file *, struct address_space *mapping,
407 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
409 void (*swap_deactivate)(struct file *file);
418 int pagecache_write_begin(struct file *, struct address_space *mapping,
422 int pagecache_write_end(struct file *, struct address_space *mapping,
839 struct file { struct
884 static inline struct file *get_file(struct file *f) in get_file()
991 struct file *fl_file;
1031 extern int fcntl_getlk(struct file *, unsigned int, struct flock __user *);
1032 extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
1036 extern int fcntl_getlk64(struct file *, unsigned int, struct flock64 __user *);
1037 extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
1041 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
1042 extern int fcntl_getlease(struct file *filp);
1051 extern void locks_remove_posix(struct file *, fl_owner_t);
1052 extern void locks_remove_file(struct file *);
1054 extern void posix_test_lock(struct file *, struct file_lock *);
1055 extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1057 extern int vfs_test_lock(struct file *, struct file_lock *);
1058 extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
1059 extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1063 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
1064 extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
1068 struct file *filp, struct files_struct *files);
1070 static inline int fcntl_getlk(struct file *file, unsigned int cmd, in fcntl_getlk() argument
1076 static inline int fcntl_setlk(unsigned int fd, struct file *file, in fcntl_setlk() argument
1083 static inline int fcntl_getlk64(struct file *file, unsigned int cmd, in fcntl_getlk64() argument
1089 static inline int fcntl_setlk64(unsigned int fd, struct file *file, in fcntl_setlk64() argument
1095 static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg) in fcntl_setlease()
1100 static inline int fcntl_getlease(struct file *filp) in fcntl_getlease()
1125 static inline void locks_remove_posix(struct file *filp, fl_owner_t owner) in locks_remove_posix()
1130 static inline void locks_remove_file(struct file *filp) in locks_remove_file()
1135 static inline void posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
1140 static inline int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1151 static inline int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
1156 static inline int vfs_lock_file(struct file *filp, unsigned int cmd, in vfs_lock_file()
1162 static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
1182 static inline int generic_setlease(struct file *filp, long arg, in generic_setlease()
1188 static inline int vfs_setlease(struct file *filp, long arg, in vfs_setlease()
1202 struct file *filp, struct files_struct *files) {} in show_fd_locks()
1205 static inline struct inode *file_inode(const struct file *f) in file_inode()
1210 static inline struct dentry *file_dentry(const struct file *file) in file_dentry() argument
1212 struct dentry *dentry = file->f_path.dentry; in file_dentry()
1215 return dentry->d_op->d_real(dentry, file_inode(file)); in file_dentry()
1220 static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) in locks_lock_file_wait()
1230 struct file *fa_file;
1237 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1238 extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struc…
1239 extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1246 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
1247 extern void f_setown(struct file *filp, unsigned long arg, int force);
1248 extern void f_delown(struct file *filp);
1249 extern pid_t f_getown(struct file *filp);
1612 loff_t (*llseek) (struct file *, loff_t, int);
1613 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
1614 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1617 int (*iterate) (struct file *, struct dir_context *);
1618 unsigned int (*poll) (struct file *, struct poll_table_struct *);
1619 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1620 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1621 int (*mmap) (struct file *, struct vm_area_struct *);
1622 int (*open) (struct inode *, struct file *);
1623 int (*flush) (struct file *, fl_owner_t id);
1624 int (*release) (struct inode *, struct file *);
1625 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1627 int (*fasync) (int, struct file *, int);
1628 int (*lock) (struct file *, int, struct file_lock *);
1629 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1630 …unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, uns…
1632 int (*flock) (struct file *, int, struct file_lock *);
1633 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1634 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1635 int (*setlease)(struct file *, long, struct file_lock **, void **);
1636 long (*fallocate)(struct file *file, int mode, loff_t offset,
1638 void (*show_fdinfo)(struct seq_file *m, struct file *f);
1640 unsigned (*mmap_capabilities)(struct file *);
1674 struct file *, unsigned open_flag,
1685 extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
1686 extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *);
1687 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
1688 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
1689 extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
1691 extern ssize_t vfs_writev(struct file *, const struct iovec __user *,
1923 static inline void file_accessed(struct file *file) in file_accessed() argument
1925 if (!(file->f_flags & O_NOATIME)) in file_accessed()
1926 touch_atime(&file->f_path); in file_accessed()
2003 struct file *__file = (f); \
2044 extern int locks_mandatory_locked(struct file *);
2045 extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
2067 static inline int locks_verify_locked(struct file *file) in locks_verify_locked() argument
2069 if (mandatory_lock(file_inode(file))) in locks_verify_locked()
2070 return locks_mandatory_locked(file); in locks_verify_locked()
2075 struct file *filp, in locks_verify_truncate()
2149 static inline int locks_mandatory_locked(struct file *file) in locks_mandatory_locked() argument
2155 struct file *filp, loff_t offset, in locks_mandatory_area()
2171 static inline int locks_verify_locked(struct file *file) in locks_verify_locked() argument
2176 static inline int locks_verify_truncate(struct inode *inode, struct file *filp, in locks_verify_truncate()
2222 struct file *filp);
2223 extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
2227 extern struct file *file_open_name(struct filename *, int, umode_t);
2228 extern struct file *filp_open(const char *, int, umode_t);
2229 extern struct file *file_open_root(struct dentry *, struct vfsmount *,
2231 extern struct file * dentry_open(const struct path *, int, const struct cred *);
2232 extern int filp_close(struct file *, fl_owner_t id);
2243 extern int finish_open(struct file *file, struct dentry *dentry,
2244 int (*open)(struct inode *, struct file *),
2246 extern int finish_no_open(struct file *file, struct dentry *dentry);
2250 extern int ioctl_preallocate(struct file *filp, void __user *argp);
2315 extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
2431 extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2433 extern int vfs_fsync(struct file *file, int datasync);
2434 static inline int generic_write_sync(struct file *file, loff_t pos, loff_t count) in generic_write_sync() argument
2436 if (!(file->f_flags & O_DSYNC) && !IS_SYNC(file->f_mapping->host)) in generic_write_sync()
2438 return vfs_fsync_range(file, pos, pos + count - 1, in generic_write_sync()
2439 (file->f_flags & __O_SYNC) ? 0 : 1); in generic_write_sync()
2457 static inline void file_start_write(struct file *file) in file_start_write() argument
2459 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write()
2461 __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true); in file_start_write()
2464 static inline bool file_start_write_trylock(struct file *file) in file_start_write_trylock() argument
2466 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write_trylock()
2468 return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false); in file_start_write_trylock()
2471 static inline void file_end_write(struct file *file) in file_end_write() argument
2473 if (!S_ISREG(file_inode(file)->i_mode)) in file_end_write()
2475 __sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE); in file_end_write()
2498 static inline int deny_write_access(struct file *file) in deny_write_access() argument
2500 struct inode *inode = file_inode(file); in deny_write_access()
2507 static inline void allow_write_access(struct file *file) in allow_write_access() argument
2509 if (file) in allow_write_access()
2510 atomic_inc(&file_inode(file)->i_writecount); in allow_write_access()
2539 extern int kernel_read(struct file *, loff_t, char *, unsigned long);
2540 extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
2541 extern ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
2542 extern struct file * open_exec(const char *);
2548 extern char *file_path(struct file *, char *, int);
2553 extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
2555 extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
2601 extern int file_remove_privs(struct file *);
2603 static inline int file_needs_remove_privs(struct file *file) in file_needs_remove_privs() argument
2605 return dentry_needs_remove_privs(file->f_path.dentry); in file_needs_remove_privs()
2631 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
2632 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
2638 extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
2640 ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos);
2641 ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos);
2646 extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2651 extern ssize_t generic_file_splice_read(struct file *, loff_t *,
2653 extern ssize_t default_file_splice_read(struct file *, loff_t *,
2656 struct file *, loff_t *, size_t, unsigned int);
2658 struct file *out, loff_t *, size_t len, unsigned int flags);
2659 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
2665 extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
2666 extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
2667 extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
2668 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
2669 extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2671 extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
2673 extern int generic_file_open(struct inode * inode, struct file * filp);
2674 extern int nonseekable_open(struct inode * inode, struct file * filp);
2770 extern int iterate_dir(struct file *, struct dir_context *);
2777 extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
2798 extern int dcache_dir_open(struct inode *, struct file *);
2799 extern int dcache_dir_close(struct inode *, struct file *);
2800 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
2801 extern int dcache_readdir(struct file *, struct dir_context *);
2805 extern int simple_open(struct inode *inode, struct file *file);
2810 extern int noop_fsync(struct file *, loff_t, loff_t, int);
2812 extern int simple_readpage(struct file *file, struct page *page);
2813 extern int simple_write_begin(struct file *file, struct address_space *mapping,
2816 extern int simple_write_end(struct file *file, struct address_space *mapping,
2821 extern int simple_nosetlease(struct file *, long, struct file_lock **, void **);
2825 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
2841 extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
2842 extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
2858 extern int file_update_time(struct file *file);
2864 static inline bool io_is_direct(struct file *filp) in io_is_direct()
2869 static inline int iocb_flags(struct file *file) in iocb_flags() argument
2872 if (file->f_flags & O_APPEND) in iocb_flags()
2874 if (io_is_direct(file)) in iocb_flags()
2906 char *simple_transaction_get(struct file *file, const char __user *buf,
2908 ssize_t simple_transaction_read(struct file *file, char __user *buf,
2910 int simple_transaction_release(struct inode *inode, struct file *file);
2912 void simple_transaction_set(struct file *file, size_t n);
2931 static int __fops ## _open(struct inode *inode, struct file *file) \
2934 return simple_attr_open(inode, file, __get, __set, __fmt); \
2951 int simple_attr_open(struct inode *inode, struct file *file,
2954 int simple_attr_release(struct inode *inode, struct file *file);
2955 ssize_t simple_attr_read(struct file *file, char __user *buf,
2957 ssize_t simple_attr_write(struct file *file, const char __user *buf,
3006 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) in dir_emit_dot() argument
3009 file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0; in dir_emit_dot()
3011 static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) in dir_emit_dotdot() argument
3014 parent_ino(file->f_path.dentry), DT_DIR) == 0; in dir_emit_dotdot()
3016 static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) in dir_emit_dots() argument
3019 if (!dir_emit_dot(file, ctx)) in dir_emit_dots()
3024 if (!dir_emit_dotdot(file, ctx)) in dir_emit_dots()