Lines Matching refs:file
241 struct file *ia_file;
329 struct file *ki_filp;
374 int (*readpage)(struct file *, struct page *);
386 int (*readpages)(struct file *filp, struct address_space *mapping,
389 int (*write_begin)(struct file *, struct address_space *mapping,
392 int (*write_end)(struct file *, struct address_space *mapping,
417 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
419 void (*swap_deactivate)(struct file *file);
433 int pagecache_write_begin(struct file *, struct address_space *mapping,
437 int pagecache_write_end(struct file *, struct address_space *mapping,
969 struct file { struct
1020 static inline struct file *get_file(struct file *f) in get_file()
1138 struct file *fl_file;
1183 extern int fcntl_getlk(struct file *, unsigned int, struct flock *);
1184 extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
1188 extern int fcntl_getlk64(struct file *, unsigned int, struct flock64 *);
1189 extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
1193 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
1194 extern int fcntl_getlease(struct file *filp);
1203 extern void locks_remove_posix(struct file *, fl_owner_t);
1204 extern void locks_remove_file(struct file *);
1206 extern void posix_test_lock(struct file *, struct file_lock *);
1207 extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1209 extern int vfs_test_lock(struct file *, struct file_lock *);
1210 extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
1211 extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1215 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
1216 extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
1225 struct file *filp, struct files_struct *files);
1227 static inline int fcntl_getlk(struct file *file, unsigned int cmd, in fcntl_getlk() argument
1233 static inline int fcntl_setlk(unsigned int fd, struct file *file, in fcntl_setlk() argument
1240 static inline int fcntl_getlk64(struct file *file, unsigned int cmd, in fcntl_getlk64() argument
1246 static inline int fcntl_setlk64(unsigned int fd, struct file *file, in fcntl_setlk64() argument
1252 static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg) in fcntl_setlease()
1257 static inline int fcntl_getlease(struct file *filp) in fcntl_getlease()
1282 static inline void locks_remove_posix(struct file *filp, fl_owner_t owner) in locks_remove_posix()
1287 static inline void locks_remove_file(struct file *filp) in locks_remove_file()
1292 static inline void posix_test_lock(struct file *filp, struct file_lock *fl) in posix_test_lock()
1297 static inline int posix_lock_file(struct file *filp, struct file_lock *fl, in posix_lock_file()
1308 static inline int vfs_test_lock(struct file *filp, struct file_lock *fl) in vfs_test_lock()
1313 static inline int vfs_lock_file(struct file *filp, unsigned int cmd, in vfs_lock_file()
1319 static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl) in vfs_cancel_lock()
1340 static inline int generic_setlease(struct file *filp, long arg, in generic_setlease()
1346 static inline int vfs_setlease(struct file *filp, long arg, in vfs_setlease()
1360 struct file *filp, struct files_struct *files) {} in show_fd_locks()
1363 static inline struct inode *file_inode(const struct file *f) in file_inode()
1368 static inline struct dentry *file_dentry(const struct file *file) in file_dentry() argument
1370 return d_real(file->f_path.dentry, file_inode(file)); in file_dentry()
1373 static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) in locks_lock_file_wait()
1383 struct file *fa_file;
1390 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1391 extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struc…
1392 extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1399 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
1400 extern int f_setown(struct file *filp, unsigned long arg, int force);
1401 extern void f_delown(struct file *filp);
1402 extern pid_t f_getown(struct file *filp);
1792 int vfs_fchown(struct file *file, uid_t user, gid_t group);
1793 int vfs_fchmod(struct file *file, umode_t mode);
1795 extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
1798 extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
1891 loff_t (*llseek) (struct file *, loff_t, int);
1892 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
1893 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1897 int (*iterate) (struct file *, struct dir_context *);
1898 int (*iterate_shared) (struct file *, struct dir_context *);
1899 __poll_t (*poll) (struct file *, struct poll_table_struct *);
1900 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1901 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1902 int (*mmap) (struct file *, struct vm_area_struct *);
1904 int (*open) (struct inode *, struct file *);
1905 int (*flush) (struct file *, fl_owner_t id);
1906 int (*release) (struct inode *, struct file *);
1907 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1908 int (*fasync) (int, struct file *, int);
1909 int (*lock) (struct file *, int, struct file_lock *);
1910 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1911 …unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, uns…
1913 int (*flock) (struct file *, int, struct file_lock *);
1914 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1915 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1916 int (*setlease)(struct file *, long, struct file_lock **, void **);
1917 long (*fallocate)(struct file *file, int mode, loff_t offset,
1919 void (*show_fdinfo)(struct seq_file *m, struct file *f);
1921 unsigned (*mmap_capabilities)(struct file *);
1923 ssize_t (*copy_file_range)(struct file *, loff_t, struct file *,
1925 loff_t (*remap_file_range)(struct file *file_in, loff_t pos_in,
1926 struct file *file_out, loff_t pos_out,
1928 int (*fadvise)(struct file *, loff_t, loff_t, int);
1960 struct file *, unsigned open_flag,
1971 static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio, in call_read_iter() argument
1974 return file->f_op->read_iter(kio, iter); in call_read_iter()
1977 static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio, in call_write_iter() argument
1980 return file->f_op->write_iter(kio, iter); in call_write_iter()
1983 static inline int call_mmap(struct file *file, struct vm_area_struct *vma) in call_mmap() argument
1985 return file->f_op->mmap(file, vma); in call_mmap()
1993 extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
1994 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
1995 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
1996 extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
1998 extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
2000 extern ssize_t generic_copy_file_range(struct file *file_in, loff_t pos_in,
2001 struct file *file_out, loff_t pos_out,
2003 extern int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
2004 struct file *file_out, loff_t pos_out,
2007 extern loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
2008 struct file *file_out, loff_t pos_out,
2010 extern loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
2011 struct file *file_out, loff_t pos_out,
2013 extern int vfs_dedupe_file_range(struct file *file,
2015 extern loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
2016 struct file *dst_file, loff_t dst_pos,
2139 static inline enum rw_hint file_write_hint(struct file *file) in file_write_hint() argument
2141 if (file->f_write_hint != WRITE_LIFE_NOT_SET) in file_write_hint()
2142 return file->f_write_hint; in file_write_hint()
2144 return file_inode(file)->i_write_hint; in file_write_hint()
2147 static inline int iocb_flags(struct file *file);
2158 static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) in init_sync_kiocb()
2296 static inline void file_accessed(struct file *file) in file_accessed() argument
2298 if (!(file->f_flags & O_NOATIME)) in file_accessed()
2299 touch_atime(&file->f_path); in file_accessed()
2302 extern int file_modified(struct file *file);
2399 struct file *__file = (f); \
2438 extern int locks_mandatory_locked(struct file *);
2439 extern int locks_mandatory_area(struct inode *, struct file *, loff_t, loff_t, unsigned char);
2461 static inline int locks_verify_locked(struct file *file) in locks_verify_locked() argument
2463 if (mandatory_lock(locks_inode(file))) in locks_verify_locked()
2464 return locks_mandatory_locked(file); in locks_verify_locked()
2469 struct file *f, in locks_verify_truncate()
2486 static inline int locks_mandatory_locked(struct file *file) in locks_mandatory_locked() argument
2491 static inline int locks_mandatory_area(struct inode *inode, struct file *filp, in locks_mandatory_area()
2507 static inline int locks_verify_locked(struct file *file) in locks_verify_locked() argument
2512 static inline int locks_verify_truncate(struct inode *inode, struct file *filp, in locks_verify_truncate()
2624 struct file *filp);
2625 extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
2629 extern struct file *file_open_name(struct filename *, int, umode_t);
2630 extern struct file *filp_open(const char *, int, umode_t);
2631 extern struct file *file_open_root(struct dentry *, struct vfsmount *,
2633 extern struct file * dentry_open(const struct path *, int, const struct cred *);
2634 extern struct file * open_with_fake_path(const struct path *, int,
2636 static inline struct file *file_clone_open(struct file *file) in file_clone_open() argument
2638 return dentry_open(&file->f_path, file->f_flags, file->f_cred); in file_clone_open()
2640 extern int filp_close(struct file *, fl_owner_t id);
2647 extern int finish_open(struct file *file, struct dentry *dentry,
2648 int (*open)(struct inode *, struct file *));
2649 extern int finish_no_open(struct file *file, struct dentry *dentry);
2653 extern int ioctl_preallocate(struct file *filp, void __user *argp);
2725 extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
2854 extern int __must_check file_fdatawait_range(struct file *file, loff_t lstart,
2856 extern int __must_check file_check_and_advance_wb_err(struct file *file);
2857 extern int __must_check file_write_and_wait_range(struct file *file,
2860 static inline int file_write_and_wait(struct file *file) in file_write_and_wait() argument
2862 return file_write_and_wait_range(file, 0, LLONG_MAX); in file_write_and_wait()
2941 extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2943 extern int vfs_fsync(struct file *file, int datasync);
2945 extern int sync_file_range(struct file *file, loff_t offset, loff_t nbytes,
2981 static inline void file_start_write(struct file *file) in file_start_write() argument
2983 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write()
2985 __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true); in file_start_write()
2988 static inline bool file_start_write_trylock(struct file *file) in file_start_write_trylock() argument
2990 if (!S_ISREG(file_inode(file)->i_mode)) in file_start_write_trylock()
2992 return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false); in file_start_write_trylock()
2995 static inline void file_end_write(struct file *file) in file_end_write() argument
2997 if (!S_ISREG(file_inode(file)->i_mode)) in file_end_write()
2999 __sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE); in file_end_write()
3022 static inline int deny_write_access(struct file *file) in deny_write_access() argument
3024 struct inode *inode = file_inode(file); in deny_write_access()
3031 static inline void allow_write_access(struct file *file) in allow_write_access() argument
3033 if (file) in allow_write_access()
3034 atomic_inc(&file_inode(file)->i_writecount); in allow_write_access()
3093 extern int kernel_read_file(struct file *, void **, loff_t *, loff_t,
3099 extern ssize_t kernel_read(struct file *, void *, size_t, loff_t *);
3100 extern ssize_t kernel_write(struct file *, const void *, size_t, loff_t *);
3101 extern ssize_t __kernel_write(struct file *, const void *, size_t, loff_t *);
3102 extern struct file * open_exec(const char *);
3108 extern char *file_path(struct file *, char *, int);
3113 extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
3115 extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
3167 extern int file_remove_privs(struct file *);
3191 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
3192 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
3194 extern int generic_remap_checks(struct file *file_in, loff_t pos_in,
3195 struct file *file_out, loff_t pos_out,
3197 extern int generic_file_rw_checks(struct file *file_in, struct file *file_out);
3198 extern int generic_copy_file_checks(struct file *file_in, loff_t pos_in,
3199 struct file *file_out, loff_t pos_out,
3205 extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
3207 ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos,
3209 ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos,
3215 extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
3220 extern ssize_t generic_file_splice_read(struct file *, loff_t *,
3223 struct file *, loff_t *, size_t, unsigned int);
3225 struct file *out, loff_t *, size_t len, unsigned int flags);
3226 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
3232 extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
3233 extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
3234 extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
3235 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
3236 extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
3238 extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
3240 extern loff_t no_seek_end_llseek_size(struct file *, loff_t, int, loff_t);
3241 extern loff_t no_seek_end_llseek(struct file *, loff_t, int);
3242 extern int generic_file_open(struct inode * inode, struct file * filp);
3243 extern int nonseekable_open(struct inode * inode, struct file * filp);
3244 extern int stream_open(struct inode * inode, struct file * filp);
3259 void dio_warn_stale_pagecache(struct file *filp);
3338 extern int iterate_dir(struct file *, struct dir_context *);
3389 extern int dcache_dir_open(struct inode *, struct file *);
3390 extern int dcache_dir_close(struct inode *, struct file *);
3391 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
3392 extern int dcache_readdir(struct file *, struct dir_context *);
3396 extern int simple_open(struct inode *inode, struct file *file);
3402 extern int noop_fsync(struct file *, loff_t, loff_t, int);
3408 extern int simple_readpage(struct file *file, struct page *page);
3409 extern int simple_write_begin(struct file *file, struct address_space *mapping,
3412 extern int simple_write_end(struct file *file, struct address_space *mapping,
3417 extern int simple_nosetlease(struct file *, long, struct file_lock **, void **);
3421 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
3438 extern int __generic_file_fsync(struct file *, loff_t, loff_t, int);
3439 extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
3473 extern int file_update_time(struct file *file);
3475 static inline bool io_is_direct(struct file *filp) in io_is_direct()
3499 static inline int iocb_flags(struct file *file) in iocb_flags() argument
3502 if (file->f_flags & O_APPEND) in iocb_flags()
3504 if (io_is_direct(file)) in iocb_flags()
3506 if ((file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host)) in iocb_flags()
3508 if (file->f_flags & __O_SYNC) in iocb_flags()
3565 char *simple_transaction_get(struct file *file, const char __user *buf,
3567 ssize_t simple_transaction_read(struct file *file, char __user *buf,
3569 int simple_transaction_release(struct inode *inode, struct file *file);
3571 void simple_transaction_set(struct file *file, size_t n);
3590 static int __fops ## _open(struct inode *inode, struct file *file) \
3593 return simple_attr_open(inode, file, __get, __set, __fmt); \
3616 int simple_attr_open(struct inode *inode, struct file *file,
3619 int simple_attr_release(struct inode *inode, struct file *file);
3620 ssize_t simple_attr_read(struct file *file, char __user *buf,
3622 ssize_t simple_attr_write(struct file *file, const char __user *buf,
3624 ssize_t simple_attr_write_signed(struct file *file, const char __user *buf,
3673 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) in dir_emit_dot() argument
3676 file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0; in dir_emit_dot()
3678 static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) in dir_emit_dotdot() argument
3681 parent_ino(file->f_path.dentry), DT_DIR) == 0; in dir_emit_dotdot()
3683 static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) in dir_emit_dots() argument
3686 if (!dir_emit_dot(file, ctx)) in dir_emit_dots()
3691 if (!dir_emit_dotdot(file, ctx)) in dir_emit_dots()
3715 extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
3717 extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
3721 bool io_is_uring_fops(struct file *file);
3723 static inline bool io_is_uring_fops(struct file *file) in io_is_uring_fops() argument