aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-02-28 06:34:03 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 10:57:39 -0400
commit6b39f6d22fbf67cf795c105b4d67c64e9c352ca4 (patch)
tree0d0926901486e334feb5422ee2b0e56b45e9a970 /fs/9p/vfs_inode.c
parenta78ce05d5d342297b66122eda8add4eefa21f8a8 (diff)
fs/9p: Move writeback fid to v9fs_inode
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_inode.c')
-rw-r--r--fs/9p/vfs_inode.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 411c70a88b36..fdc086d07447 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -219,6 +219,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb)
219 v9inode->fscache_key = NULL; 219 v9inode->fscache_key = NULL;
220 spin_lock_init(&v9inode->fscache_lock); 220 spin_lock_init(&v9inode->fscache_lock);
221#endif 221#endif
222 v9inode->writeback_fid = NULL;
222 return &v9inode->vfs_inode; 223 return &v9inode->vfs_inode;
223} 224}
224 225
@@ -414,6 +415,8 @@ error:
414 */ 415 */
415void v9fs_evict_inode(struct inode *inode) 416void v9fs_evict_inode(struct inode *inode)
416{ 417{
418 struct v9fs_inode *v9inode = V9FS_I(inode);
419
417 truncate_inode_pages(inode->i_mapping, 0); 420 truncate_inode_pages(inode->i_mapping, 0);
418 end_writeback(inode); 421 end_writeback(inode);
419 filemap_fdatawrite(inode->i_mapping); 422 filemap_fdatawrite(inode->i_mapping);
@@ -421,10 +424,10 @@ void v9fs_evict_inode(struct inode *inode)
421#ifdef CONFIG_9P_FSCACHE 424#ifdef CONFIG_9P_FSCACHE
422 v9fs_cache_inode_put_cookie(inode); 425 v9fs_cache_inode_put_cookie(inode);
423#endif 426#endif
424 /* clunk the fid stashed in inode->i_private */ 427 /* clunk the fid stashed in writeback_fid */
425 if (inode->i_private) { 428 if (v9inode->writeback_fid) {
426 p9_client_clunk((struct p9_fid *)inode->i_private); 429 p9_client_clunk(v9inode->writeback_fid);
427 inode->i_private = NULL; 430 v9inode->writeback_fid = NULL;
428 } 431 }
429} 432}
430 433
@@ -607,9 +610,10 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode,
607 int err; 610 int err;
608 u32 perm; 611 u32 perm;
609 int flags; 612 int flags;
613 struct file *filp;
614 struct v9fs_inode *v9inode;
610 struct v9fs_session_info *v9ses; 615 struct v9fs_session_info *v9ses;
611 struct p9_fid *fid, *inode_fid; 616 struct p9_fid *fid, *inode_fid;
612 struct file *filp;
613 617
614 err = 0; 618 err = 0;
615 fid = NULL; 619 fid = NULL;
@@ -631,9 +635,10 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode,
631 635
632 /* if we are opening a file, assign the open fid to the file */ 636 /* if we are opening a file, assign the open fid to the file */
633 if (nd && nd->flags & LOOKUP_OPEN) { 637 if (nd && nd->flags & LOOKUP_OPEN) {
634 if (v9ses->cache && !dentry->d_inode->i_private) { 638 v9inode = V9FS_I(dentry->d_inode);
639 if (v9ses->cache && !v9inode->writeback_fid) {
635 /* 640 /*
636 * clone a fid and add it to inode->i_private 641 * clone a fid and add it to writeback_fid
637 * we do it during open time instead of 642 * we do it during open time instead of
638 * page dirty time via write_begin/page_mkwrite 643 * page dirty time via write_begin/page_mkwrite
639 * because we want write after unlink usecase 644 * because we want write after unlink usecase
@@ -644,7 +649,7 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode,
644 err = PTR_ERR(inode_fid); 649 err = PTR_ERR(inode_fid);
645 goto error; 650 goto error;
646 } 651 }
647 dentry->d_inode->i_private = (void *) inode_fid; 652 v9inode->writeback_fid = (void *) inode_fid;
648 } 653 }
649 filp = lookup_instantiate_filp(nd, dentry, generic_file_open); 654 filp = lookup_instantiate_filp(nd, dentry, generic_file_open);
650 if (IS_ERR(filp)) { 655 if (IS_ERR(filp)) {