static int __init init_jffs2_fs(void) { int ret; printk(KERN_NOTICE "JFFS2 version 2.1. (C) 2001, 2002 Red Hat, Inc., designed by Axis Communications AB.\n"); #ifdef JFFS2_OUT_OF_KERNEL /* sanity checks. Could we do these at compile time? */ if (sizeof(struct jffs2_sb_info) > sizeof (((struct super_block *)NULL)->u)) { printk(KERN_ERR "JFFS2 error: struct jffs2_sb_info (%d bytes) doesn't fit in the super_block union (%d bytes)\n", sizeof(struct jffs2_sb_info), sizeof (((struct super_block *)NULL)->u)); return -EIO; } if (sizeof(struct jffs2_inode_info) > sizeof (((struct inode *)NULL)->u)) { printk(KERN_ERR "JFFS2 error: struct jffs2_inode_info (%d bytes) doesn't fit in the inode union (%d bytes)\n", sizeof(struct jffs2_inode_info), sizeof (((struct inode *)NULL)->u)); return -EIO; } #endif ret = jffs2_zlib_init(); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to initialise zlib workspaces\n"); goto out; } ret = jffs2_create_slab_caches(); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to initialise slab caches\n"); goto out_zlib; } ret = register_filesystem(&jffs2_fs_type); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to register filesystem\n"); goto out_slab; } return 0; out_slab: jffs2_destroy_slab_caches(); out_zlib: jffs2_zlib_exit(); out: return ret; }
static int __init init_jffs2_fs(void) { int ret; printk(KERN_INFO "JFFS2 version 2.2." #ifdef CONFIG_JFFS2_FS_NAND " (NAND)" #endif " (C) 2001-2003 Red Hat, Inc.\n"); jffs2_inode_cachep = kmem_cache_create("jffs2_i", sizeof(struct jffs2_inode_info), 0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, jffs2_i_init_once, NULL); if (!jffs2_inode_cachep) { printk(KERN_ERR "JFFS2 error: Failed to initialise inode cache\n"); return -ENOMEM; } ret = jffs2_zlib_init(); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to initialise zlib workspaces\n"); goto out; } ret = jffs2_create_slab_caches(); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to initialise slab caches\n"); goto out_zlib; } ret = register_filesystem(&jffs2_fs_type); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to register filesystem\n"); goto out_slab; } return 0; out_slab: jffs2_destroy_slab_caches(); out_zlib: jffs2_zlib_exit(); out: return ret; }