static int __init init_ncp_fs(void) { int err; DPRINTK("ncpfs: init_ncp_fs called\n"); err = init_inodecache(); if (err) goto out1; err = register_filesystem(&ncp_fs_type); if (err) goto out; return 0; out: destroy_inodecache(); out1: return err; }
static int __init init_qnx4_fs(void) { int err; err = init_inodecache(); if (err) return err; err = register_filesystem(&qnx4_fs_type); if (err) { destroy_inodecache(); return err; } printk(KERN_INFO "QNX4 filesystem 0.2.3 registered.\n"); return 0; }
static int __init init_squashfs_fs(void) { int err = init_inodecache(); if (err) return err; err = register_filesystem(&squashfs_fs_type); if (err) { destroy_inodecache(); return err; } pr_info("version 4.0 (2009/01/31) Phillip Lougher\n"); return 0; }
static int __init init_f2fs_fs(void) { int err; err = init_inodecache(); if (err) goto fail; err = create_node_manager_caches(); if (err) goto free_inodecache; err = create_segment_manager_caches(); if (err) goto free_node_manager_caches; err = create_gc_caches(); if (err) goto free_segment_manager_caches; err = create_checkpoint_caches(); if (err) goto free_gc_caches; f2fs_kset = kset_create_and_add("f2fs", NULL, fs_kobj); if (!f2fs_kset) { err = -ENOMEM; goto free_checkpoint_caches; } err = register_filesystem(&f2fs_fs_type); if (err) goto free_kset; f2fs_create_root_stats(); f2fs_proc_root = proc_mkdir("fs/f2fs", NULL); return 0; free_kset: kset_unregister(f2fs_kset); free_checkpoint_caches: destroy_checkpoint_caches(); free_gc_caches: destroy_gc_caches(); free_segment_manager_caches: destroy_segment_manager_caches(); free_node_manager_caches: destroy_node_manager_caches(); free_inodecache: destroy_inodecache(); fail: return err; }
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_vxext_fs(void) { int err; err = fat_cache_init(); if (err) return err; err = fat_init_inodecache(); if (err) goto failed; return register_filesystem(&vxext_fs_type); failed: fat_cache_destroy(); return err; }
static int __init init_exofs(void) { int err; err = init_inodecache(); if (err) goto out; err = register_filesystem(&exofs_type); if (err) goto out_d; return 0; out_d: destroy_inodecache(); out: return err; }
static int __init init_f2fs_fs(void) { if (init_inodecache()) goto fail; if (create_node_manager_caches()) goto fail; if (create_gc_caches()) goto fail; if (create_checkpoint_caches()) goto fail; if (register_filesystem(&f2fs_fs_type)) return -EBUSY; f2fs_proc_root = proc_mkdir("fs/f2fs", NULL); return 0; fail: return -ENOMEM; }
static int __init init_wrapfs_fs(void) { int err; pr_info("Registering u2fs " WRAPFS_VERSION "\n"); err = wrapfs_init_inode_cache(); if (err) goto out; err = wrapfs_init_dentry_cache(); if (err) goto out; err = register_filesystem(&wrapfs_fs_type); out: if (err) { wrapfs_destroy_inode_cache(); wrapfs_destroy_dentry_cache(); } return err; }
int btrfs_init_test_fs(void) { int ret; ret = register_filesystem(&test_type); if (ret) { printk(KERN_ERR "btrfs: cannot register test file system\n"); return ret; } test_mnt = kern_mount(&test_type); if (IS_ERR(test_mnt)) { printk(KERN_ERR "btrfs: cannot mount test file system\n"); unregister_filesystem(&test_type); return ret; } return 0; }
static int __init plgfs_init(void) { int rv; plgfs_major = register_blkdev(0, "pluginfs"); if (plgfs_major < 0) return plgfs_major; rv = register_filesystem(&plgfs_type); if (rv) { unregister_blkdev(plgfs_major, "pluginfs"); return rv; } pr_info("Plugin File System Version " PLGFS_VERSION); return 0; }
/*! 2017. 1.07 study -ing */ int __init sysfs_init(void) { int err; sysfs_root = kernfs_create_root(NULL, NULL); if (IS_ERR(sysfs_root)) return PTR_ERR(sysfs_root); sysfs_root_kn = sysfs_root->kn; err = register_filesystem(&sysfs_fs_type); if (err) { kernfs_destroy_root(sysfs_root); return err; } return 0; }
static int __init init_ext2_fs(void) { int err = init_ext2_xattr(); if (err) return err; err = init_inodecache(); if (err) goto out1; err = register_filesystem(&ext2_fs_type); if (err) goto out; return 0; out: destroy_inodecache(); out1: exit_ext2_xattr(); return err; }
int __init init_ramfs_fs(void) { static unsigned long once; int err; if (test_and_set_bit(0, &once)) return 0; err = bdi_init(&ramfs_backing_dev_info); if (err) return err; err = register_filesystem(&ramfs_fs_type); if (err) bdi_destroy(&ramfs_backing_dev_info); return err; }
static int __init ovl_init(void) { int err; ovl_inode_cachep = kmem_cache_create("ovl_inode", sizeof(struct ovl_inode), 0, (SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD|SLAB_ACCOUNT), ovl_inode_init_once); if (ovl_inode_cachep == NULL) return -ENOMEM; err = register_filesystem(&ovl_fs_type); if (err) kmem_cache_destroy(ovl_inode_cachep); return err; }
int VMBlockInitFileSystem(char const *root) // IN: directory redirecting to { int ret; if (!root) { Warning("VMBlockInitFileSystem: root not provided " "(missing module parameter?)\n"); return -EINVAL; } /* * Here we assume that the provided root is valid so the module will load. * The mount operation will fail if that is not the case. */ fsRoot = root; fsRootLen = strlen(fsRoot); if (fsRootLen >= PATH_MAX) { return -ENAMETOOLONG; } /* Initialize our inode slab allocator */ VMBlockInodeCache = os_kmem_cache_create("VMBlockInodeCache", sizeof (VMBlockInodeInfo), 0, InodeCacheCtor); if (!VMBlockInodeCache) { Warning("VMBlockInitFileSystem: could not initialize inode cache\n"); return -ENOMEM; } /* Tell the kernel about our file system */ ret = register_filesystem(&fsType); if (ret < 0) { Warning("VMBlockInitFileSystem: could not initialize file system\n"); kmem_cache_destroy(VMBlockInodeCache); return ret; } LOG(4, "file system registered with root of [%s]\n", fsRoot); return 0; }
void __init proc_root_init(void) { int err; proc_init_inodecache(); err = register_filesystem(&proc_fs_type); if (err) return; proc_mnt = kern_mount_data(&proc_fs_type, &init_pid_ns); err = PTR_ERR(proc_mnt); if (IS_ERR(proc_mnt)) { unregister_filesystem(&proc_fs_type); return; } proc_symlink("mounts", NULL, "self/mounts"); proc_net_init(); #ifdef CONFIG_SYSVIPC proc_mkdir("sysvipc", NULL); #endif proc_mkdir("fs", NULL); proc_mkdir("driver", NULL); proc_mkdir("fs/nfsd", NULL); /* somewhere for the nfsd filesystem to be mounted */ #if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE) /* just give it a mountpoint */ proc_mkdir("openprom", NULL); #endif proc_tty_init(); #ifdef CONFIG_PROC_DEVICETREE proc_device_tree_init(); #endif proc_mkdir("bus", NULL); #if defined(CONFIG_MIPS_BRCM) proc_brcm = proc_mkdir("brcm", NULL); proc_brcm_init(proc_brcm); #endif proc_sys_init(); }
void __init proc_root_init(void) { int err = proc_init_inodecache(); if (err) return; err = register_filesystem(&proc_fs_type); if (err) return; proc_mnt = kern_mount_data(&proc_fs_type, &init_pid_ns); err = PTR_ERR(proc_mnt); if (IS_ERR(proc_mnt)) { unregister_filesystem(&proc_fs_type); return; } proc_misc_init(); proc_net_init(); #ifdef CONFIG_SYSVIPC proc_mkdir("sysvipc", NULL); #endif proc_mkdir("fs", NULL); proc_mkdir("driver", NULL); proc_mkdir("fs/nfsd", NULL); /* somewhere for the nfsd filesystem to be mounted */ #if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE) /* just give it a mountpoint */ proc_mkdir("openprom", NULL); #endif proc_tty_init(); #ifdef CONFIG_PROC_DEVICETREE proc_device_tree_init(); #endif #ifdef CONFIG_GRKERNSEC_PROC_ADD #ifdef CONFIG_GRKERNSEC_PROC_USER proc_mkdir_mode("bus", S_IRUSR | S_IXUSR, NULL); #elif defined(CONFIG_GRKERNSEC_PROC_USERGROUP) proc_mkdir_mode("bus", S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP, NULL); #endif #else proc_mkdir("bus", NULL); #endif proc_sys_init(); }
int __init usbdevfs_init(void) { int ret; for (ret = 0; ret < NRSPECIAL; ret++) { INIT_LIST_HEAD(&special[ret].inodes); } if ((ret = usb_register(&usbdevfs_driver))) return ret; if ((ret = register_filesystem(&usbdevice_fs_type))) { usb_deregister(&usbdevfs_driver); return ret; } #ifdef CONFIG_PROC_FS /* create mount point for usbdevfs */ usbdir = proc_mkdir("usb", proc_bus); #endif return ret; }
static int __init init_btrfs_fs(void) { int err; err = btrfs_init_sysfs(); if (err) return err; err = btrfs_init_cachep(); if (err) goto free_sysfs; err = extent_io_init(); if (err) goto free_cachep; err = extent_map_init(); if (err) goto free_extent_io; err = btrfs_interface_init(); if (err) goto free_extent_map; err = register_filesystem(&btrfs_fs_type); if (err) goto unregister_ioctl; printk(KERN_INFO "%s loaded\n", BTRFS_BUILD_VERSION); return 0; unregister_ioctl: btrfs_interface_exit(); free_extent_map: extent_map_exit(); free_extent_io: extent_io_exit(); free_cachep: btrfs_destroy_cachep(); free_sysfs: btrfs_exit_sysfs(); return err; }
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_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_compressors_init(); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to initialise compressors\n"); goto out; } ret = jffs2_create_slab_caches(); if (ret) { printk(KERN_ERR "JFFS2 error: Failed to initialise slab caches\n"); goto out_compressors; } 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_compressors: jffs2_compressors_exit(); out: kmem_cache_destroy(jffs2_inode_cachep); return ret; }
static int __init gfs_init(void) { //check_sizes(); //gfs_inode_cache = kmem_cache_create("gfsinode_cache", sizeof(struct gfs_inode_info), // 0, (SLAB_RECLAIM_ACCOUNT|SLAB_POISON|SLAB_RED_ZONE|SLAB_PANIC), // init_once); int r = register_filesystem(&gfs_type); if(r) goto ret; r = gfs_sysfs_init(); if(r) goto unreg; return 0; unreg: unregister_filesystem(&gfs_type); ret: PVAR(r, "%d"); return r; }
static int __init anon_inode_init(void) { int error; error = register_filesystem(&anon_inode_fs_type); if (error) goto err_exit; anon_inode_mnt = kern_mount(&anon_inode_fs_type); if (IS_ERR(anon_inode_mnt)) { error = PTR_ERR(anon_inode_mnt); goto err_unregister_filesystem; } return 0; err_unregister_filesystem: unregister_filesystem(&anon_inode_fs_type); err_exit: panic(KERN_ERR "anon_inode_init() failed (%d)\n", error); }
STATIC int __init init_xfs_fs( void ) { int error; struct sysinfo si; static char message[] __initdata = KERN_INFO "SGI XFS " XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled\n"; printk(message); si_meminfo(&si); xfs_physmem = si.totalram; error = init_inodecache(); if (error < 0) goto undo_inodecache; error = pagebuf_init(); if (error < 0) goto undo_pagebuf; vn_init(); xfs_init(); uuid_init(); vfs_initdmapi(); vfs_initquota(); error = register_filesystem(&xfs_fs_type); if (error) goto undo_register; return 0; undo_register: pagebuf_terminate(); undo_pagebuf: destroy_inodecache(); undo_inodecache: return error; }
static int __init init_dlmfs_fs(void) { int status; int cleanup_inode = 0, cleanup_worker = 0; dlmfs_print_version(); status = bdi_init(&dlmfs_backing_dev_info); if (status) return status; dlmfs_inode_cache = kmem_cache_create("dlmfs_inode_cache", sizeof(struct dlmfs_inode_private), 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD), dlmfs_init_once); if (!dlmfs_inode_cache) { status = -ENOMEM; goto bail; } cleanup_inode = 1; user_dlm_worker = create_singlethread_workqueue("user_dlm"); if (!user_dlm_worker) { status = -ENOMEM; goto bail; } cleanup_worker = 1; user_dlm_set_locking_protocol(); status = register_filesystem(&dlmfs_fs_type); bail: if (status) { if (cleanup_inode) kmem_cache_destroy(dlmfs_inode_cache); if (cleanup_worker) destroy_workqueue(user_dlm_worker); bdi_destroy(&dlmfs_backing_dev_info); } else printk("OCFS2 User DLM kernel interface loaded\n"); return status; }
static int __init hypfs_init(void) { int rc; rc = hypfs_dbfs_init(); if (rc) return rc; if (hypfs_diag_init()) { rc = -ENODATA; goto fail_dbfs_exit; } if (hypfs_vm_init()) { rc = -ENODATA; goto fail_hypfs_diag_exit; } if (hypfs_sprp_init()) { rc = -ENODATA; goto fail_hypfs_vm_exit; } s390_kobj = kobject_create_and_add("s390", hypervisor_kobj); if (!s390_kobj) { rc = -ENOMEM; goto fail_hypfs_sprp_exit; } rc = register_filesystem(&hypfs_type); if (rc) goto fail_filesystem; return 0; fail_filesystem: kobject_put(s390_kobj); fail_hypfs_sprp_exit: hypfs_sprp_exit(); fail_hypfs_vm_exit: hypfs_vm_exit(); fail_hypfs_diag_exit: hypfs_diag_exit(); fail_dbfs_exit: hypfs_dbfs_exit(); pr_err("Initialization of hypfs failed with rc=%i\n", rc); return rc; }
void __init proc_root_init(void) { int err = proc_init_inodecache(); if (err) return; err = register_filesystem(&proc_fs_type); if (err) return; proc_mnt = kern_mount(&proc_fs_type); err = PTR_ERR(proc_mnt); if (IS_ERR(proc_mnt)) { unregister_filesystem(&proc_fs_type); return; } proc_misc_init(); proc_net = proc_mkdir("net", 0); #ifdef CONFIG_SYSVIPC proc_mkdir("sysvipc", 0); #endif #ifdef CONFIG_SYSCTL proc_sys_root = proc_mkdir("sys", 0); #endif #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) proc_mkdir("sys/fs", 0); proc_mkdir("sys/fs/binfmt_misc", 0); #endif proc_root_fs = proc_mkdir("fs", 0); proc_root_driver = proc_mkdir("driver", 0); proc_mkdir("fs/nfsd", 0); /* somewhere for the nfsd filesystem to be mounted */ #if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE) /* just give it a mountpoint */ proc_mkdir("openprom", 0); #endif proc_tty_init(); #ifdef CONFIG_PROC_DEVICETREE proc_device_tree_init(); #endif #ifdef CONFIG_PPC_RTAS proc_rtas_init(); #endif proc_bus = proc_mkdir("bus", 0); }
static int __init init_nilfs_fs(void) { int err; err = nilfs_init_cachep(); if (err) goto fail; err = register_filesystem(&nilfs_fs_type); if (err) goto free_cachep; printk(KERN_INFO "NILFS version 2 loaded\n"); return 0; free_cachep: nilfs_destroy_cachep(); fail: return err; }
static int __init myfs_init(void) { int retval; retval = register_filesystem(&my_fs_type); if (!retval) { myfs_mount = vfs_kern_mount(&my_fs_type,MS_KERNMOUNT,(&my_fs_type)->name,NULL); if (IS_ERR(myfs_mount)) { printk(KERN_ERR "myfs: could not mount!\n"); retval= PTR_ERR(myfs_mount); myfs_mount = NULL; unregister_filesystem(&my_fs_type); return retval; } } return 0; }
static int __init aufs_init(void) { int ret = aufs_inode_cache_create(); if (ret != 0) { pr_err("cannot create inode cache\n"); return ret; } ret = register_filesystem(&aufs_type); if (ret != 0) { aufs_inode_cache_destroy(); pr_err("cannot register filesystem\n"); return ret; } pr_debug("aufs module loaded\n"); return 0; }