return 0;
}
-static void cmm_split_dump_entry(const struct lu_env *env,
- struct md_object *mo,
- struct lu_dirent *ent)
-{
- struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo));
- struct lu_fid *ef = &cmm_env_info(env)->cmi_fid;
- struct cmm_object *obj;
- int local;
-
- fid_le_to_cpu(ef, &ent->lde_fid);
- obj = cmm_object_find(env, cmm, ef);
- if (IS_ERR(obj)) {
- CERROR("Error while find object by "DFID
- ", rc %d\n", PFID(ef), (int)PTR_ERR(obj));
- return;
- }
-
- local = (lu_object_exists(&obj->cmo_obj.mo_lu) > 0);
-
- printk("%4.4x "DFID" %*.*s/%8.8x [%4.4x] (%s)\n",
- le16_to_cpu(ent->lde_reclen), PFID(ef),
- le16_to_cpu(ent->lde_namelen),
- le16_to_cpu(ent->lde_namelen),
- ent->lde_name, le32_to_cpu(ent->lde_hash),
- le16_to_cpu(ent->lde_namelen),
- (local ? "lc" : "cr"));
-
- cmm_object_put(env, obj);
-}
-
-static void cmm_split_dump_page(const struct lu_env *env,
- struct md_object *mo,
- struct lu_dirpage *dp,
- __u32 hash_end)
-{
- struct lu_dirent *ent;
-
- if (le16_to_cpu(dp->ldp_flags) & LDF_EMPTY)
- return;
-
- printk("Dump: page: [%8.8x-%8.8x]/[%8.8x], flags: "
- "%4.4x\n", le32_to_cpu(dp->ldp_hash_start),
- le32_to_cpu(dp->ldp_hash_end), hash_end,
- le16_to_cpu(dp->ldp_flags));
-
- for (ent = lu_dirent_start(dp);
- ent != NULL && le32_to_cpu(ent->lde_hash) < hash_end;
- ent = lu_dirent_next(ent)) {
- cmm_split_dump_entry(env, mo, ent);
- }
-}
-
/*
* Remove one entry from local MDT. Do not corrupt byte order in page, it will
* be sent to remote MDT.
* currently we assumed it will success anyway in
* verfication test.
*/
- CWARN("Can not del %*.*s, rc %d\n",
- le16_to_cpu(ent->lde_namelen),
- le16_to_cpu(ent->lde_namelen),
- ent->lde_name, rc);
- cmm_split_dump_page(env, mo, dp, hash_end);
+ CERROR("Can not del %*.*s, rc %d\n",
+ le16_to_cpu(ent->lde_namelen),
+ le16_to_cpu(ent->lde_namelen),
+ ent->lde_name, rc);
GOTO(unmap, rc);
}
*len += lu_dirent_size(ent);
}
LASSERT(ma->ma_valid & MA_LMV);
- /* we need range of hashes, so MAX_HASH_SIZE + 1 */
hash_segement = MAX_HASH_SIZE / (cmm->cmm_tgt_count + 1);
for (i = 1; i < cmm->cmm_tgt_count + 1; i++) {
struct lu_fid *lf;
recsize = (sizeof(*ent) + len + 3) & ~3;
hash = iops->store(env, it);
- if (ent != area) {
- /*
- * This is not first entry, *start is initialized so
- * that we can check hash for validness, that is, if it
- * fits into allowed range. It should not be smaller
- * than *start. Otherwise - iam iterator is buggy.
- */
- if (hash < *start) {
- CERROR("Entry hash (%#8.8x) < page hash (%#8.8x) - ["
- "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"]\n",
- hash, *start, name, ent, nob, PFID(fid2), hash,
- len, len, len, name);
- result = iops->next(env, it);
- continue;
- }
- }
-
*end = hash;
CDEBUG(D_INFO, "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"\n",