+static inline bool lmv_dir_striped(const struct lmv_stripe_md *lsm)
+{
+ return lsm && lsm->lsm_md_magic == LMV_MAGIC;
+}
+
+static inline bool lmv_dir_foreign(const struct lmv_stripe_md *lsm)
+{
+ return lsm && lsm->lsm_md_magic == LMV_MAGIC_FOREIGN;
+}
+
+static inline bool lmv_dir_migrating(const struct lmv_stripe_md *lsm)
+{
+ return lmv_dir_striped(lsm) &&
+ lsm->lsm_md_hash_type & LMV_HASH_FLAG_MIGRATION;
+}
+
+static inline bool lmv_dir_bad_hash(const struct lmv_stripe_md *lsm)
+{
+ if (!lmv_dir_striped(lsm))
+ return false;
+
+ if (lmv_dir_migrating(lsm) &&
+ lsm->lsm_md_stripe_count - lsm->lsm_md_migrate_offset <= 1)
+ return false;
+
+ return !lmv_is_known_hash_type(lsm->lsm_md_hash_type);
+}
+