Lines Matching refs:file

237 	struct file	*ia_file;
326 struct file *ki_filp;
374 int (*readpage)(struct file *, struct page *);
386 int (*readpages)(struct file *filp, struct address_space *mapping,
390 int (*write_begin)(struct file *, struct address_space *mapping,
393 int (*write_end)(struct file *, struct address_space *mapping,
418 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
420 void (*swap_deactivate)(struct file *file);
429 int pagecache_write_begin(struct file *, struct address_space *mapping,
433 int pagecache_write_end(struct file *, struct address_space *mapping,
965 struct file { struct
1013 static inline struct file *get_file(struct file *f) in get_file()
1127 struct file *fl_file;
1168 extern int fcntl_getlk(struct file *, unsigned int, struct flock *);
1169 extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
1173 extern int fcntl_getlk64(struct file *, unsigned int, struct flock64 *);
1174 extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
1178 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
1179 extern int fcntl_getlease(struct file *filp);
1188 extern void locks_remove_posix(struct file *, fl_owner_t);
1189 extern void locks_remove_file(struct file *);
1191 extern void posix_test_lock(struct file *, struct file_lock *);
1192 extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1194 extern int vfs_test_lock(struct file *, struct file_lock *);
1195 extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
1196 extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1200 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
1201 extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
1210 struct file *filp, struct files_struct *files);
1212 static inline int fcntl_getlk(struct file *file, unsigned int cmd, in fcntl_getlk() argument
1218 static inline int fcntl_setlk(unsigned int fd, struct file *file, in fcntl_setlk() argument
1225 static inline int fcntl_getlk64(struct file *file, unsigned int cmd, in fcntl_getlk64() argument
1231 static inline int fcntl_setlk64(unsigned int fd, struct file *file, in fcntl_setlk64() argument
1237 static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg) in fcntl_setlease()
1242 static inline int fcntl_getlease(struct file *filp) in fcntl_getlease()
1267 static inline void locks_remove_posix(struct file *filp, fl_owner_t owner) in locks_remove_posix()
1272 static inline void locks_remove_file(struct file *filp) in locks_remove_file()
1277 static inline void posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
1282 static inline int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1293 static inline int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
1298 static inline int vfs_lock_file(struct file *filp, unsigned int cmd, in vfs_lock_file()
1304 static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
1325 static inline int generic_setlease(struct file *filp, long arg, in generic_setlease()
1331 static inline int vfs_setlease(struct file *filp, long arg, in vfs_setlease()
1345 struct file *filp, struct files_struct *files) {} in show_fd_locks()
1348 static inline struct inode *file_inode(const struct file *f) in file_inode()
1353 static inline struct dentry *file_dentry(const struct file *file) in file_dentry() argument
1355 return d_real(file->f_path.dentry, file_inode(file)); in file_dentry()
1358 static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) in locks_lock_file_wait()
1368 struct file *fa_file;
1375 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1376 extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struc…
1377 extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1384 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
1385 extern int f_setown(struct file *filp, unsigned long arg, int force);
1386 extern void f_delown(struct file *filp);
1387 extern pid_t f_getown(struct file *filp);
1995 int vfs_fchown(struct file *file, uid_t user, gid_t group);
1996 int vfs_fchmod(struct file *file, umode_t mode);
1999 extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
2002 extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
2073 loff_t (*llseek) (struct file *, loff_t, int);
2074 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
2075 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
2079 int (*iterate) (struct file *, struct dir_context *);
2080 int (*iterate_shared) (struct file *, struct dir_context *);
2081 __poll_t (*poll) (struct file *, struct poll_table_struct *);
2082 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
2083 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
2084 int (*mmap) (struct file *, struct vm_area_struct *);
2086 int (*open) (struct inode *, struct file *);
2087 int (*flush) (struct file *, fl_owner_t id);
2088 int (*release) (struct inode *, struct file *);
2089 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
2090 int (*fasync) (int, struct file *, int);
2091 int (*lock) (struct file *, int, struct file_lock *);
2092 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
2093 …unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, uns…
2095 int (*flock) (struct file *, int, struct file_lock *);
2096 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
2097 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
2098 int (*setlease)(struct file *, long, struct file_lock **, void **);
2099 long (*fallocate)(struct file *file, int mode, loff_t offset,
2101 void (*show_fdinfo)(struct seq_file *m, struct file *f);
2103 unsigned (*mmap_capabilities)(struct file *);
2105 ssize_t (*copy_file_range)(struct file *, loff_t, struct file *,
2107 loff_t (*remap_file_range)(struct file *file_in, loff_t pos_in,
2108 struct file *file_out, loff_t pos_out,
2110 int (*fadvise)(struct file *, loff_t, loff_t, int);
2143 struct file *, unsigned open_flag,
2154 static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio, in call_read_iter() argument
2157 return file->f_op->read_iter(kio, iter); in call_read_iter()
2160 static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio, in call_write_iter() argument
2163 return file->f_op->write_iter(kio, iter); in call_write_iter()
2166 static inline int call_mmap(struct file *file, struct vm_area_struct *vma) in call_mmap() argument
2168 return file->f_op->mmap(file, vma); in call_mmap()
2171 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
2172 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
2173 extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
2175 extern ssize_t generic_copy_file_range(struct file *file_in, loff_t pos_in,
2176 struct file *file_out, loff_t pos_out,
2178 extern int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
2179 struct file *file_out, loff_t pos_out,
2182 extern loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
2183 struct file *file_out, loff_t pos_out,
2185 extern loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
2186 struct file *file_out, loff_t pos_out,
2188 extern int vfs_dedupe_file_range(struct file *file,
2190 extern loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
2191 struct file *dst_file, loff_t dst_pos,
2306 static inline enum rw_hint file_write_hint(struct file *file) in file_write_hint() argument
2308 if (file->f_write_hint != WRITE_LIFE_NOT_SET) in file_write_hint()
2309 return file->f_write_hint; in file_write_hint()
2311 return file_inode(file)->i_write_hint; in file_write_hint()
2314 static inline int iocb_flags(struct file *file);
2325 static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) in init_sync_kiocb()
2336 struct file *filp) in kiocb_clone()
2501 static inline void file_accessed(struct file *file) in file_accessed() argument
2503 if (!(file->f_flags & O_NOATIME)) in file_accessed()
2504 touch_atime(&file->f_path); in file_accessed()
2507 extern int file_modified(struct file *file);
2584 struct file *__file = (f); \
2723 static inline struct user_namespace *file_mnt_user_ns(struct file *file) in file_mnt_user_ns() argument
2725 return mnt_user_ns(file->f_path.mnt); in file_mnt_user_ns()
2729 unsigned int time_attrs, struct file *filp);
2730 extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
2734 extern struct file *file_open_name(struct filename *, int, umode_t);
2735 extern struct file *filp_open(const char *, int, umode_t);
2736 extern struct file *file_open_root(const struct path *,
2738 static inline struct file *file_open_root_mnt(struct vfsmount *mnt, in file_open_root_mnt()
2744 extern struct file * dentry_open(const struct path *, int, const struct cred *);
2745 extern struct file * open_with_fake_path(const struct path *, int,
2747 static inline struct file *file_clone_open(struct file *file) in file_clone_open() argument
2749 return dentry_open(&file->f_path, file->f_flags, file->f_cred); in file_clone_open()
2751 extern int filp_close(struct file *, fl_owner_t id);
2759 extern int finish_open(struct file *file, struct dentry *dentry,
2760 int (*open)(struct inode *, struct file *));
2761 extern int finish_no_open(struct file *file, struct dentry *dentry);
2868 extern int __must_check file_fdatawait_range(struct file *file, loff_t lstart,
2870 extern int __must_check file_check_and_advance_wb_err(struct file *file);
2871 extern int __must_check file_write_and_wait_range(struct file *file,
2874 static inline int file_write_and_wait(struct file *file) in file_write_and_wait() argument
2876 return file_write_and_wait_range(file, 0, LLONG_MAX); in file_write_and_wait()
2935 static inline errseq_t file_sample_sb_err(struct file *file) in file_sample_sb_err() argument
2937 return errseq_sample(&file->f_path.dentry->d_sb->s_wb_err); in file_sample_sb_err()
2940 extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2942 extern int vfs_fsync(struct file *file, int datasync);
2944 extern int sync_file_range(struct file *file, loff_t offset, loff_t nbytes,
2981 static inline int file_permission(struct file *file, int mask) in file_permission() argument
2983 return inode_permission(file_mnt_user_ns(file), in file_permission()
2984 file_inode(file), mask); in file_permission()
3004 static inline void file_start_write(struct file *file) in file_start_write() argument
3006 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write()
3008 sb_start_write(file_inode(file)->i_sb); in file_start_write()
3011 static inline bool file_start_write_trylock(struct file *file) in file_start_write_trylock() argument
3013 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write_trylock()
3015 return sb_start_write_trylock(file_inode(file)->i_sb); in file_start_write_trylock()
3018 static inline void file_end_write(struct file *file) in file_end_write() argument
3020 if (!S_ISREG(file_inode(file)->i_mode)) in file_end_write()
3022 __sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE); in file_end_write()
3050 static inline int deny_write_access(struct file *file) in deny_write_access() argument
3052 struct inode *inode = file_inode(file); in deny_write_access()
3059 static inline void allow_write_access(struct file *file) in allow_write_access() argument
3061 if (file) in allow_write_access()
3062 atomic_inc(&file_inode(file)->i_writecount); in allow_write_access()
3091 extern ssize_t kernel_read(struct file *, void *, size_t, loff_t *);
3092 ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos);
3093 extern ssize_t kernel_write(struct file *, const void *, size_t, loff_t *);
3094 extern ssize_t __kernel_write(struct file *, const void *, size_t, loff_t *);
3095 extern struct file * open_exec(const char *);
3101 extern char *file_path(struct file *, char *, int);
3106 extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
3108 extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
3179 extern int file_remove_privs(struct file *);
3199 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
3200 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
3202 extern int generic_write_check_limits(struct file *file, loff_t pos,
3204 extern int generic_file_rw_checks(struct file *file_in, struct file *file_out);
3211 extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
3213 ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos,
3215 ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos,
3217 ssize_t vfs_iocb_iter_read(struct file *file, struct kiocb *iocb,
3219 ssize_t vfs_iocb_iter_write(struct file *file, struct kiocb *iocb,
3223 extern ssize_t generic_file_splice_read(struct file *, loff_t *,
3226 struct file *, loff_t *, size_t, unsigned int);
3228 struct file *out, loff_t *, size_t len, unsigned int flags);
3229 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
3235 extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
3236 extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
3237 extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
3238 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
3239 extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
3241 extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
3243 extern loff_t no_seek_end_llseek_size(struct file *, loff_t, int, loff_t);
3244 extern loff_t no_seek_end_llseek(struct file *, loff_t, int);
3245 extern int generic_file_open(struct inode * inode, struct file * filp);
3246 extern int nonseekable_open(struct inode * inode, struct file * filp);
3247 extern int stream_open(struct inode * inode, struct file * filp);
3307 void dio_warn_stale_pagecache(struct file *filp);
3344 extern int iterate_dir(struct file *, struct dir_context *);
3373 extern int dcache_dir_open(struct inode *, struct file *);
3374 extern int dcache_dir_close(struct inode *, struct file *);
3375 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
3376 extern int dcache_readdir(struct file *, struct dir_context *);
3382 extern int simple_open(struct inode *inode, struct file *file);
3391 extern int noop_fsync(struct file *, loff_t, loff_t, int);
3396 extern int simple_write_begin(struct file *file, struct address_space *mapping,
3402 extern int simple_nosetlease(struct file *, long, struct file_lock **, void **);
3406 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
3423 extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
3424 extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
3449 extern int file_update_time(struct file *file);
3470 static inline int iocb_flags(struct file *file) in iocb_flags() argument
3473 if (file->f_flags & O_APPEND) in iocb_flags()
3475 if (file->f_flags & O_DIRECT) in iocb_flags()
3477 if ((file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host)) in iocb_flags()
3479 if (file->f_flags & __O_SYNC) in iocb_flags()
3536 char *simple_transaction_get(struct file *file, const char __user *buf,
3538 ssize_t simple_transaction_read(struct file *file, char __user *buf,
3540 int simple_transaction_release(struct inode *inode, struct file *file);
3542 void simple_transaction_set(struct file *file, size_t n);
3561 static int __fops ## _open(struct inode *inode, struct file *file) \
3564 return simple_attr_open(inode, file, __get, __set, __fmt); \
3581 int simple_attr_open(struct inode *inode, struct file *file,
3584 int simple_attr_release(struct inode *inode, struct file *file);
3585 ssize_t simple_attr_read(struct file *file, char __user *buf,
3587 ssize_t simple_attr_write(struct file *file, const char __user *buf,
3637 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) in dir_emit_dot() argument
3640 file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0; in dir_emit_dot()
3642 static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) in dir_emit_dotdot() argument
3645 parent_ino(file->f_path.dentry), DT_DIR) == 0; in dir_emit_dotdot()
3647 static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) in dir_emit_dots() argument
3650 if (!dir_emit_dot(file, ctx)) in dir_emit_dots()
3655 if (!dir_emit_dotdot(file, ctx)) in dir_emit_dots()
3679 extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
3681 extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,