diff options
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 70 | 
1 files changed, 49 insertions, 21 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 038076b27ea..8fabb037a48 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -173,6 +173,15 @@ struct inodes_stat_t {  #define WRITE_FUA		(WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)  #define WRITE_FLUSH_FUA		(WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) + +/* + * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector + * that indicates that they should check the contents of the iovec are + * valid, but not check the memory that the iovec elements + * points too. + */ +#define CHECK_IOVEC_ONLY -1 +  #define SEL_IN		1  #define SEL_OUT		2  #define SEL_EX		4 @@ -793,13 +802,14 @@ struct inode {  		unsigned int __i_nlink;  	};  	dev_t			i_rdev; +	loff_t			i_size;  	struct timespec		i_atime;  	struct timespec		i_mtime;  	struct timespec		i_ctime;  	spinlock_t		i_lock;	/* i_blocks, i_bytes, maybe i_size */  	unsigned short          i_bytes; +	unsigned int		i_blkbits;  	blkcnt_t		i_blocks; -	loff_t			i_size;  #ifdef __NEED_I_SIZE_ORDERED  	seqcount_t		i_size_seqcount; @@ -816,12 +826,11 @@ struct inode {  	struct list_head	i_lru;		/* inode LRU list */  	struct list_head	i_sb_list;  	union { -		struct list_head	i_dentry; +		struct hlist_head	i_dentry;  		struct rcu_head		i_rcu;  	}; -	atomic_t		i_count; -	unsigned int		i_blkbits;  	u64			i_version; +	atomic_t		i_count;  	atomic_t		i_dio_count;  	atomic_t		i_writecount;  	const struct file_operations	*i_fop;	/* former ->i_op->default_file_ops */ @@ -1562,7 +1571,7 @@ extern void unlock_super(struct super_block *);  /*   * VFS helper functions..   */ -extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); +extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);  extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);  extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);  extern int vfs_symlink(struct inode *, struct dentry *, const char *); @@ -1657,7 +1666,7 @@ struct file_operations {  };  struct inode_operations { -	struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); +	struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);  	void * (*follow_link) (struct dentry *, struct nameidata *);  	int (*permission) (struct inode *, int);  	struct posix_acl * (*get_acl)(struct inode *, int); @@ -1665,7 +1674,7 @@ struct inode_operations {  	int (*readlink) (struct dentry *, char __user *,int);  	void (*put_link) (struct dentry *, struct nameidata *, void *); -	int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *); +	int (*create) (struct inode *,struct dentry *, umode_t, bool);  	int (*link) (struct dentry *,struct inode *,struct dentry *);  	int (*unlink) (struct inode *,struct dentry *);  	int (*symlink) (struct inode *,struct dentry *,const char *); @@ -1683,6 +1692,10 @@ struct inode_operations {  	int (*removexattr) (struct dentry *, const char *);  	int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,  		      u64 len); +	int (*update_time)(struct inode *, struct timespec *, int); +	int (*atomic_open)(struct inode *, struct dentry *, +			   struct file *, unsigned open_flag, +			   umode_t create_mode, int *opened);  } ____cacheline_aligned;  struct seq_file; @@ -1690,8 +1703,7 @@ struct seq_file;  ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,  			      unsigned long nr_segs, unsigned long fast_segs,  			      struct iovec *fast_pointer, -			      struct iovec **ret_pointer, -			      int check_access); +			      struct iovec **ret_pointer);  extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);  extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); @@ -1842,6 +1854,13 @@ static inline void inode_inc_iversion(struct inode *inode)         spin_unlock(&inode->i_lock);  } +enum file_time_flags { +	S_ATIME = 1, +	S_MTIME = 2, +	S_CTIME = 4, +	S_VERSION = 8, +}; +  extern void touch_atime(struct path *);  static inline void file_accessed(struct file *file)  { @@ -1895,7 +1914,7 @@ void free_anon_bdev(dev_t);  struct super_block *sget(struct file_system_type *type,  			int (*test)(struct super_block *,void *),  			int (*set)(struct super_block *,void *), -			void *data); +			int flags, void *data);  extern struct dentry *mount_pseudo(struct file_system_type *, char *,  	const struct super_operations *ops,  	const struct dentry_operations *dops, @@ -2041,10 +2060,17 @@ extern long do_sys_open(int dfd, const char __user *filename, int flags,  extern struct file *filp_open(const char *, int, umode_t);  extern struct file *file_open_root(struct dentry *, struct vfsmount *,  				   const char *, int); -extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, -				 const struct cred *); +extern struct file * dentry_open(const struct path *, int, const struct cred *);  extern int filp_close(struct file *, fl_owner_t id);  extern char * getname(const char __user *); +enum { +	FILE_CREATED = 1, +	FILE_OPENED = 2 +}; +extern int finish_open(struct file *file, struct dentry *dentry, +			int (*open)(struct inode *, struct file *), +			int *opened); +extern int finish_no_open(struct file *file, struct dentry *dentry);  /* fs/ioctl.c */ @@ -2075,6 +2101,7 @@ extern sector_t blkdev_max_block(struct block_device *bdev);  extern void bd_forget(struct inode *inode);  extern void bdput(struct block_device *);  extern void invalidate_bdev(struct block_device *); +extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);  extern int sync_blockdev(struct block_device *bdev);  extern void kill_bdev(struct block_device *);  extern struct super_block *freeze_bdev(struct block_device *); @@ -2096,6 +2123,10 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)  {  	return 0;  } + +static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) +{ +}  #endif  extern int sync_filesystem(struct super_block *);  extern const struct file_operations def_blk_fops; @@ -2422,7 +2453,7 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);  extern loff_t no_llseek(struct file *file, loff_t offset, int origin);  extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);  extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, -		int origin, loff_t maxsize); +		int origin, loff_t maxsize, loff_t eof);  extern int generic_file_open(struct inode * inode, struct file * filp);  extern int nonseekable_open(struct inode * inode, struct file * filp); @@ -2453,8 +2484,6 @@ enum {  };  void dio_end_io(struct bio *bio, int error); -void inode_dio_wait(struct inode *inode); -void inode_dio_done(struct inode *inode);  ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,  	struct block_device *bdev, const struct iovec *iov, loff_t offset, @@ -2469,12 +2498,11 @@ static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,  				    offset, nr_segs, get_block, NULL, NULL,  				    DIO_LOCKING | DIO_SKIP_HOLES);  } -#else -static inline void inode_dio_wait(struct inode *inode) -{ -}  #endif +void inode_dio_wait(struct inode *inode); +void inode_dio_done(struct inode *inode); +  extern const struct file_operations generic_ro_fops;  #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) @@ -2547,7 +2575,7 @@ extern int simple_write_end(struct file *file, struct address_space *mapping,  			loff_t pos, unsigned len, unsigned copied,  			struct page *page, void *fsdata); -extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); +extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);  extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);  extern const struct file_operations simple_dir_operations;  extern const struct inode_operations simple_dir_inode_operations; @@ -2578,7 +2606,7 @@ extern int inode_change_ok(const struct inode *, struct iattr *);  extern int inode_newsize_ok(const struct inode *, loff_t offset);  extern void setattr_copy(struct inode *inode, const struct iattr *attr); -extern void file_update_time(struct file *file); +extern int file_update_time(struct file *file);  extern int generic_show_options(struct seq_file *m, struct dentry *root);  extern void save_mount_options(struct super_block *sb, char *options);  |