if (likely(!IS_ERR(o)))
fo = ofd_obj(o);
else
- fo = (struct ofd_object *)o; /* return error */
+ fo = ERR_CAST(o); /* return error */
+
RETURN(fo);
}
dto = dt_find_or_create(env, ofd->ofd_osd, fid, &info->fti_dof, attr);
if (IS_ERR(dto))
- RETURN((struct ofd_object *)dto);
+ RETURN(ERR_CAST(dto));
fo_obj = lu_object_locate(dto->do_lu.lo_header,
ofd->ofd_dt_dev.dd_lu_dev.ld_type);
rc = ostid_to_fid(&info->fti_fid, &info->fti_ostid, 0);
if (rc) {
if (i == 0)
- GOTO(out, rc = PTR_ERR(fo));
+ GOTO(out, rc);
nr = i;
break;
lu_object_put(env, luch);
child = ERR_PTR(-ENOENT);
}
- } else
- child = (void *)luch;
+ } else {
+ child = ERR_CAST(luch);
+ }
- return child;
+ return child;
}
/**
CERROR("%s: Can not find object "DFID"%u:%u: rc = %d\n",
osd_name(osd), PFID(fid),
id->oii_ino, id->oii_gen,
- (int)PTR_ERR(child_inode));
- RETURN(PTR_ERR(child_inode));
+ (int)PTR_ERR(child));
+ RETURN(PTR_ERR(child));
}
child_inode = igrab(child->oo_inode);
}
db = osd_create_type_f(dof->dof_type)(env, osd, attr, zapid, oh);
if (IS_ERR(db))
- GOTO(out, rc = PTR_ERR(th));
+ GOTO(out, rc = PTR_ERR(db));
zde->zde_pad = 0;
zde->zde_dnode = db->db_object;