0001
0002
0003
0004
0005
0006
0007
0008 #ifndef FS_9P_V9FS_VFS_H
0009 #define FS_9P_V9FS_VFS_H
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #define P9_LOCK_TIMEOUT (30*HZ)
0027
0028
0029 #define V9FS_STAT2INODE_KEEP_ISIZE 1
0030
0031 extern struct file_system_type v9fs_fs_type;
0032 extern const struct address_space_operations v9fs_addr_operations;
0033 extern const struct file_operations v9fs_file_operations;
0034 extern const struct file_operations v9fs_file_operations_dotl;
0035 extern const struct file_operations v9fs_dir_operations;
0036 extern const struct file_operations v9fs_dir_operations_dotl;
0037 extern const struct dentry_operations v9fs_dentry_operations;
0038 extern const struct dentry_operations v9fs_cached_dentry_operations;
0039 extern const struct file_operations v9fs_cached_file_operations;
0040 extern const struct file_operations v9fs_cached_file_operations_dotl;
0041 extern const struct file_operations v9fs_mmap_file_operations;
0042 extern const struct file_operations v9fs_mmap_file_operations_dotl;
0043 extern struct kmem_cache *v9fs_inode_cache;
0044
0045 struct inode *v9fs_alloc_inode(struct super_block *sb);
0046 void v9fs_free_inode(struct inode *inode);
0047 struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode,
0048 dev_t rdev);
0049 int v9fs_init_inode(struct v9fs_session_info *v9ses,
0050 struct inode *inode, umode_t mode, dev_t rdev);
0051 void v9fs_evict_inode(struct inode *inode);
0052 ino_t v9fs_qid2ino(struct p9_qid *qid);
0053 void v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
0054 struct super_block *sb, unsigned int flags);
0055 void v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode,
0056 unsigned int flags);
0057 int v9fs_dir_release(struct inode *inode, struct file *filp);
0058 int v9fs_file_open(struct inode *inode, struct file *file);
0059 void v9fs_inode2stat(struct inode *inode, struct p9_wstat *stat);
0060 int v9fs_uflags2omode(int uflags, int extended);
0061
0062 void v9fs_blank_wstat(struct p9_wstat *wstat);
0063 int v9fs_vfs_setattr_dotl(struct user_namespace *mnt_userns,
0064 struct dentry *dentry, struct iattr *iattr);
0065 int v9fs_file_fsync_dotl(struct file *filp, loff_t start, loff_t end,
0066 int datasync);
0067 int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode);
0068 int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode);
0069 static inline void v9fs_invalidate_inode_attr(struct inode *inode)
0070 {
0071 struct v9fs_inode *v9inode;
0072
0073 v9inode = V9FS_I(inode);
0074 v9inode->cache_validity |= V9FS_INO_INVALID_ATTR;
0075 }
0076
0077 int v9fs_open_to_dotl_flags(int flags);
0078
0079 static inline void v9fs_i_size_write(struct inode *inode, loff_t i_size)
0080 {
0081
0082
0083
0084
0085
0086 if (sizeof(i_size) > sizeof(long))
0087 spin_lock(&inode->i_lock);
0088 i_size_write(inode, i_size);
0089 if (sizeof(i_size) > sizeof(long))
0090 spin_unlock(&inode->i_lock);
0091 }
0092 #endif