LASSERT(llmv->ll_lslr != NULL);
- OBD_FREE_LARGE(llmv->ll_lslr,
- sizeof(*llmv->ll_lslr) *
- llmv->ll_stripes_allocated);
+ OBD_FREE_PTR_ARRAY_LARGE(llmv->ll_lslr,
+ llmv->ll_stripes_allocated);
OBD_FREE_PTR(llu);
} else {
if (llmv->ll_lslr != NULL)
- OBD_FREE_LARGE(llmv->ll_lslr,
- sizeof(*llmv->ll_lslr) *
+ OBD_FREE_PTR_ARRAY_LARGE(
+ llmv->ll_lslr,
llmv->ll_stripes_allocated);
OBD_FREE_PTR(llmv);
int new_stripes = index + 1;
size_t old_size = sizeof(*lslr) * llmv->ll_stripes_allocated;
- OBD_ALLOC_LARGE(new_lslr, sizeof(*new_lslr) * new_stripes);
+ OBD_ALLOC_PTR_ARRAY_LARGE(new_lslr, new_stripes);
if (new_lslr == NULL) {
llmv->ll_failed = 1;
if (idx == lmv->lmv_master_mdt_index)
return true;
- if (!(lmv->lmv_hash_type & LMV_HASH_FLAG_LAYOUT_CHANGE))
+ if (!lmv_hash_is_layout_changing(lmv->lmv_hash_type))
return false;
idx = lmv_name_to_stripe_index(lmv, name, namelen);
else
count = lmv4->lmv_stripe_count;
- OBD_ALLOC_LARGE(lslr, sizeof(*lslr) * count);
+ OBD_ALLOC_PTR_ARRAY_LARGE(lslr, count);
if (lslr == NULL) {
OBD_FREE_PTR(llu);
}
next:
- CDEBUG(D_LFSCK, "%s: namespace LFSCK repair the shard "
- "%d "DFID" of the striped directory "DFID" with "
- "dangling %s/%s, rename %s/%s, llinkea %s/%s, "
- "repair_lmvea %s/%s: rc = %d\n", lfsck_lfsck2name(lfsck),
- i, PFID(cfid), PFID(pfid),
- create ? "yes" : "no", create_repaired ? "yes" : "no",
- rename ? "yes" : "no", rename_repaired ? "yes" : "no",
- repair_linkea ? "yes" : "no",
- linkea_repaired ? "yes" : "no",
- repair_lmvea ? "yes" : "no",
- lmvea_repaired ? "yes" : "no", rc1);
+ if (create || rename || repair_linkea || repair_lmvea) {
+ CDEBUG(D_LFSCK, "%s: namespace LFSCK repair the shard "
+ "%d "DFID" of the striped directory "DFID" with "
+ "dangling %s/%s, rename %s/%s, llinkea %s/%s, "
+ "repair_lmvea %s/%s: rc = %d\n",
+ lfsck_lfsck2name(lfsck),
+ i, PFID(cfid), PFID(pfid),
+ create ? "yes" : "no",
+ create_repaired ? "yes" : "no",
+ rename ? "yes" : "no",
+ rename_repaired ? "yes" : "no",
+ repair_linkea ? "yes" : "no",
+ linkea_repaired ? "yes" : "no",
+ repair_lmvea ? "yes" : "no",
+ lmvea_repaired ? "yes" : "no", rc1);
+ }
if (obj != NULL && !IS_ERR(obj)) {
lfsck_object_put(env, obj);