iops = &obj->do_index_ops->dio_it;
it = iops->init(env, obj, BYPASS_CAPA);
- if (it != NULL) {
+ if (!IS_ERR(it)) {
result = iops->get(env, it, (const void *)"");
if (result > 0) {
int i;
iops->put(env, it);
iops->fini(env, it);
} else
- result = -ENOMEM;
+ result = PTR_ERR(it);
RETURN(result);
}
iops = &dor->do_index_ops->dio_it;
it = iops->init(env, dor, BYPASS_CAPA);
- if (it != NULL) {
+ if (!IS_ERR(it)) {
result = iops->load(env, it, 0);
if (result > 0) {
/* main cycle */
iops->put(env, it);
iops->fini(env, it);
} else {
- CERROR("not enough memory for clean pending.\n");
- result = -ENOMEM;
+ result = PTR_ERR(it);
+ CERROR("Cannot clean pending (%d).\n", result);
}
RETURN(result);