int __init sysaufs_init(void) { int err; do { get_random_bytes(&sysaufs_si_mask, sizeof(sysaufs_si_mask)); } while (!sysaufs_si_mask); err = -EINVAL; sysaufs_kset = kset_create_and_add(AUFS_NAME, NULL, fs_kobj); if (unlikely(!sysaufs_kset)) goto out; err = PTR_ERR(sysaufs_kset); if (IS_ERR(sysaufs_kset)) goto out; err = sysfs_create_group(&sysaufs_kset->kobj, sysaufs_attr_group); if (unlikely(err)) { kset_unregister(sysaufs_kset); goto out; } err = dbgaufs_init(); if (unlikely(err)) sysaufs_fin(); out: return err; }
static int __init aufs_init(void) { int err, i; char *p; p = au_esc_chars; for (i = 1; i <= ' '; i++) *p++ = i; *p++ = '\\'; *p++ = '\x7f'; *p = 0; au_dir_roflags = au_file_roflags(O_DIRECTORY | O_LARGEFILE); au_sbilist_init(); sysaufs_brs_init(); au_debug_init(); au_dy_init(); err = sysaufs_init(); if (unlikely(err)) goto out; err = au_procfs_init(); if (unlikely(err)) goto out_sysaufs; err = au_wkq_init(); if (unlikely(err)) goto out_procfs; err = au_hnotify_init(); if (unlikely(err)) goto out_wkq; err = au_sysrq_init(); if (unlikely(err)) goto out_hin; err = au_cache_init(); if (unlikely(err)) goto out_sysrq; err = register_filesystem(&aufs_fs_type); if (unlikely(err)) goto out_cache; /* since we define pr_fmt, call printk directly */ printk(KERN_INFO AUFS_NAME " " AUFS_VERSION "\n"); goto out; /* success */ out_cache: au_cache_fin(); out_sysrq: au_sysrq_fin(); out_hin: au_hnotify_fin(); out_wkq: au_wkq_fin(); out_procfs: au_procfs_fin(); out_sysaufs: sysaufs_fin(); au_dy_fin(); out: return err; }
static void __exit aufs_exit(void) { unregister_filesystem(&aufs_fs_type); au_cache_fin(); au_sysrq_fin(); au_hinotify_fin(); au_wkq_fin(); sysaufs_fin(); }
static void __exit aufs_exit(void) { unregister_filesystem(&aufs_fs_type); au_cache_fin(); au_sysrq_fin(); au_hnotify_fin(); au_loopback_fin(); au_wkq_fin(); au_procfs_fin(); sysaufs_fin(); au_dy_fin(); }
static int __init aufs_init(void) { int err, i; char *p; au_debug_init(); #ifdef CONFIG_AUFS_INO_T_64 BUILD_BUG_ON(sizeof(ino_t) != sizeof(long long)); #else BUILD_BUG_ON(sizeof(ino_t) != sizeof(int)); #endif p = au_esc_chars; for (i = 1; i <= ' '; i++) *p++ = i; *p++ = '\\'; *p++ = '\x7f'; *p = 0; au_dir_roflags = au_file_roflags(O_DIRECTORY | O_LARGEFILE); err = -EINVAL; if (unlikely(aufs_nwkq <= 0)) goto out; err = sysaufs_init(); if (unlikely(err)) goto out; err = au_wkq_init(); if (unlikely(err)) goto out_sysaufs; err = au_inotify_init(); if (unlikely(err)) goto out_wkq; err = au_sysrq_init(); if (unlikely(err)) goto out_inotify; err = create_cache(); if (unlikely(err)) goto out_sysrq; err = register_filesystem(&aufs_fs_type); if (unlikely(err)) goto out_cache; pr_info(AUFS_NAME " " AUFS_VERSION "\n"); return 0; /* success */ out_cache: destroy_cache(); out_sysrq: au_sysrq_fin(); out_inotify: au_inotify_fin(); out_wkq: au_wkq_fin(); out_sysaufs: sysaufs_fin(); out: AuTraceErr(err); return err; }