-void ldlm_resource_init_once(void *p)
-{
- /*
- * It is import to initialise the spinlock only once,
- * as ldlm_lock_change_resource() could try to lock
- * the resource *after* it has been freed and possibly
- * reused. SLAB_TYPESAFE_BY_RCU ensures the memory won't
- * be freed while the lock is being taken, but we need to
- * ensure that it doesn't get reinitialized either.
- */
- struct ldlm_resource *res = p;
-
- memset(res, 0, sizeof(*res));
- mutex_init(&res->lr_lvb_mutex);
- spin_lock_init(&res->lr_lock);
-}
-