]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jffs2/build.c
Driver core: add name to device_type
[linux-2.6-omap-h63xx.git] / fs / jffs2 / build.c
index fff108bb118b14db6a4ca927b62320a4cf4f2b19..07119c42a861ad2ddf6fa86ae7fc79753879aa0f 100644 (file)
@@ -47,7 +47,7 @@ next_inode(int *i, struct jffs2_inode_cache *ic, struct jffs2_sb_info *c)
             ic = next_inode(&i, ic, (c)))
 
 
-static inline void jffs2_build_inode_pass1(struct jffs2_sb_info *c,
+static void jffs2_build_inode_pass1(struct jffs2_sb_info *c,
                                        struct jffs2_inode_cache *ic)
 {
        struct jffs2_full_dirent *fd;
@@ -160,6 +160,7 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
                ic->scan_dents = NULL;
                cond_resched();
        }
+       jffs2_build_xattr_subsystem(c);
        c->flags &= ~JFFS2_SB_FLAG_BUILDING;
 
        dbg_fsbuild("FS build complete\n");
@@ -178,6 +179,7 @@ exit:
                                jffs2_free_full_dirent(fd);
                        }
                }
+               jffs2_clear_xattr_subsystem(c);
        }
 
        return ret;
@@ -346,23 +348,27 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
 
        ret = jffs2_sum_init(c);
        if (ret)
-               return ret;
+               goto out_free;
 
        if (jffs2_build_filesystem(c)) {
                dbg_fsbuild("build_fs failed\n");
                jffs2_free_ino_caches(c);
                jffs2_free_raw_node_refs(c);
-#ifndef __ECOS
-               if (jffs2_blocks_use_vmalloc(c))
-                       vfree(c->blocks);
-               else
-#endif
-                       kfree(c->blocks);
-
-               return -EIO;
+               ret = -EIO;
+               goto out_free;
        }
 
        jffs2_calc_trigger_levels(c);
 
        return 0;
+
+ out_free:
+#ifndef __ECOS
+       if (jffs2_blocks_use_vmalloc(c))
+               vfree(c->blocks);
+       else
+#endif
+               kfree(c->blocks);
+
+       return ret;
 }