Lines Matching refs:file
258 struct file *ia_file;
342 struct file *ki_filp;
358 int (*read_folio)(struct file *, struct folio *);
368 int (*write_begin)(struct file *, struct address_space *mapping,
371 int (*write_end)(struct file *, struct address_space *mapping,
394 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
396 void (*swap_deactivate)(struct file *file);
940 struct file { struct
988 static inline struct file *get_file(struct file *f) in get_file()
1103 struct file *fl_file;
1144 extern int fcntl_getlk(struct file *, unsigned int, struct flock *);
1145 extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
1149 extern int fcntl_getlk64(struct file *, unsigned int, struct flock64 *);
1150 extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
1154 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
1155 extern int fcntl_getlease(struct file *filp);
1164 extern void locks_remove_posix(struct file *, fl_owner_t);
1165 extern void locks_remove_file(struct file *);
1167 extern void posix_test_lock(struct file *, struct file_lock *);
1168 extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1170 extern int vfs_test_lock(struct file *, struct file_lock *);
1171 extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
1172 extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1176 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
1177 extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
1186 struct file *filp, struct files_struct *files);
1190 static inline int fcntl_getlk(struct file *file, unsigned int cmd, in fcntl_getlk() argument
1196 static inline int fcntl_setlk(unsigned int fd, struct file *file, in fcntl_setlk() argument
1203 static inline int fcntl_getlk64(struct file *file, unsigned int cmd, in fcntl_getlk64() argument
1209 static inline int fcntl_setlk64(unsigned int fd, struct file *file, in fcntl_setlk64() argument
1215 static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg) in fcntl_setlease()
1220 static inline int fcntl_getlease(struct file *filp) in fcntl_getlease()
1245 static inline void locks_remove_posix(struct file *filp, fl_owner_t owner) in locks_remove_posix()
1250 static inline void locks_remove_file(struct file *filp) in locks_remove_file()
1255 static inline void posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
1260 static inline int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1271 static inline int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
1276 static inline int vfs_lock_file(struct file *filp, unsigned int cmd, in vfs_lock_file()
1282 static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
1303 static inline int generic_setlease(struct file *filp, long arg, in generic_setlease()
1309 static inline int vfs_setlease(struct file *filp, long arg, in vfs_setlease()
1323 struct file *filp, struct files_struct *files) {} in show_fd_locks()
1331 static inline struct inode *file_inode(const struct file *f) in file_inode()
1336 static inline struct dentry *file_dentry(const struct file *file) in file_dentry() argument
1338 return d_real(file->f_path.dentry, file_inode(file)); in file_dentry()
1341 static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) in locks_lock_file_wait()
1351 struct file *fa_file;
1358 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1359 extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struc…
1360 extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1367 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
1368 extern int f_setown(struct file *filp, unsigned long arg, int force);
1369 extern void f_delown(struct file *filp);
1370 extern pid_t f_getown(struct file *filp);
2007 struct file *vfs_tmpfile_open(struct user_namespace *mnt_userns,
2015 int vfs_fchown(struct file *file, uid_t user, gid_t group);
2016 int vfs_fchmod(struct file *file, umode_t mode);
2019 extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
2022 extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
2105 loff_t (*llseek) (struct file *, loff_t, int);
2106 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
2107 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
2112 int (*iterate) (struct file *, struct dir_context *);
2113 int (*iterate_shared) (struct file *, struct dir_context *);
2114 __poll_t (*poll) (struct file *, struct poll_table_struct *);
2115 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
2116 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
2117 int (*mmap) (struct file *, struct vm_area_struct *);
2119 int (*open) (struct inode *, struct file *);
2120 int (*flush) (struct file *, fl_owner_t id);
2121 int (*release) (struct inode *, struct file *);
2122 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
2123 int (*fasync) (int, struct file *, int);
2124 int (*lock) (struct file *, int, struct file_lock *);
2125 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
2126 …unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, uns…
2128 int (*flock) (struct file *, int, struct file_lock *);
2129 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
2130 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
2131 int (*setlease)(struct file *, long, struct file_lock **, void **);
2132 long (*fallocate)(struct file *file, int mode, loff_t offset,
2134 void (*show_fdinfo)(struct seq_file *m, struct file *f);
2136 unsigned (*mmap_capabilities)(struct file *);
2138 ssize_t (*copy_file_range)(struct file *, loff_t, struct file *,
2140 loff_t (*remap_file_range)(struct file *file_in, loff_t pos_in,
2141 struct file *file_out, loff_t pos_out,
2143 int (*fadvise)(struct file *, loff_t, loff_t, int);
2179 struct file *, unsigned open_flag,
2182 struct file *, umode_t);
2190 static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio, in call_read_iter() argument
2193 return file->f_op->read_iter(kio, iter); in call_read_iter()
2196 static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio, in call_write_iter() argument
2199 return file->f_op->write_iter(kio, iter); in call_write_iter()
2202 static inline int call_mmap(struct file *file, struct vm_area_struct *vma) in call_mmap() argument
2204 return file->f_op->mmap(file, vma); in call_mmap()
2207 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
2208 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
2209 extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
2211 extern ssize_t generic_copy_file_range(struct file *file_in, loff_t pos_in,
2212 struct file *file_out, loff_t pos_out,
2214 int __generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
2215 struct file *file_out, loff_t pos_out,
2218 int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
2219 struct file *file_out, loff_t pos_out,
2221 extern loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
2222 struct file *file_out, loff_t pos_out,
2224 extern loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
2225 struct file *file_out, loff_t pos_out,
2227 extern int vfs_dedupe_file_range(struct file *file,
2229 extern loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
2230 struct file *dst_file, loff_t dst_pos,
2346 static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) in init_sync_kiocb()
2356 struct file *filp) in kiocb_clone()
2526 static inline void file_accessed(struct file *file) in file_accessed() argument
2528 if (!(file->f_flags & O_NOATIME)) in file_accessed()
2529 touch_atime(&file->f_path); in file_accessed()
2532 extern int file_modified(struct file *file);
2610 struct file *__file = (f); \
2738 static inline struct user_namespace *file_mnt_user_ns(struct file *file) in file_mnt_user_ns() argument
2740 return mnt_user_ns(file->f_path.mnt); in file_mnt_user_ns()
2759 unsigned int time_attrs, struct file *filp);
2760 extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
2764 extern struct file *file_open_name(struct filename *, int, umode_t);
2765 extern struct file *filp_open(const char *, int, umode_t);
2766 extern struct file *file_open_root(const struct path *,
2768 static inline struct file *file_open_root_mnt(struct vfsmount *mnt, in file_open_root_mnt()
2774 extern struct file * dentry_open(const struct path *, int, const struct cred *);
2775 extern struct file *dentry_create(const struct path *path, int flags,
2777 extern struct file * open_with_fake_path(const struct path *, int,
2779 static inline struct file *file_clone_open(struct file *file) in file_clone_open() argument
2781 return dentry_open(&file->f_path, file->f_flags, file->f_cred); in file_clone_open()
2783 extern int filp_close(struct file *, fl_owner_t id);
2791 extern int finish_open(struct file *file, struct dentry *dentry,
2792 int (*open)(struct inode *, struct file *));
2793 extern int finish_no_open(struct file *file, struct dentry *dentry);
2796 static inline int finish_open_simple(struct file *file, int error) in finish_open_simple() argument
2801 return finish_open(file, file->f_path.dentry, NULL); in finish_open_simple()
2859 extern int __must_check file_fdatawait_range(struct file *file, loff_t lstart,
2861 extern int __must_check file_check_and_advance_wb_err(struct file *file);
2862 extern int __must_check file_write_and_wait_range(struct file *file,
2865 static inline int file_write_and_wait(struct file *file) in file_write_and_wait() argument
2867 return file_write_and_wait_range(file, 0, LLONG_MAX); in file_write_and_wait()
2870 extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2872 extern int vfs_fsync(struct file *file, int datasync);
2874 extern int sync_file_range(struct file *file, loff_t offset, loff_t nbytes,
2917 static inline int file_permission(struct file *file, int mask) in file_permission() argument
2919 return inode_permission(file_mnt_user_ns(file), in file_permission()
2920 file_inode(file), mask); in file_permission()
2940 static inline void file_start_write(struct file *file) in file_start_write() argument
2942 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write()
2944 sb_start_write(file_inode(file)->i_sb); in file_start_write()
2947 static inline bool file_start_write_trylock(struct file *file) in file_start_write_trylock() argument
2949 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write_trylock()
2951 return sb_start_write_trylock(file_inode(file)->i_sb); in file_start_write_trylock()
2954 static inline void file_end_write(struct file *file) in file_end_write() argument
2956 if (!S_ISREG(file_inode(file)->i_mode)) in file_end_write()
2958 __sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE); in file_end_write()
2986 static inline int deny_write_access(struct file *file) in deny_write_access() argument
2988 struct inode *inode = file_inode(file); in deny_write_access()
2995 static inline void allow_write_access(struct file *file) in allow_write_access() argument
2997 if (file) in allow_write_access()
2998 atomic_inc(&file_inode(file)->i_writecount); in allow_write_access()
3027 extern ssize_t kernel_read(struct file *, void *, size_t, loff_t *);
3028 ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos);
3029 extern ssize_t kernel_write(struct file *, const void *, size_t, loff_t *);
3030 extern ssize_t __kernel_write(struct file *, const void *, size_t, loff_t *);
3031 extern struct file * open_exec(const char *);
3037 extern char *file_path(struct file *, char *, int);
3042 extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
3044 extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
3116 extern int file_remove_privs(struct file *);
3147 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
3148 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
3151 extern int generic_write_check_limits(struct file *file, loff_t pos,
3153 extern int generic_file_rw_checks(struct file *file_in, struct file *file_out);
3162 ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos,
3164 ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos,
3166 ssize_t vfs_iocb_iter_read(struct file *file, struct kiocb *iocb,
3168 ssize_t vfs_iocb_iter_write(struct file *file, struct kiocb *iocb,
3172 extern ssize_t generic_file_splice_read(struct file *, loff_t *,
3175 struct file *, loff_t *, size_t, unsigned int);
3177 struct file *out, loff_t *, size_t len, unsigned int flags);
3178 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
3184 extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
3186 extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
3187 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
3188 extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
3190 extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
3192 extern loff_t no_seek_end_llseek_size(struct file *, loff_t, int, loff_t);
3193 extern loff_t no_seek_end_llseek(struct file *, loff_t, int);
3194 int rw_verify_area(int, struct file *, const loff_t *, size_t);
3195 extern int generic_file_open(struct inode * inode, struct file * filp);
3196 extern int nonseekable_open(struct inode * inode, struct file * filp);
3197 extern int stream_open(struct inode * inode, struct file * filp);
3257 void dio_warn_stale_pagecache(struct file *filp);
3292 extern int iterate_dir(struct file *, struct dir_context *);
3321 extern int dcache_dir_open(struct inode *, struct file *);
3322 extern int dcache_dir_close(struct inode *, struct file *);
3323 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
3324 extern int dcache_readdir(struct file *, struct dir_context *);
3330 extern int simple_open(struct inode *inode, struct file *file);
3341 extern int noop_fsync(struct file *, loff_t, loff_t, int);
3344 extern int simple_write_begin(struct file *file, struct address_space *mapping,
3350 extern int simple_nosetlease(struct file *, long, struct file_lock **, void **);
3354 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
3371 extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
3372 extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
3385 extern int file_update_time(struct file *file);
3406 static inline int iocb_flags(struct file *file) in iocb_flags() argument
3409 if (file->f_flags & O_APPEND) in iocb_flags()
3411 if (file->f_flags & O_DIRECT) in iocb_flags()
3413 if (file->f_flags & O_DSYNC) in iocb_flags()
3415 if (file->f_flags & __O_SYNC) in iocb_flags()
3472 char *simple_transaction_get(struct file *file, const char __user *buf,
3474 ssize_t simple_transaction_read(struct file *file, char __user *buf,
3476 int simple_transaction_release(struct inode *inode, struct file *file);
3478 void simple_transaction_set(struct file *file, size_t n);
3497 static int __fops ## _open(struct inode *inode, struct file *file) \
3500 return simple_attr_open(inode, file, __get, __set, __fmt); \
3517 int simple_attr_open(struct inode *inode, struct file *file,
3520 int simple_attr_release(struct inode *inode, struct file *file);
3521 ssize_t simple_attr_read(struct file *file, char __user *buf,
3523 ssize_t simple_attr_write(struct file *file, const char __user *buf,
3567 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) in dir_emit_dot() argument
3570 file->f_path.dentry->d_inode->i_ino, DT_DIR); in dir_emit_dot()
3572 static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) in dir_emit_dotdot() argument
3575 parent_ino(file->f_path.dentry), DT_DIR); in dir_emit_dotdot()
3577 static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) in dir_emit_dots() argument
3580 if (!dir_emit_dot(file, ctx)) in dir_emit_dots()
3585 if (!dir_emit_dotdot(file, ctx)) in dir_emit_dots()
3609 extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
3611 extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,