CERROR("Can't have %d CPTs for LNet (max allowed is %d), "
"please change setting of CPT-table and retry\n",
the_lnet.ln_cpt_number, LNET_CPT_MAX);
- return -1;
+ return -E2BIG;
}
while ((1 << the_lnet.ln_cpt_bits) < the_lnet.ln_cpt_number)
rc = lnet_create_locks();
if (rc != 0) {
CERROR("Can't create LNet global locks: %d\n", rc);
- return -1;
+ return rc;
}
the_lnet.ln_refcount = 0;
net_config = (struct lnet_ioctl_net_config *)
config->cfg_bulk;
if (net_config == NULL)
- return -1;
+ return -EINVAL;
return lnet_get_net_config(config->cfg_count,
&config->cfg_ncpts,
ltb = lnet_new_text_buf(nob);
if (ltb == NULL) {
lnet_free_text_bufs(&pending);
- return -1;
+ return -ENOMEM;
}
for (i = 0; i < nob; i++)
failed:
lnet_free_text_bufs(&pending);
- return -1;
+ return -EINVAL;
}
static int
/* Update the caller's token pointer so it treats the found
priority as the token to report in the error message. */
*token += sep - str + 1;
- return -1;
+ return -EINVAL;
}
CDEBUG(D_NET, "gateway %s, priority %d, nob %d\n", str, *priority, nob);
cfs_time_t now;
if (tms == 0)
- return -1; /* don't want to wait and no new event */
+ return -ENXIO; /* don't want to wait and no new event */
init_waitqueue_entry(&wl, current);
set_current_state(TASK_INTERRUPTIBLE);
return 1;
if (r1->lr_priority > r2->lr_priority)
- return -1;
+ return -ERANGE;
if (r1_hops < r2_hops)
return 1;
if (r1_hops > r2_hops)
- return -1;
+ return -ERANGE;
if (p1->lp_txqnob < p2->lp_txqnob)
return 1;
if (p1->lp_txqnob > p2->lp_txqnob)
- return -1;
+ return -ERANGE;
if (p1->lp_txcredits > p2->lp_txcredits)
return 1;
if (p1->lp_txcredits < p2->lp_txcredits)
- return -1;
+ return -ERANGE;
if (r1->lr_seq - r2->lr_seq <= 0)
return 1;
- return -1;
+ return -ERANGE;
}
static lnet_peer_t *
libcfs_id2str(info.mi_id), info.mi_portal,
info.mi_mbits, info.mi_roffset, info.mi_rlength, rc);
- return ENOENT; /* +ve: OK but no match */
+ return -ENOENT; /* -ve: OK but no match */
}
}
" offset %d length %d\n",
libcfs_id2str(info.mi_id), info.mi_portal,
info.mi_mbits, info.mi_roffset, info.mi_rlength);
- return ENOENT; /* +ve: OK but no match */
+ return -ENOENT; /* -ve: OK but no match */
}
LASSERT(rc == LNET_MATCHMD_OK);
md->md_me->me_portal);
lnet_res_unlock(cpt);
- return ENOENT; /* +ve: OK but no match */
+ return -ENOENT; /* -ve: OK but no match */
}
LASSERT (md->md_offset == 0);
rlength, hdr->msg.reply.dst_wmd.wh_object_cookie,
mlength);
lnet_res_unlock(cpt);
- return ENOENT; /* +ve: OK but no match */
+ return -ENOENT; /* -ve: OK but no match */
}
CDEBUG(D_NET, "%s: Reply from %s of length %d/%d into md "LPX64"\n",
md->md_me->me_portal);
lnet_res_unlock(cpt);
- return ENOENT; /* +ve! */
+ return -ENOENT; /* -ve! */
}
CDEBUG(D_NET, "%s: ACK from %s into md "LPX64"\n",
return -EPROTO;
}
- LASSERT(rc == 0 || rc == ENOENT);
+ LASSERT(rc == 0 || rc == -ENOENT);
return rc;
}
if (nf != NULL)
return nf->nf_type;
- return -1;
+ return -ENXIO;
}
EXPORT_SYMBOL(libcfs_str2lnd);
LCONSOLE_ERROR_MSG(0x10c,
"tiny_router_buffers=%d invalid when "
"routing enabled\n", tiny_router_buffers);
- return -1;
+ return -EINVAL;
}
if (tiny_router_buffers > 0)
LCONSOLE_ERROR_MSG(0x10c,
"small_router_buffers=%d invalid when "
"routing enabled\n", small_router_buffers);
- return -1;
+ return -EINVAL;
}
if (small_router_buffers > 0)
LCONSOLE_ERROR_MSG(0x10c,
"large_router_buffers=%d invalid when "
"routing enabled\n", large_router_buffers);
- return -1;
+ return -EINVAL;
}
if (large_router_buffers > 0)