#include <lustre_dlm.h>
#include <linux/init.h>
#include <linux/fs.h>
+#include <linux/random.h>
#include <lprocfs_status.h>
#include "llite_internal.h"
#include "vvp_internal.h"
.show_options = ll_show_options,
};
-
-void lustre_register_client_process_config(int (*cpc)(struct lustre_cfg *lcfg));
-
static int __init lustre_init(void)
{
- struct proc_dir_entry *entry;
- lnet_process_id_t lnet_id;
- struct timeval tv;
- int i, rc, seed[2];
+ struct lnet_process_id lnet_id;
+ int i, rc;
CLASSERT(sizeof(LUSTRE_VOLATILE_HDR) == LUSTRE_VOLATILE_HDR_LEN + 1);
if (ll_file_data_slab == NULL)
GOTO(out_cache, rc = -ENOMEM);
- entry = lprocfs_register("llite", proc_lustre_root, NULL, NULL);
- if (IS_ERR(entry)) {
- rc = PTR_ERR(entry);
- CERROR("cannot register '/proc/fs/lustre/llite': rc = %d\n",
- rc);
+ rc = llite_tunables_register();
+ if (rc)
GOTO(out_cache, rc);
- }
-
- proc_lustre_fs_root = entry;
-
- cfs_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. */
if (LNetGetId(i, &lnet_id) == -ENOENT)
break;
- if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND)
- seed[0] ^= LNET_NIDADDR(lnet_id.nid);
+ add_device_randomness(&lnet_id.nid, sizeof(lnet_id.nid));
}
- do_gettimeofday(&tv);
- cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]);
-
rc = vvp_global_init();
if (rc != 0)
- GOTO(out_proc, rc);
+ GOTO(out_tunables, rc);
cl_inode_fini_env = cl_env_alloc(&cl_inode_fini_refcheck,
LCT_REMEMBER | LCT_NOREF);
lustre_register_client_fill_super(ll_fill_super);
lustre_register_kill_super_cb(ll_kill_super);
- lustre_register_client_process_config(ll_process_config);
RETURN(0);
cl_env_put(cl_inode_fini_env, &cl_inode_fini_refcheck);
out_vvp:
vvp_global_fini();
-out_proc:
- lprocfs_remove(&proc_lustre_fs_root);
+out_tunables:
+ llite_tunables_unregister();
out_cache:
- if (ll_inode_cachep != NULL)
- kmem_cache_destroy(ll_inode_cachep);
-
- if (ll_file_data_slab != NULL)
- kmem_cache_destroy(ll_file_data_slab);
-
+ kmem_cache_destroy(ll_inode_cachep);
+ kmem_cache_destroy(ll_file_data_slab);
return rc;
}
{
lustre_register_client_fill_super(NULL);
lustre_register_kill_super_cb(NULL);
- lustre_register_client_process_config(NULL);
- lprocfs_remove(&proc_lustre_fs_root);
+ llite_tunables_unregister();
ll_xattr_fini();
cl_env_put(cl_inode_fini_env, &cl_inode_fini_refcheck);
vvp_global_fini();
+#ifdef HAVE_INODE_I_RCU
+ /*
+ * Make sure all delayed rcu free inodes are flushed before we
+ * destroy cache.
+ */
+ rcu_barrier();
+#endif
kmem_cache_destroy(ll_inode_cachep);
kmem_cache_destroy(ll_file_data_slab);
}