- int i, rc, seed[2];
- struct timeval tv;
- lnet_process_id_t lnet_id;
-
- printk(KERN_INFO "Lustre: Lustre Client File System; "
- "info@clusterfs.com\n");
- rc = ll_init_inodecache();
- if (rc)
- return -ENOMEM;
- ll_file_data_slab = kmem_cache_create("ll_file_data",
- sizeof(struct ll_file_data), 0,
- SLAB_HWCACHE_ALIGN, NULL, NULL);
- if (ll_file_data_slab == NULL) {
- ll_destroy_inodecache();
- return -ENOMEM;
- }
-
- proc_lustre_fs_root = proc_lustre_root ?
- proc_mkdir("llite", proc_lustre_root) : NULL;
-
- ll_register_cache(&ll_cache_definition);
-
- lustre_register_client_fill_super(ll_fill_super);
- lustre_register_client_process_config(ll_process_config);
-
- get_random_bytes(seed, sizeof(seed));
-
- /* Nodes with small feet have little entropy
- * the NID for this node gives the most entropy in the low bits */
- for (i=0; ; i++) {
- if (LNetGetId(i, &lnet_id) == -ENOENT) {
- break;
- }
- if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND) {
- seed[0] ^= LNET_NIDADDR(lnet_id.nid);
- }
- }
-
- do_gettimeofday(&tv);
- ll_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]);
-
- return rc;
+ struct lnet_process_id lnet_id;
+ int i, rc;
+
+ CLASSERT(sizeof(LUSTRE_VOLATILE_HDR) == LUSTRE_VOLATILE_HDR_LEN + 1);
+
+ /* print an address of _any_ initialized kernel symbol from this
+ * module, to allow debugging with gdb that doesn't support data
+ * symbols from modules.*/
+ CDEBUG(D_INFO, "Lustre client module (%p).\n",
+ &lustre_super_operations);
+
+ ll_inode_cachep = kmem_cache_create("lustre_inode_cache",
+ sizeof(struct ll_inode_info),
+ 0, SLAB_HWCACHE_ALIGN, NULL);
+ if (ll_inode_cachep == NULL)
+ GOTO(out_cache, rc = -ENOMEM);
+
+ ll_file_data_slab = kmem_cache_create("ll_file_data",
+ sizeof(struct ll_file_data), 0,
+ SLAB_HWCACHE_ALIGN, NULL);
+ if (ll_file_data_slab == NULL)
+ GOTO(out_cache, rc = -ENOMEM);
+
+ rc = llite_tunables_register();
+ if (rc)
+ GOTO(out_cache, rc);
+
+ /* Nodes with small feet have little entropy. The NID for this
+ * node gives the most entropy in the low bits. */
+ for (i = 0;; i++) {
+ if (LNetGetId(i, &lnet_id) == -ENOENT)
+ break;
+
+ add_device_randomness(&lnet_id.nid, sizeof(lnet_id.nid));
+ }
+
+ rc = vvp_global_init();
+ if (rc != 0)
+ GOTO(out_tunables, rc);
+
+ cl_inode_fini_env = cl_env_alloc(&cl_inode_fini_refcheck,
+ LCT_REMEMBER | LCT_NOREF);
+ if (IS_ERR(cl_inode_fini_env))
+ GOTO(out_vvp, rc = PTR_ERR(cl_inode_fini_env));
+
+ cl_inode_fini_env->le_ctx.lc_cookie = 0x4;
+
+ rc = ll_xattr_init();
+ if (rc != 0)
+ GOTO(out_inode_fini_env, rc);
+
+ lustre_register_client_fill_super(ll_fill_super);
+ lustre_register_kill_super_cb(ll_kill_super);
+
+ RETURN(0);
+
+out_inode_fini_env:
+ cl_env_put(cl_inode_fini_env, &cl_inode_fini_refcheck);
+out_vvp:
+ vvp_global_fini();
+out_tunables:
+ llite_tunables_unregister();
+out_cache:
+ kmem_cache_destroy(ll_inode_cachep);
+ kmem_cache_destroy(ll_file_data_slab);
+ return rc;