Lines Matching refs:file
259 struct file *ia_file;
372 struct file *ki_filp;
404 int (*read_folio)(struct file *, struct folio *);
414 int (*write_begin)(struct file *, struct address_space *mapping,
417 int (*write_end)(struct file *, struct address_space *mapping,
440 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
442 void (*swap_deactivate)(struct file *file);
992 struct file { struct
1040 static inline struct file *get_file(struct file *f) in get_file()
1071 static inline struct inode *file_inode(const struct file *f) in file_inode()
1076 static inline struct dentry *file_dentry(const struct file *file) in file_dentry() argument
1078 return d_real(file->f_path.dentry, file_inode(file)); in file_dentry()
1086 struct file *fa_file;
1093 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1094 extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struc…
1095 extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1102 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
1103 extern int f_setown(struct file *filp, int who, int force);
1104 extern void f_delown(struct file *filp);
1105 extern pid_t f_getown(struct file *filp);
1752 struct file *kernel_tmpfile_open(struct mnt_idmap *idmap,
1756 struct file *kernel_file_open(const struct path *path, int flags,
1763 int vfs_fchown(struct file *file, uid_t user, gid_t group);
1764 int vfs_fchmod(struct file *file, umode_t mode);
1767 extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
1770 extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
1854 loff_t (*llseek) (struct file *, loff_t, int);
1855 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
1856 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1861 int (*iterate_shared) (struct file *, struct dir_context *);
1862 __poll_t (*poll) (struct file *, struct poll_table_struct *);
1863 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1864 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1865 int (*mmap) (struct file *, struct vm_area_struct *);
1867 int (*open) (struct inode *, struct file *);
1868 int (*flush) (struct file *, fl_owner_t id);
1869 int (*release) (struct inode *, struct file *);
1870 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1871 int (*fasync) (int, struct file *, int);
1872 int (*lock) (struct file *, int, struct file_lock *);
1873 …unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, uns…
1875 int (*flock) (struct file *, int, struct file_lock *);
1876 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1877 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1878 void (*splice_eof)(struct file *file);
1879 int (*setlease)(struct file *, int, struct file_lock **, void **);
1880 long (*fallocate)(struct file *file, int mode, loff_t offset,
1882 void (*show_fdinfo)(struct seq_file *m, struct file *f);
1884 unsigned (*mmap_capabilities)(struct file *);
1886 ssize_t (*copy_file_range)(struct file *, loff_t, struct file *,
1888 loff_t (*remap_file_range)(struct file *file_in, loff_t pos_in,
1889 struct file *file_out, loff_t pos_out,
1891 int (*fadvise)(struct file *, loff_t, loff_t, int);
1898 int wrap_directory_iterator(struct file *, struct dir_context *,
1899 int (*) (struct file *, struct dir_context *));
1901 static int shared_##x(struct file *file , struct dir_context *ctx) \
1902 { return wrap_directory_iterator(file, ctx, x); }
1933 struct file *, unsigned open_flag,
1936 struct file *, umode_t);
1947 static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio, in call_read_iter() argument
1950 return file->f_op->read_iter(kio, iter); in call_read_iter()
1953 static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio, in call_write_iter() argument
1956 return file->f_op->write_iter(kio, iter); in call_write_iter()
1959 static inline int call_mmap(struct file *file, struct vm_area_struct *vma) in call_mmap() argument
1961 return file->f_op->mmap(file, vma); in call_mmap()
1964 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
1965 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
1966 extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
1968 extern ssize_t generic_copy_file_range(struct file *file_in, loff_t pos_in,
1969 struct file *file_out, loff_t pos_out,
1971 int __generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
1972 struct file *file_out, loff_t pos_out,
1975 int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
1976 struct file *file_out, loff_t pos_out,
1978 extern loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
1979 struct file *file_out, loff_t pos_out,
1981 extern loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
1982 struct file *file_out, loff_t pos_out,
1984 extern int vfs_dedupe_file_range(struct file *file,
1986 extern loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
1987 struct file *dst_file, loff_t dst_pos,
2108 static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) in init_sync_kiocb()
2118 struct file *filp) in kiocb_clone()
2288 static inline void file_accessed(struct file *file) in file_accessed() argument
2290 if (!(file->f_flags & O_NOATIME)) in file_accessed()
2291 touch_atime(&file->f_path); in file_accessed()
2294 extern int file_modified(struct file *file);
2373 struct file *__file = (f); \
2412 static inline struct mnt_idmap *file_mnt_idmap(struct file *file) in file_mnt_idmap() argument
2414 return mnt_idmap(file->f_path.mnt); in file_mnt_idmap()
2432 unsigned int time_attrs, struct file *filp);
2433 extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
2437 extern struct file *file_open_name(struct filename *, int, umode_t);
2438 extern struct file *filp_open(const char *, int, umode_t);
2439 extern struct file *file_open_root(const struct path *,
2441 static inline struct file *file_open_root_mnt(struct vfsmount *mnt, in file_open_root_mnt()
2447 struct file *dentry_open(const struct path *path, int flags,
2449 struct file *dentry_create(const struct path *path, int flags, umode_t mode,
2451 struct file *backing_file_open(const struct path *path, int flags,
2454 struct path *backing_file_real_path(struct file *f);
2465 static inline const struct path *file_real_path(struct file *f) in file_real_path()
2472 static inline struct file *file_clone_open(struct file *file) in file_clone_open() argument
2474 return dentry_open(&file->f_path, file->f_flags, file->f_cred); in file_clone_open()
2476 extern int filp_close(struct file *, fl_owner_t id);
2484 extern int finish_open(struct file *file, struct dentry *dentry,
2485 int (*open)(struct inode *, struct file *));
2486 extern int finish_no_open(struct file *file, struct dentry *dentry);
2489 static inline int finish_open_simple(struct file *file, int error) in finish_open_simple() argument
2494 return finish_open(file, file->f_path.dentry, NULL); in finish_open_simple()
2552 extern int __must_check file_fdatawait_range(struct file *file, loff_t lstart,
2554 extern int __must_check file_check_and_advance_wb_err(struct file *file);
2555 extern int __must_check file_write_and_wait_range(struct file *file,
2558 static inline int file_write_and_wait(struct file *file) in file_write_and_wait() argument
2560 return file_write_and_wait_range(file, 0, LLONG_MAX); in file_write_and_wait()
2563 extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2565 extern int vfs_fsync(struct file *file, int datasync);
2567 extern int sync_file_range(struct file *file, loff_t offset, loff_t nbytes,
2610 static inline int file_permission(struct file *file, int mask) in file_permission() argument
2612 return inode_permission(file_mnt_idmap(file), in file_permission()
2613 file_inode(file), mask); in file_permission()
2640 static inline void file_start_write(struct file *file) in file_start_write() argument
2642 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write()
2644 sb_start_write(file_inode(file)->i_sb); in file_start_write()
2647 static inline bool file_start_write_trylock(struct file *file) in file_start_write_trylock() argument
2649 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write_trylock()
2651 return sb_start_write_trylock(file_inode(file)->i_sb); in file_start_write_trylock()
2660 static inline void file_end_write(struct file *file) in file_end_write() argument
2662 if (!S_ISREG(file_inode(file)->i_mode)) in file_end_write()
2664 sb_end_write(file_inode(file)->i_sb); in file_end_write()
2728 static inline int deny_write_access(struct file *file) in deny_write_access() argument
2730 struct inode *inode = file_inode(file); in deny_write_access()
2737 static inline void allow_write_access(struct file *file) in allow_write_access() argument
2739 if (file) in allow_write_access()
2740 atomic_inc(&file_inode(file)->i_writecount); in allow_write_access()
2768 extern ssize_t kernel_read(struct file *, void *, size_t, loff_t *);
2769 ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos);
2770 extern ssize_t kernel_write(struct file *, const void *, size_t, loff_t *);
2771 extern ssize_t __kernel_write(struct file *, const void *, size_t, loff_t *);
2772 extern struct file * open_exec(const char *);
2778 extern char *file_path(struct file *, char *, int);
2783 extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
2785 extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
2857 extern int file_remove_privs(struct file *);
2890 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
2891 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
2894 extern int generic_write_check_limits(struct file *file, loff_t pos,
2896 extern int generic_file_rw_checks(struct file *file_in, struct file *file_out);
2907 ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos,
2909 ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos,
2911 ssize_t vfs_iocb_iter_read(struct file *file, struct kiocb *iocb,
2913 ssize_t vfs_iocb_iter_write(struct file *file, struct kiocb *iocb,
2917 ssize_t filemap_splice_read(struct file *in, loff_t *ppos,
2920 ssize_t copy_splice_read(struct file *in, loff_t *ppos,
2924 struct file *, loff_t *, size_t, unsigned int);
2925 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
2931 extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
2933 extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
2934 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
2935 extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2937 extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
2939 extern loff_t no_seek_end_llseek_size(struct file *, loff_t, int, loff_t);
2940 extern loff_t no_seek_end_llseek(struct file *, loff_t, int);
2941 int rw_verify_area(int, struct file *, const loff_t *, size_t);
2942 extern int generic_file_open(struct inode * inode, struct file * filp);
2943 extern int nonseekable_open(struct inode * inode, struct file * filp);
2944 extern int stream_open(struct inode * inode, struct file * filp);
3034 extern int iterate_dir(struct file *, struct dir_context *);
3062 extern int dcache_dir_open(struct inode *, struct file *);
3063 extern int dcache_dir_close(struct inode *, struct file *);
3064 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
3065 extern int dcache_readdir(struct file *, struct dir_context *);
3071 extern int simple_open(struct inode *inode, struct file *file);
3084 extern int noop_fsync(struct file *, loff_t, loff_t, int);
3087 extern int simple_write_begin(struct file *file, struct address_space *mapping,
3093 extern int simple_nosetlease(struct file *, int, struct file_lock **, void **);
3097 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
3130 extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
3131 extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
3144 extern int file_update_time(struct file *file);
3165 static inline int iocb_flags(struct file *file) in iocb_flags() argument
3168 if (file->f_flags & O_APPEND) in iocb_flags()
3170 if (file->f_flags & O_DIRECT) in iocb_flags()
3172 if (file->f_flags & O_DSYNC) in iocb_flags()
3174 if (file->f_flags & __O_SYNC) in iocb_flags()
3231 char *simple_transaction_get(struct file *file, const char __user *buf,
3233 ssize_t simple_transaction_read(struct file *file, char __user *buf,
3235 int simple_transaction_release(struct inode *inode, struct file *file);
3237 void simple_transaction_set(struct file *file, size_t n);
3256 static int __fops ## _open(struct inode *inode, struct file *file) \
3259 return simple_attr_open(inode, file, __get, __set, __fmt); \
3282 int simple_attr_open(struct inode *inode, struct file *file,
3285 int simple_attr_release(struct inode *inode, struct file *file);
3286 ssize_t simple_attr_read(struct file *file, char __user *buf,
3288 ssize_t simple_attr_write(struct file *file, const char __user *buf,
3290 ssize_t simple_attr_write_signed(struct file *file, const char __user *buf,
3334 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) in dir_emit_dot() argument
3337 file->f_path.dentry->d_inode->i_ino, DT_DIR); in dir_emit_dot()
3339 static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) in dir_emit_dotdot() argument
3342 parent_ino(file->f_path.dentry), DT_DIR); in dir_emit_dotdot()
3344 static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) in dir_emit_dots() argument
3347 if (!dir_emit_dot(file, ctx)) in dir_emit_dots()
3352 if (!dir_emit_dotdot(file, ctx)) in dir_emit_dots()
3376 extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
3378 extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,