-static bool mdt_object_is_shard(struct mdt_thread_info *info,
- struct mdt_object *obj)
-{
- struct lmv_mds_md_v1 *lmv = (struct lmv_mds_md_v1 *)info->mti_xattr_buf;
- struct lu_buf buf;
- int rc;
-
- if (!mdt_object_exists(obj))
- return false;
-
- if (!S_ISDIR(lu_object_attr(&obj->mot_obj)))
- return false;
-
- buf.lb_buf = lmv;
- buf.lb_len = sizeof(*lmv);
- rc = mo_xattr_get(info->mti_env, mdt_object_child(obj), &buf,
- XATTR_NAME_LMV);
- if (rc < 0)
- return false;
-
- return lmv->lmv_magic == cpu_to_le32(LMV_MAGIC_STRIPE);
-}
-