aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-02-28 01:18:14 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-28 01:18:14 -0500
commit2ea03e1d62d56c37737e43550c360b43a5e40a32 (patch)
treea95494fbf887da9450e4b3feaac18b0f60f838cc
parentaaeb7ecfb48ad4c8942a26874322d8918524a04f (diff)
9p: v9fs_fid_add() can't fail now
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/9p/fid.c3
-rw-r--r--fs/9p/fid.h2
-rw-r--r--fs/9p/vfs_inode.c9
-rw-r--r--fs/9p/vfs_inode_dotl.c19
4 files changed, 11 insertions, 22 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index ddf618936d8a..73ca55042cb0 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -41,12 +41,11 @@
41 * 41 *
42 */ 42 */
43 43
44int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid) 44void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
45{ 45{
46 spin_lock(&dentry->d_lock); 46 spin_lock(&dentry->d_lock);
47 hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata); 47 hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata);
48 spin_unlock(&dentry->d_lock); 48 spin_unlock(&dentry->d_lock);
49 return 0;
50} 49}
51 50
52/** 51/**
diff --git a/fs/9p/fid.h b/fs/9p/fid.h
index 377eb6f2e7f7..2b6787fcb626 100644
--- a/fs/9p/fid.h
+++ b/fs/9p/fid.h
@@ -25,6 +25,6 @@
25 25
26struct p9_fid *v9fs_fid_lookup(struct dentry *dentry); 26struct p9_fid *v9fs_fid_lookup(struct dentry *dentry);
27struct p9_fid *v9fs_fid_clone(struct dentry *dentry); 27struct p9_fid *v9fs_fid_clone(struct dentry *dentry);
28int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid); 28void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid);
29struct p9_fid *v9fs_writeback_fid(struct dentry *dentry); 29struct p9_fid *v9fs_writeback_fid(struct dentry *dentry);
30#endif 30#endif
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index b5340c829de1..ce601d71a427 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -692,9 +692,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
692 "inode creation failed %d\n", err); 692 "inode creation failed %d\n", err);
693 goto error; 693 goto error;
694 } 694 }
695 err = v9fs_fid_add(dentry, fid); 695 v9fs_fid_add(dentry, fid);
696 if (err < 0)
697 goto error;
698 d_instantiate(dentry, inode); 696 d_instantiate(dentry, inode);
699 } 697 }
700 return ofid; 698 return ofid;
@@ -830,9 +828,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
830 inode = NULL; 828 inode = NULL;
831 goto error; 829 goto error;
832 } 830 }
833 result = v9fs_fid_add(dentry, fid); 831 v9fs_fid_add(dentry, fid);
834 if (result < 0)
835 goto error_iput;
836inst_out: 832inst_out:
837 /* 833 /*
838 * If we had a rename on the server and a parallel lookup 834 * If we had a rename on the server and a parallel lookup
@@ -845,7 +841,6 @@ inst_out:
845 if (!IS_ERR(res)) 841 if (!IS_ERR(res))
846 return res; 842 return res;
847 result = PTR_ERR(res); 843 result = PTR_ERR(res);
848error_iput:
849 iput(inode); 844 iput(inode);
850error: 845error:
851 p9_client_clunk(fid); 846 p9_client_clunk(fid);
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 61e4fa70a6fa..53687bbf2296 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -333,9 +333,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
333 /* Now set the ACL based on the default value */ 333 /* Now set the ACL based on the default value */
334 v9fs_set_create_acl(inode, fid, dacl, pacl); 334 v9fs_set_create_acl(inode, fid, dacl, pacl);
335 335
336 err = v9fs_fid_add(dentry, fid); 336 v9fs_fid_add(dentry, fid);
337 if (err < 0)
338 goto error;
339 d_instantiate(dentry, inode); 337 d_instantiate(dentry, inode);
340 338
341 v9inode = V9FS_I(inode); 339 v9inode = V9FS_I(inode);
@@ -453,12 +451,11 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
453 err); 451 err);
454 goto error; 452 goto error;
455 } 453 }
456 err = v9fs_fid_add(dentry, fid); 454 v9fs_fid_add(dentry, fid);
457 if (err < 0)
458 goto error;
459 v9fs_set_create_acl(inode, fid, dacl, pacl); 455 v9fs_set_create_acl(inode, fid, dacl, pacl);
460 d_instantiate(dentry, inode); 456 d_instantiate(dentry, inode);
461 fid = NULL; 457 fid = NULL;
458 err = 0;
462 } else { 459 } else {
463 /* 460 /*
464 * Not in cached mode. No need to populate 461 * Not in cached mode. No need to populate
@@ -747,11 +744,10 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
747 err); 744 err);
748 goto error; 745 goto error;
749 } 746 }
750 err = v9fs_fid_add(dentry, fid); 747 v9fs_fid_add(dentry, fid);
751 if (err < 0)
752 goto error;
753 d_instantiate(dentry, inode); 748 d_instantiate(dentry, inode);
754 fid = NULL; 749 fid = NULL;
750 err = 0;
755 } else { 751 } else {
756 /* Not in cached mode. No need to populate inode with stat */ 752 /* Not in cached mode. No need to populate inode with stat */
757 inode = v9fs_get_inode(dir->i_sb, S_IFLNK, 0); 753 inode = v9fs_get_inode(dir->i_sb, S_IFLNK, 0);
@@ -900,11 +896,10 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
900 goto error; 896 goto error;
901 } 897 }
902 v9fs_set_create_acl(inode, fid, dacl, pacl); 898 v9fs_set_create_acl(inode, fid, dacl, pacl);
903 err = v9fs_fid_add(dentry, fid); 899 v9fs_fid_add(dentry, fid);
904 if (err < 0)
905 goto error;
906 d_instantiate(dentry, inode); 900 d_instantiate(dentry, inode);
907 fid = NULL; 901 fid = NULL;
902 err = 0;
908 } else { 903 } else {
909 /* 904 /*
910 * Not in cached mode. No need to populate inode with stat. 905 * Not in cached mode. No need to populate inode with stat.