Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
[pandora-kernel.git] / fs / 9p / vfs_super.c
index 868f350..2c4fa75 100644 (file)
@@ -44,7 +44,6 @@
 #include "v9fs.h"
 #include "9p.h"
 #include "v9fs_vfs.h"
-#include "conv.h"
 #include "fid.h"
 
 static void v9fs_clear_inode(struct inode *);
@@ -92,7 +91,7 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
        sb->s_op = &v9fs_super_ops;
 
        sb->s_flags = flags | MS_ACTIVE | MS_SYNCHRONOUS | MS_DIRSYNC |
-           MS_NODIRATIME | MS_NOATIME;
+           MS_NOATIME;
 }
 
 /**
@@ -123,14 +122,14 @@ static struct super_block *v9fs_get_sb(struct file_system_type
 
        dprintk(DEBUG_VFS, " \n");
 
-       v9ses = kcalloc(1, sizeof(struct v9fs_session_info), GFP_KERNEL);
+       v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
        if (!v9ses)
                return ERR_PTR(-ENOMEM);
 
        if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) {
                dprintk(DEBUG_ERROR, "problem initiating session\n");
-               retval = newfid;
-               goto free_session;
+               kfree(v9ses);
+               return ERR_PTR(newfid);
        }
 
        sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
@@ -150,57 +149,43 @@ static struct super_block *v9fs_get_sb(struct file_system_type
 
        if (!root) {
                retval = -ENOMEM;
-               goto release_inode;
+               goto put_back_sb;
        }
 
        sb->s_root = root;
 
-       /* Setup the Root Inode */
-       root_fid = v9fs_fid_create(root);
-       if (root_fid == NULL) {
-               retval = -ENOMEM;
-               goto release_dentry;
-       }
-
-       root_fid->fidopen = 0;
-       root_fid->v9ses = v9ses;
-
        stat_result = v9fs_t_stat(v9ses, newfid, &fcall);
        if (stat_result < 0) {
                dprintk(DEBUG_ERROR, "stat error\n");
-               v9fs_t_clunk(v9ses, newfid, NULL);
+               v9fs_t_clunk(v9ses, newfid);
                v9fs_put_idpool(newfid, &v9ses->fidpool);
        } else {
-               root_fid->fid = newfid;
-               root_fid->qid = fcall->params.rstat.stat->qid;
+               /* Setup the Root Inode */
+               root_fid = v9fs_fid_create(root, v9ses, newfid, 0);
+               if (root_fid == NULL) {
+                       retval = -ENOMEM;
+                       goto put_back_sb;
+               }
+
+               root_fid->qid = fcall->params.rstat.stat.qid;
                root->d_inode->i_ino =
-                   v9fs_qid2ino(&fcall->params.rstat.stat->qid);
-               v9fs_mistat2inode(fcall->params.rstat.stat, root->d_inode, sb);
+                   v9fs_qid2ino(&fcall->params.rstat.stat.qid);
+               v9fs_stat2inode(&fcall->params.rstat.stat, root->d_inode, sb);
        }
 
        kfree(fcall);
 
        if (stat_result < 0) {
                retval = stat_result;
-               goto release_dentry;
+               goto put_back_sb;
        }
 
        return sb;
 
-      release_dentry:
-       dput(sb->s_root);
-
-      release_inode:
-       iput(inode);
-
-      put_back_sb:
+put_back_sb:
+       /* deactivate_super calls v9fs_kill_super which will frees the rest */
        up_write(&sb->s_umount);
        deactivate_super(sb);
-       v9fs_session_close(v9ses);
-
-      free_session:
-       kfree(v9ses);
-
        return ERR_PTR(retval);
 }