+static inline bool mdt_is_rootadmin(struct mdt_thread_info *info)
+{
+ struct lu_ucred *uc = NULL;
+ bool is_admin;
+ int rc;
+
+ if (info == NULL || info->mti_body == NULL)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 17, 3, 0)
+ /* return true in case old client did not send mdt body */
+ return true;
+#else
+ return false
+#endif
+
+ rc = mdt_init_ucred(info, (struct mdt_body *)info->mti_body);
+ if (rc < 0)
+ return false;
+
+ uc = mdt_ucred(info);
+ is_admin = (uc->uc_uid == 0 && uc->uc_gid == 0 &&
+ md_capable(uc, CFS_CAP_SYS_ADMIN));
+
+ mdt_exit_ucred(info);
+
+ return is_admin;
+}
+
+int mdt_reint_migrate(struct mdt_thread_info *info,
+ struct mdt_lock_handle *unused);
+int mdt_dir_layout_update(struct mdt_thread_info *info);
+
+/* directory restripe */
+int mdt_restripe_internal(struct mdt_thread_info *info,
+ struct mdt_object *parent,
+ struct mdt_object *child,
+ const struct lu_name *lname,
+ struct lu_fid *tfid,
+ struct md_op_spec *spec,
+ struct md_attr *ma);
+int mdt_restriper_start(struct mdt_device *mdt);
+void mdt_restriper_stop(struct mdt_device *mdt);
+void mdt_auto_split_add(struct mdt_thread_info *info, struct mdt_object *o);
+void mdt_restripe_migrate_add(struct mdt_thread_info *info,
+ struct mdt_object *o);
+void mdt_restripe_update_add(struct mdt_thread_info *info,
+ struct mdt_object *o);
+int mdt_is_remote_object(struct mdt_thread_info *info,
+ struct mdt_object *parent,
+ struct mdt_object *child);
+