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:08 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 10:57:41 -0400
commitd28c61f0e08aab9e3a2d3430e75f97937c5fe5fd (patch)
tree2a75e52772d832e4b9203fdc7500ecf8a05c5b43 /fs/9p/vfs_inode.c
parent823fcfd42297acaf28892b3d2aabef2a121449c2 (diff)
fs/9p: Mark directory inode invalid for many directory inode operations
One successfull directory operation we would have changed directory inode attribute. So mark them invalid 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.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 3e3ffe3ad1a0..c072bb97e957 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -499,8 +499,8 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid,
499static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir) 499static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir)
500{ 500{
501 int retval; 501 int retval;
502 struct inode *file_inode;
503 struct p9_fid *v9fid; 502 struct p9_fid *v9fid;
503 struct inode *file_inode;
504 504
505 P9_DPRINTK(P9_DEBUG_VFS, "inode: %p dentry: %p rmdir: %d\n", dir, file, 505 P9_DPRINTK(P9_DEBUG_VFS, "inode: %p dentry: %p rmdir: %d\n", dir, file,
506 rmdir); 506 rmdir);
@@ -521,7 +521,9 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir)
521 drop_nlink(dir); 521 drop_nlink(dir);
522 } else 522 } else
523 drop_nlink(file_inode); 523 drop_nlink(file_inode);
524
524 v9fs_invalidate_inode_attr(file_inode); 525 v9fs_invalidate_inode_attr(file_inode);
526 v9fs_invalidate_inode_attr(dir);
525 } 527 }
526 return retval; 528 return retval;
527} 529}
@@ -644,6 +646,7 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode,
644 goto error; 646 goto error;
645 } 647 }
646 648
649 v9fs_invalidate_inode_attr(dir);
647 /* if we are opening a file, assign the open fid to the file */ 650 /* if we are opening a file, assign the open fid to the file */
648 if (nd && nd->flags & LOOKUP_OPEN) { 651 if (nd && nd->flags & LOOKUP_OPEN) {
649 v9inode = V9FS_I(dentry->d_inode); 652 v9inode = V9FS_I(dentry->d_inode);
@@ -697,8 +700,8 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
697{ 700{
698 int err; 701 int err;
699 u32 perm; 702 u32 perm;
700 struct v9fs_session_info *v9ses;
701 struct p9_fid *fid; 703 struct p9_fid *fid;
704 struct v9fs_session_info *v9ses;
702 705
703 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name); 706 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
704 err = 0; 707 err = 0;
@@ -708,8 +711,10 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
708 if (IS_ERR(fid)) { 711 if (IS_ERR(fid)) {
709 err = PTR_ERR(fid); 712 err = PTR_ERR(fid);
710 fid = NULL; 713 fid = NULL;
711 } else 714 } else {
712 inc_nlink(dir); 715 inc_nlink(dir);
716 v9fs_invalidate_inode_attr(dir);
717 }
713 718
714 if (fid) 719 if (fid)
715 p9_client_clunk(fid); 720 p9_client_clunk(fid);
@@ -820,6 +825,7 @@ int
820v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry, 825v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
821 struct inode *new_dir, struct dentry *new_dentry) 826 struct inode *new_dir, struct dentry *new_dentry)
822{ 827{
828 int retval;
823 struct inode *old_inode; 829 struct inode *old_inode;
824 struct inode *new_inode; 830 struct inode *new_inode;
825 struct v9fs_session_info *v9ses; 831 struct v9fs_session_info *v9ses;
@@ -827,7 +833,6 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
827 struct p9_fid *olddirfid; 833 struct p9_fid *olddirfid;
828 struct p9_fid *newdirfid; 834 struct p9_fid *newdirfid;
829 struct p9_wstat wstat; 835 struct p9_wstat wstat;
830 int retval;
831 836
832 P9_DPRINTK(P9_DEBUG_VFS, "\n"); 837 P9_DPRINTK(P9_DEBUG_VFS, "\n");
833 retval = 0; 838 retval = 0;
@@ -886,6 +891,8 @@ clunk_newdir:
886 drop_nlink(old_dir); 891 drop_nlink(old_dir);
887 } 892 }
888 v9fs_invalidate_inode_attr(old_inode); 893 v9fs_invalidate_inode_attr(old_inode);
894 v9fs_invalidate_inode_attr(old_dir);
895 v9fs_invalidate_inode_attr(new_dir);
889 896
890 /* successful rename */ 897 /* successful rename */
891 d_move(old_dentry, new_dentry); 898 d_move(old_dentry, new_dentry);
@@ -1208,8 +1215,8 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
1208 int mode, const char *extension) 1215 int mode, const char *extension)
1209{ 1216{
1210 u32 perm; 1217 u32 perm;
1211 struct v9fs_session_info *v9ses;
1212 struct p9_fid *fid; 1218 struct p9_fid *fid;
1219 struct v9fs_session_info *v9ses;
1213 1220
1214 v9ses = v9fs_inode2v9ses(dir); 1221 v9ses = v9fs_inode2v9ses(dir);
1215 if (!v9fs_proto_dotu(v9ses)) { 1222 if (!v9fs_proto_dotu(v9ses)) {
@@ -1223,6 +1230,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
1223 if (IS_ERR(fid)) 1230 if (IS_ERR(fid))
1224 return PTR_ERR(fid); 1231 return PTR_ERR(fid);
1225 1232
1233 v9fs_invalidate_inode_attr(dir);
1226 p9_client_clunk(fid); 1234 p9_client_clunk(fid);
1227 return 0; 1235 return 0;
1228} 1236}
@@ -1259,8 +1267,8 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir,
1259 struct dentry *dentry) 1267 struct dentry *dentry)
1260{ 1268{
1261 int retval; 1269 int retval;
1262 struct p9_fid *oldfid;
1263 char *name; 1270 char *name;
1271 struct p9_fid *oldfid;
1264 1272
1265 P9_DPRINTK(P9_DEBUG_VFS, 1273 P9_DPRINTK(P9_DEBUG_VFS,
1266 " %lu,%s,%s\n", dir->i_ino, dentry->d_name.name, 1274 " %lu,%s,%s\n", dir->i_ino, dentry->d_name.name,
@@ -1279,7 +1287,8 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir,
1279 sprintf(name, "%d\n", oldfid->fid); 1287 sprintf(name, "%d\n", oldfid->fid);
1280 retval = v9fs_vfs_mkspecial(dir, dentry, P9_DMLINK, name); 1288 retval = v9fs_vfs_mkspecial(dir, dentry, P9_DMLINK, name);
1281 __putname(name); 1289 __putname(name);
1282 1290 if (!retval)
1291 v9fs_invalidate_inode_attr(dir);
1283clunk_fid: 1292clunk_fid:
1284 p9_client_clunk(oldfid); 1293 p9_client_clunk(oldfid);
1285 return retval; 1294 return retval;