static inline struct mgs_thread_info *mgs_env_info(const struct lu_env *env)
{
- struct mgs_thread_info *info;
- int rc;
-
- info = lu_context_key_get(&env->le_ctx, &mgs_thread_key);
- if (info == NULL) {
- rc = lu_env_refill((struct lu_env *)env);
- if (rc != 0)
- return ERR_PTR(rc);
- info = lu_context_key_get(&env->le_ctx, &mgs_thread_key);
- }
- LASSERT(info != NULL);
- return info;
+ return lu_env_info(env, &mgs_thread_key);
}
extern const struct lu_device_operations mgs_lu_ops;