+#define MGS_SERVICE_WATCHDOG_FACTOR (2)
+
+int tgt_request_handle(struct ptlrpc_request *req);
+
+/* check if request's xid is equal to last one or not*/
+static inline int req_xid_is_last(struct ptlrpc_request *req)
+{
+ struct lsd_client_data *lcd = req->rq_export->exp_target_data.ted_lcd;
+
+ LASSERT(lcd != NULL);
+ return (req->rq_xid == lcd->lcd_last_xid ||
+ req->rq_xid == lcd->lcd_last_close_xid);
+}
+
+static inline char *dt_obd_name(struct dt_device *dt)
+{
+ return dt->dd_lu_dev.ld_obd->obd_name;
+}
+
+/* Update handlers */
+int out_handle(struct tgt_session_info *tsi);
+
+#define out_tx_create(info, obj, attr, fid, dof, th, reply, idx) \
+ __out_tx_create(info, obj, attr, fid, dof, th, reply, idx, \
+ __FILE__, __LINE__)
+
+#define out_tx_attr_set(info, obj, attr, th, reply, idx) \
+ __out_tx_attr_set(info, obj, attr, th, reply, idx, \
+ __FILE__, __LINE__)
+
+#define out_tx_xattr_set(info, obj, buf, name, fl, th, reply, idx) \
+ __out_tx_xattr_set(info, obj, buf, name, fl, th, reply, idx, \
+ __FILE__, __LINE__)
+
+#define out_tx_xattr_del(info, obj, name, th, reply, idx) \
+ __out_tx_xattr_del(info, obj, name, th, reply, idx, \
+ __FILE__, __LINE__)
+
+#define out_tx_ref_add(info, obj, th, reply, idx) \
+ __out_tx_ref_add(info, obj, th, reply, idx, __FILE__, __LINE__)
+
+#define out_tx_ref_del(info, obj, th, reply, idx) \
+ __out_tx_ref_del(info, obj, th, reply, idx, __FILE__, __LINE__)
+
+#define out_tx_index_insert(info, obj, rec, key, th, reply, idx) \
+ __out_tx_index_insert(info, obj, rec, key, th, reply, idx, \
+ __FILE__, __LINE__)
+
+#define out_tx_index_delete(info, obj, key, th, reply, idx) \
+ __out_tx_index_delete(info, obj, key, th, reply, idx, \
+ __FILE__, __LINE__)
+
+#define out_tx_destroy(info, obj, th, reply, idx) \
+ __out_tx_destroy(info, obj, th, reply, idx, __FILE__, __LINE__)
+
+#define out_tx_write(info, obj, buf, pos, th, reply, idx) \
+ __out_tx_write(info, obj, buf, pos, th, reply, idx, __FILE__, __LINE__)
+
+const char *update_op_str(__u16 opcode);
+
+extern struct page *tgt_page_to_corrupt;
+
+struct tgt_thread_big_cache {
+ struct niobuf_local local[PTLRPC_MAX_BRW_PAGES];
+};
+
+int tgt_server_data_init(const struct lu_env *env, struct lu_target *tgt);
+int tgt_txn_start_cb(const struct lu_env *env, struct thandle *th,
+ void *cookie);
+int tgt_txn_stop_cb(const struct lu_env *env, struct thandle *th,
+ void *cookie);
+
+void update_records_dump(const struct update_records *records,
+ unsigned int mask, bool dump_updates);
+int check_and_prepare_update_record(const struct lu_env *env,
+ struct thandle_update_records *tur);
+
+struct update_thread_info {
+ struct lu_attr uti_attr;
+ struct lu_fid uti_fid;
+ struct lu_buf uti_buf;
+ struct thandle_update_records uti_tur;
+ struct obdo uti_obdo;
+};
+
+extern struct lu_context_key update_thread_key;
+
+static inline struct update_thread_info *
+update_env_info(const struct lu_env *env)
+{
+ struct update_thread_info *uti;
+
+ uti = lu_context_key_get(&env->le_ctx, &update_thread_key);
+ LASSERT(uti != NULL);
+ return uti;
+}
+
+void update_info_init(void);
+void update_info_fini(void);