Lines Matching refs:file

5  * This file has definitions for some important file table
14 * the file limit at runtime and only root can increase the per-process
30 #define SEEK_SET 0 /* seek relative to beginning of file */
31 #define SEEK_CUR 1 /* seek relative to current file position */
32 #define SEEK_END 2 /* seek relative to end of file */
140 #define S_APPEND 4 /* Append-only file */
141 #define S_IMMUTABLE 8 /* Immutable file */
145 #define S_NOCMTIME 128 /* Do not update file c/mtime */
150 * Note that nosuid etc flags are inode-specific: setting some file-system
155 * Exception: MS_RDONLY is always applied to the entire file system.
182 probably as bad and I don't want to create yet another include file. */
308 struct file *ia_file;
356 int (*readpage)(struct file *, struct page *);
365 int (*readpages)(struct file *filp, struct address_space *mapping,
372 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
373 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
467 * Might pages of this file be mapped into userspace?
476 * Might pages of this file have been modified in userspace?
478 * marks vma as VM_SHARED if it is shared, and the file was opened for
570 * 3: quota file
654 * Track a single file's readahead state
668 #define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */
669 #define RA_FLAG_INCACHE 0x02 /* file is already in cache */
671 struct file {
698 /* Used by fs/eventpoll.c to link all the hooks to this file */
725 #define FL_LEASE 32 /* lease held on this file */
730 * The POSIX file lock owner is determined by
765 struct file *fl_file;
782 /* The following constant reflects the upper bound of the file/locking space */
791 extern int fcntl_getlk(struct file *, struct flock __user *);
792 extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
796 extern int fcntl_getlk64(struct file *, struct flock64 __user *);
797 extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
802 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
803 extern int fcntl_getlease(struct file *filp);
806 extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte,
812 extern void locks_remove_posix(struct file *, fl_owner_t);
813 extern void locks_remove_flock(struct file *);
814 extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *);
815 extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *);
816 extern int posix_lock_file(struct file *, struct file_lock *);
817 extern int posix_lock_file_wait(struct file *, struct file_lock *);
818 extern int posix_unblock_lock(struct file *, struct file_lock *);
819 extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
822 extern int setlease(struct file *, long, struct file_lock **);
831 struct file *fa_file;
837 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
843 extern int f_setown(struct file *filp, unsigned long arg, int force);
844 extern void f_delown(struct file *filp);
866 unsigned long long s_maxbytes; /* Max file size */
976 * VFS file helper functions.
978 extern int file_permission(struct file *, int);
1010 int (*open) (struct inode *, struct file *);
1011 int (*release) (struct inode *, struct file *);
1012 int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
1013 long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
1014 long (*compat_ioctl) (struct file *, unsigned, unsigned long);
1026 * we read from a file.
1056 loff_t (*llseek) (struct file *, loff_t, int);
1057 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
1059 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1061 int (*readdir) (struct file *, void *, filldir_t);
1062 unsigned int (*poll) (struct file *, struct poll_table_struct *);
1063 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
1064 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1065 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1066 int (*mmap) (struct file *, struct vm_area_struct *);
1067 int (*open) (struct inode *, struct file *);
1068 int (*flush) (struct file *, fl_owner_t id);
1069 int (*release) (struct inode *, struct file *);
1070 int (*fsync) (struct file *, struct dentry *, int datasync);
1072 int (*fasync) (int, struct file *, int);
1073 int (*lock) (struct file *, int, struct file_lock *);
1074 ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
1075 ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
1076 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
1077 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1078 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1080 int (*dir_notify)(struct file *filp, unsigned long arg);
1081 int (*flock) (struct file *, int, struct file_lock *);
1082 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1083 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1113 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
1114 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
1115 extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
1117 extern ssize_t vfs_writev(struct file *, const struct iovec __user *,
1189 static inline void file_accessed(struct file *file)
1191 if (!(file->f_flags & O_NOATIME))
1192 touch_atime(file->f_vfsmnt, file->f_dentry);
1198 * struct export_operations - for nfsd to communicate with file systems
1199 * @decode_fh: decode a file handle fragment and return a &struct dentry
1200 * @encode_fh: encode a file handle fragment from a dentry
1203 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
1209 * with a particular exported file system - particularly enabling nfsd and
1210 * the filesystem to co-operate when dealing with file handles.
1212 * export_operations contains two basic operation for dealing with file
1218 * applies to in the initial part of the file handle. The remainder, termed
1219 * a file handle fragment, is controlled completely by the filesystem. The
1221 * two sub-fragments, one which identifies the file, and one which may be
1222 * used to identify the (a) directory containing the file.
1225 * specific part of the file tree. To allow for this, it passes the
1228 * given file, the filesystem should check each one for acceptability before
1233 * @decode_fh is given a &struct super_block (@sb), a file handle fragment
1236 * file that the file handle fragment refers to, and which passes the
1238 * the file was found but no acceptable &dentries were available, or a
1243 * @encode_fh should store in the file handle fragment @fh (using at most
1245 * file refered to by the &struct dentry @de. If the @connectable flag is
1247 * attempt can be made to find not only the file but also it's place in the
1265 * Given a &super_block (@sb) and a pointer to a file-system specific inode
1380 extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
1396 extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1399 struct file *filp,
1422 struct file *filp);
1425 extern struct file *filp_open(const char *, int, int);
1426 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
1427 extern int filp_close(struct file *, fl_owner_t id);
1456 extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1457 extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
1479 extern int chrdev_open(struct inode *, struct file *);
1542 extern long do_fsync(struct file *file, int datasync);
1556 extern int deny_write_access(struct file *);
1561 static inline void allow_write_access(struct file *file)
1563 if (file)
1564 atomic_inc(&file->f_dentry->d_inode->i_writecount);
1571 extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
1572 extern struct file * open_exec(const char *);
1580 /* needed for stackable file system support */
1581 extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
1583 extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
1629 extern struct file * get_empty_filp(void);
1630 extern void file_move(struct file *f, struct list_head *list);
1631 extern void file_kill(struct file *f);
1639 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
1640 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
1643 extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *);
1644 int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
1645 extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *);
1655 extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
1656 extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
1657 ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
1659 extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
1661 struct file_ra_state *, struct file *,
1665 extern ssize_t generic_file_splice_read(struct file *, loff_t *,
1668 struct file *, loff_t *, size_t, unsigned int);
1670 struct file *out, loff_t *, size_t len, unsigned int flags);
1671 extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
1676 extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
1678 ssize_t generic_file_writev(struct file *filp, const struct iovec *iov,
1680 extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
1681 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
1682 extern loff_t remote_llseek(struct file *file, loff_t offset, int origin);
1683 extern int generic_file_open(struct inode * inode, struct file * filp);
1684 extern int nonseekable_open(struct inode * inode, struct file * filp);
1687 extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len,
1689 extern ssize_t xip_file_sendfile(struct file *in_file, loff_t *ppos,
1692 extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma);
1693 extern ssize_t xip_file_write(struct file *filp, const char __user *buf,
1703 static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1774 extern int vfs_readdir(struct file *, filldir_t, void *);
1782 extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long);
1789 extern int dcache_dir_open(struct inode *, struct file *);
1790 extern int dcache_dir_close(struct inode *, struct file *);
1791 extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
1792 extern int dcache_readdir(struct file *, void *, filldir_t);
1799 extern int simple_sync_file(struct file *, struct dentry *, int);
1801 extern int simple_readpage(struct file *file, struct page *page);
1802 extern int simple_prepare_write(struct file *file, struct page *page,
1804 extern int simple_commit_write(struct file *file, struct page *page,
1808 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1829 extern void file_update_time(struct file *file);
1857 char *simple_transaction_get(struct file *file, const char __user *buf,
1859 ssize_t simple_transaction_read(struct file *file, char __user *buf,
1861 int simple_transaction_release(struct inode *inode, struct file *file);
1863 static inline void simple_transaction_set(struct file *file, size_t n)
1865 struct simple_transaction_argresp *ar = file->private_data;
1882 * Writing to an attribute immediately sets a value, an open file can be
1887 * completely, no further read calls are possible until the file is opened
1894 static int __fops ## _open(struct inode *inode, struct file *file) \
1897 return simple_attr_open(inode, file, __get, __set, __fmt); \
1913 int simple_attr_open(struct inode *inode, struct file *file,
1916 int simple_attr_close(struct inode *inode, struct file *file);
1917 ssize_t simple_attr_read(struct file *file, char __user *buf,
1919 ssize_t simple_attr_write(struct file *file, const char __user *buf,