+/* for file under migrating directory, return the target stripe info */
+static inline const struct lmv_oinfo *
+lsm_name_to_stripe_info(const struct lmv_stripe_md *lsm, const char *name,
+ int namelen, bool new_layout)
+{
+ int stripe_index;
+
+ LASSERT(lmv_dir_striped(lsm));
+
+ stripe_index = __lmv_name_to_stripe_index(lsm->lsm_md_hash_type,
+ lsm->lsm_md_stripe_count,
+ lsm->lsm_md_migrate_hash,
+ lsm->lsm_md_migrate_offset,
+ name, namelen, new_layout);
+ if (stripe_index < 0)
+ return ERR_PTR(stripe_index);
+
+ return &lsm->lsm_md_oinfo[stripe_index];
+}
+
+static inline bool lmv_dir_retry_check_update(struct md_op_data *op_data)
+{
+ const struct lmv_stripe_md *lsm = op_data->op_mea1;
+
+ if (!lsm)
+ return false;
+
+ if (lmv_dir_layout_changing(lsm) && !op_data->op_new_layout) {
+ op_data->op_new_layout = true;
+ return true;
+ }
+
+ if (lmv_dir_bad_hash(lsm) &&
+ op_data->op_stripe_index < lsm->lsm_md_stripe_count - 1) {
+ op_data->op_stripe_index++;
+ return true;
+ }
+
+ return false;
+}
+
+struct lmv_tgt_desc *lmv_locate_tgt(struct lmv_obd *lmv,
+ struct md_op_data *op_data);
+int lmv_old_layout_lookup(struct lmv_obd *lmv, struct md_op_data *op_data);
+
+/* lproc_lmv.c */
+int lmv_tunables_init(struct obd_device *obd);