Whamcloud - gitweb
LU-1301 mgs: introduce mgs_thread_info
[fs/lustre-release.git] / lustre / mgs / mgs_internal.h
index 0e1fb7e..caee9fd 100644 (file)
@@ -262,6 +262,33 @@ enum {
 void mgs_counter_incr(struct obd_export *exp, int opcode);
 void mgs_stats_counter_init(struct lprocfs_stats *stats);
 
+struct temp_comp
+{
+       struct mgs_target_info  *comp_tmti;
+       struct mgs_target_info  *comp_mti;
+       struct fs_db            *comp_fsdb;
+       struct mgs_device       *comp_mgs;
+       const struct lu_env     *comp_env;
+};
+
+struct mgs_thread_info {
+       struct lustre_cfg_bufs  mgi_bufs;
+       char                    mgi_fsname[MTI_NAME_MAXLEN];
+       struct cfg_marker       mgi_marker;
+       struct temp_comp        mgi_comp;
+};
+
+extern struct lu_context_key mgs_thread_key;
+
+static inline struct mgs_thread_info *mgs_env_info(const struct lu_env *env)
+{
+       struct mgs_thread_info *info;
+
+       info = lu_context_key_get(&env->le_ctx, &mgs_thread_key);
+       LASSERT(info != NULL);
+       return info;
+}
+
 static inline struct mgs_device *exp2mgs_dev(struct obd_export *exp)
 {
        return &exp->exp_obd->u.mgs;