+
+extern const struct lu_device_operations mdt_lu_ops;
+
+static inline int lu_device_is_mdt(struct lu_device *d)
+{
+ return ergo(d != NULL && d->ld_ops != NULL, d->ld_ops == &mdt_lu_ops);
+}
+
+static inline struct mdt_device *lu2mdt_dev(struct lu_device *d)
+{
+ LASSERTF(lu_device_is_mdt(d), "It is %s instead of MDT %p %p\n",
+ d->ld_type->ldt_name, d->ld_ops, &mdt_lu_ops);
+ return container_of0(d, struct mdt_device, mdt_md_dev.md_lu_dev);
+}
+
+static inline char *mdt_obd_name(struct mdt_device *mdt)
+{
+ return mdt->mdt_md_dev.md_lu_dev.ld_obd->obd_name;
+}
+
+int mds_mod_init(void);
+void mds_mod_exit(void);
+
+/* Update handlers */
+int out_handle(struct mdt_thread_info *info);
+
+#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_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, th, name, fid, reply, idx) \
+ __out_tx_index_insert(info, obj, th, name, fid, reply, idx, \
+ __FILE__, __LINE__)
+
+#define out_tx_index_delete(info, obj, th, name, reply, idx) \
+ __out_tx_index_delete(info, obj, th, name, reply, idx, \
+ __FILE__, __LINE__)
+
+