It is consider bad style in the linux kernel to
return -1 or a positive number for an error.
Instead return the appropriate error codes.
Change-Id: Icd9729de84f162b07df17caab48e7693459a03e8
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/17626
Tested-by: Jenkins
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
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);
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);
}
while ((1 << the_lnet.ln_cpt_bits) < the_lnet.ln_cpt_number)
}
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);
rc = lnet_create_locks();
if (rc != 0) {
CERROR("Can't create LNet global locks: %d\n", rc);
}
the_lnet.ln_refcount = 0;
}
the_lnet.ln_refcount = 0;
net_config = (struct lnet_ioctl_net_config *)
config->cfg_bulk;
if (net_config == NULL)
net_config = (struct lnet_ioctl_net_config *)
config->cfg_bulk;
if (net_config == NULL)
return lnet_get_net_config(config->cfg_count,
&config->cfg_ncpts,
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);
ltb = lnet_new_text_buf(nob);
if (ltb == NULL) {
lnet_free_text_bufs(&pending);
}
for (i = 0; i < nob; i++)
}
for (i = 0; i < nob; i++)
failed:
lnet_free_text_bufs(&pending);
failed:
lnet_free_text_bufs(&pending);
/* 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;
/* 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;
}
CDEBUG(D_NET, "gateway %s, priority %d, nob %d\n", str, *priority, nob);
}
CDEBUG(D_NET, "gateway %s, priority %d, nob %d\n", str, *priority, nob);
cfs_time_t now;
if (tms == 0)
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);
init_waitqueue_entry(&wl, current);
set_current_state(TASK_INTERRUPTIBLE);
return 1;
if (r1->lr_priority > r2->lr_priority)
return 1;
if (r1->lr_priority > r2->lr_priority)
if (r1_hops < r2_hops)
return 1;
if (r1_hops > r2_hops)
if (r1_hops < r2_hops)
return 1;
if (r1_hops > r2_hops)
if (p1->lp_txqnob < p2->lp_txqnob)
return 1;
if (p1->lp_txqnob > p2->lp_txqnob)
if (p1->lp_txqnob < p2->lp_txqnob)
return 1;
if (p1->lp_txqnob > p2->lp_txqnob)
if (p1->lp_txcredits > p2->lp_txcredits)
return 1;
if (p1->lp_txcredits < p2->lp_txcredits)
if (p1->lp_txcredits > p2->lp_txcredits)
return 1;
if (p1->lp_txcredits < p2->lp_txcredits)
if (r1->lr_seq - r2->lr_seq <= 0)
return 1;
if (r1->lr_seq - r2->lr_seq <= 0)
return 1;
libcfs_id2str(info.mi_id), info.mi_portal,
info.mi_mbits, info.mi_roffset, info.mi_rlength, rc);
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);
" 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);
}
LASSERT(rc == LNET_MATCHMD_OK);
md->md_me->me_portal);
lnet_res_unlock(cpt);
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);
}
LASSERT (md->md_offset == 0);
rlength, hdr->msg.reply.dst_wmd.wh_object_cookie,
mlength);
lnet_res_unlock(cpt);
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",
}
CDEBUG(D_NET, "%s: Reply from %s of length %d/%d into md "LPX64"\n",
md->md_me->me_portal);
lnet_res_unlock(cpt);
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",
}
CDEBUG(D_NET, "%s: ACK from %s into md "LPX64"\n",
- LASSERT(rc == 0 || rc == ENOENT);
+ LASSERT(rc == 0 || rc == -ENOENT);
if (nf != NULL)
return nf->nf_type;
if (nf != NULL)
return nf->nf_type;
}
EXPORT_SYMBOL(libcfs_str2lnd);
}
EXPORT_SYMBOL(libcfs_str2lnd);
LCONSOLE_ERROR_MSG(0x10c,
"tiny_router_buffers=%d invalid when "
"routing enabled\n", tiny_router_buffers);
LCONSOLE_ERROR_MSG(0x10c,
"tiny_router_buffers=%d invalid when "
"routing enabled\n", tiny_router_buffers);
}
if (tiny_router_buffers > 0)
}
if (tiny_router_buffers > 0)
LCONSOLE_ERROR_MSG(0x10c,
"small_router_buffers=%d invalid when "
"routing enabled\n", small_router_buffers);
LCONSOLE_ERROR_MSG(0x10c,
"small_router_buffers=%d invalid when "
"routing enabled\n", small_router_buffers);
}
if (small_router_buffers > 0)
}
if (small_router_buffers > 0)
LCONSOLE_ERROR_MSG(0x10c,
"large_router_buffers=%d invalid when "
"routing enabled\n", large_router_buffers);
LCONSOLE_ERROR_MSG(0x10c,
"large_router_buffers=%d invalid when "
"routing enabled\n", large_router_buffers);
}
if (large_router_buffers > 0)
}
if (large_router_buffers > 0)