12 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14 #include <linux/kernel.h>
15 #include <linux/module.h>
16 #include <linux/slab.h>
18 #include <linux/list.h>
26 #include <linux/ctype.h>
53 static void jffs2_destroy_inode(
struct inode *inode)
58 static void jffs2_i_init_once(
void *
foo)
66 static const char *jffs2_compr_name(
unsigned int compr)
71 #ifdef CONFIG_JFFS2_LZO
75 #ifdef CONFIG_JFFS2_ZLIB
103 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
123 int fh_len,
int fh_type)
126 jffs2_nfs_get_inode);
130 int fh_len,
int fh_type)
133 jffs2_nfs_get_inode);
147 JFFS2_DEBUG(
"Parent of directory ino #%u is #%u\n",
154 .get_parent = jffs2_get_parent,
155 .fh_to_dentry = jffs2_fh_to_dentry,
156 .fh_to_parent = jffs2_fh_to_parent,
187 while ((p =
strsep(&data,
","))) {
200 if (!
strcmp(name,
"none"))
202 #ifdef CONFIG_JFFS2_LZO
203 else if (!
strcmp(name,
"lzo"))
206 #ifdef CONFIG_JFFS2_ZLIB
207 else if (!
strcmp(name,
"zlib"))
212 pr_err(
"Error: unknown compressor \"%s\"\n",
224 if (opt > c->
mtd->size) {
225 pr_warn(
"Too large reserve pool specified, max "
226 "is %llu KB\n", c->
mtd->size / 1024);
232 pr_err(
"Error: unrecognized mount option '%s' or missing value\n",
246 err = jffs2_parse_options(c, data);
255 .alloc_inode = jffs2_alloc_inode,
256 .destroy_inode =jffs2_destroy_inode,
257 .put_super = jffs2_put_super,
259 .remount_fs = jffs2_remount_fs,
262 .show_options = jffs2_show_options,
263 .sync_fs = jffs2_sync_fs,
269 static int jffs2_fill_super(
struct super_block *sb,
void *data,
int silent)
275 " New superblock for device %d (\"%s\")\n",
286 ret = jffs2_parse_options(c, data);
301 sb->
s_op = &jffs2_super_operations;
305 #ifdef CONFIG_JFFS2_FS_POSIX_ACL
313 int flags,
const char *dev_name,
316 return mount_mtd(fs_type, flags, dev_name, data, jffs2_fill_super);
319 static void jffs2_put_super (
struct super_block *sb)
333 if (jffs2_blocks_use_vmalloc(c))
341 jffs2_dbg(1,
"%s(): returning\n", __func__);
356 .mount = jffs2_mount,
357 .kill_sb = jffs2_kill_sb,
360 static int __init init_jffs2_fs(
void)
377 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
380 #ifdef CONFIG_JFFS2_SUMMARY
383 " © 2001-2006 Red Hat, Inc.\n");
390 if (!jffs2_inode_cachep) {
391 pr_err(
"error: Failed to initialise inode cache\n");
396 pr_err(
"error: Failed to initialise compressors\n");
401 pr_err(
"error: Failed to initialise slab caches\n");
402 goto out_compressors;
406 pr_err(
"error: Failed to register filesystem\n");
420 static void __exit exit_jffs2_fs(
void)