aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_super.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-02-28 06:34:00 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 10:57:38 -0400
commit00ea2df43e0a68a90bb6055cc48965b2c970228d (patch)
tree32108151c33c156f9541e97fa3b84e33dae6e92b /fs/9p/vfs_super.c
parentc0aa4caf4c8b87fa85c67538974a14b07e81a23f (diff)
fs/9p: Implement syncfs call back for 9Pfs
FIXME!! what about dotu ? 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/vfs_super.c')
-rw-r--r--fs/9p/vfs_super.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 76f867cf23f8..6985e2a7a118 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -152,7 +152,6 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
152 retval = PTR_ERR(inode); 152 retval = PTR_ERR(inode);
153 goto release_sb; 153 goto release_sb;
154 } 154 }
155
156 root = d_alloc_root(inode); 155 root = d_alloc_root(inode);
157 if (!root) { 156 if (!root) {
158 iput(inode); 157 iput(inode);
@@ -184,10 +183,21 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
184 p9stat_free(st); 183 p9stat_free(st);
185 kfree(st); 184 kfree(st);
186 } 185 }
186 v9fs_fid_add(root, fid);
187 retval = v9fs_get_acl(inode, fid); 187 retval = v9fs_get_acl(inode, fid);
188 if (retval) 188 if (retval)
189 goto release_sb; 189 goto release_sb;
190 v9fs_fid_add(root, fid); 190 /*
191 * Add the root fid to session info. This is used
192 * for file system sync. We want a cloned fid here
193 * so that we can do a sync_filesystem after a
194 * shrink_dcache_for_umount
195 */
196 v9ses->root_fid = v9fs_fid_clone(root);
197 if (IS_ERR(v9ses->root_fid)) {
198 retval = PTR_ERR(v9ses->root_fid);
199 goto release_sb;
200 }
191 201
192 P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n"); 202 P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
193 return dget(sb->s_root); 203 return dget(sb->s_root);
@@ -198,15 +208,11 @@ close_session:
198 v9fs_session_close(v9ses); 208 v9fs_session_close(v9ses);
199 kfree(v9ses); 209 kfree(v9ses);
200 return ERR_PTR(retval); 210 return ERR_PTR(retval);
201
202release_sb: 211release_sb:
203 /* 212 /*
204 * we will do the session_close and root dentry release 213 * we will do the session_close and root dentry
205 * in the below call. But we need to clunk fid, because we haven't 214 * release in the below call.
206 * attached the fid to dentry so it won't get clunked
207 * automatically.
208 */ 215 */
209 p9_client_clunk(fid);
210 deactivate_locked_super(sb); 216 deactivate_locked_super(sb);
211 return ERR_PTR(retval); 217 return ERR_PTR(retval);
212} 218}
@@ -224,7 +230,7 @@ static void v9fs_kill_super(struct super_block *s)
224 P9_DPRINTK(P9_DEBUG_VFS, " %p\n", s); 230 P9_DPRINTK(P9_DEBUG_VFS, " %p\n", s);
225 231
226 kill_anon_super(s); 232 kill_anon_super(s);
227 233 p9_client_clunk(v9ses->root_fid);
228 v9fs_session_cancel(v9ses); 234 v9fs_session_cancel(v9ses);
229 v9fs_session_close(v9ses); 235 v9fs_session_close(v9ses);
230 kfree(v9ses); 236 kfree(v9ses);
@@ -277,6 +283,14 @@ done:
277 return res; 283 return res;
278} 284}
279 285
286static int v9fs_sync_fs(struct super_block *sb, int wait)
287{
288 struct v9fs_session_info *v9ses = sb->s_fs_info;
289
290 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_sync_fs: super_block %p\n", sb);
291 return p9_client_sync_fs(v9ses->root_fid);
292}
293
280static const struct super_operations v9fs_super_ops = { 294static const struct super_operations v9fs_super_ops = {
281#ifdef CONFIG_9P_FSCACHE 295#ifdef CONFIG_9P_FSCACHE
282 .alloc_inode = v9fs_alloc_inode, 296 .alloc_inode = v9fs_alloc_inode,
@@ -293,6 +307,7 @@ static const struct super_operations v9fs_super_ops_dotl = {
293 .alloc_inode = v9fs_alloc_inode, 307 .alloc_inode = v9fs_alloc_inode,
294 .destroy_inode = v9fs_destroy_inode, 308 .destroy_inode = v9fs_destroy_inode,
295#endif 309#endif
310 .sync_fs = v9fs_sync_fs,
296 .statfs = v9fs_statfs, 311 .statfs = v9fs_statfs,
297 .evict_inode = v9fs_evict_inode, 312 .evict_inode = v9fs_evict_inode,
298 .show_options = generic_show_options, 313 .show_options = generic_show_options,