aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/v9fs.h
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-02-28 06:34:02 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 10:57:39 -0400
commita78ce05d5d342297b66122eda8add4eefa21f8a8 (patch)
tree84b9b4009ba0279ffbbc79382bbdbc6f168f23d8 /fs/9p/v9fs.h
parenta12119087bd803d3fa0b067ee18497e2e5d064cd (diff)
fs/9p: Add v9fs_inode
Switch to the fscache code to v9fs_inode. We will later use v9fs_inode in cache=loose mode to track the inode cache validity timeout. Ie if we find an inode in cache older that a specific jiffie range we will consider it stale Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/v9fs.h')
-rw-r--r--fs/9p/v9fs.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h
index 21bd803a3cc0..ce59d1512062 100644
--- a/fs/9p/v9fs.h
+++ b/fs/9p/v9fs.h
@@ -116,6 +116,20 @@ struct v9fs_session_info {
116 struct p9_fid *root_fid; /* Used for file system sync */ 116 struct p9_fid *root_fid; /* Used for file system sync */
117}; 117};
118 118
119struct v9fs_inode {
120#ifdef CONFIG_9P_FSCACHE
121 spinlock_t fscache_lock;
122 struct fscache_cookie *fscache;
123 struct p9_qid *fscache_key;
124#endif
125 struct inode vfs_inode;
126};
127
128static inline struct v9fs_inode *V9FS_I(const struct inode *inode)
129{
130 return container_of(inode, struct v9fs_inode, vfs_inode);
131}
132
119struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *, 133struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *,
120 char *); 134 char *);
121extern void v9fs_session_close(struct v9fs_session_info *v9ses); 135extern void v9fs_session_close(struct v9fs_session_info *v9ses);
@@ -129,16 +143,15 @@ extern int v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
129 struct inode *new_dir, struct dentry *new_dentry); 143 struct inode *new_dir, struct dentry *new_dentry);
130extern void v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd, 144extern void v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd,
131 void *p); 145 void *p);
132extern struct inode *v9fs_inode(struct v9fs_session_info *v9ses, 146extern struct inode *v9fs_inode_from_fid(struct v9fs_session_info *v9ses,
133 struct p9_fid *fid, 147 struct p9_fid *fid,
134 struct super_block *sb); 148 struct super_block *sb);
135
136extern const struct inode_operations v9fs_dir_inode_operations_dotl; 149extern const struct inode_operations v9fs_dir_inode_operations_dotl;
137extern const struct inode_operations v9fs_file_inode_operations_dotl; 150extern const struct inode_operations v9fs_file_inode_operations_dotl;
138extern const struct inode_operations v9fs_symlink_inode_operations_dotl; 151extern const struct inode_operations v9fs_symlink_inode_operations_dotl;
139extern struct inode *v9fs_inode_dotl(struct v9fs_session_info *v9ses, 152extern struct inode *v9fs_inode_from_fid_dotl(struct v9fs_session_info *v9ses,
140 struct p9_fid *fid, 153 struct p9_fid *fid,
141 struct super_block *sb); 154 struct super_block *sb);
142 155
143/* other default globals */ 156/* other default globals */
144#define V9FS_PORT 564 157#define V9FS_PORT 564
@@ -163,7 +176,7 @@ static inline int v9fs_proto_dotl(struct v9fs_session_info *v9ses)
163} 176}
164 177
165/** 178/**
166 * v9fs_inode_from_fid - Helper routine to populate an inode by 179 * v9fs_get_inode_from_fid - Helper routine to populate an inode by
167 * issuing a attribute request 180 * issuing a attribute request
168 * @v9ses: session information 181 * @v9ses: session information
169 * @fid: fid to issue attribute request for 182 * @fid: fid to issue attribute request for
@@ -171,11 +184,11 @@ static inline int v9fs_proto_dotl(struct v9fs_session_info *v9ses)
171 * 184 *
172 */ 185 */
173static inline struct inode * 186static inline struct inode *
174v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid, 187v9fs_get_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid,
175 struct super_block *sb) 188 struct super_block *sb)
176{ 189{
177 if (v9fs_proto_dotl(v9ses)) 190 if (v9fs_proto_dotl(v9ses))
178 return v9fs_inode_dotl(v9ses, fid, sb); 191 return v9fs_inode_from_fid_dotl(v9ses, fid, sb);
179 else 192 else
180 return v9fs_inode(v9ses, fid, sb); 193 return v9fs_inode_from_fid(v9ses, fid, sb);
181} 194}