The wq->spec.errorfunc is never used in the code.
It's been in the code base since 2005 and I also
do not remember ever seeing it being called. No
workqueue process function ever returns error.
Since it's not used let's just remove it from the
code base.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
/* dont run items which are past their allowed retries */
if (item->ran > wq->spec.max_retries) {
- /* run error handler, if any */
- if (wq->spec.errorfunc)
- wq->spec.errorfunc(wq, item);
work_queue_item_remove(wq, item);
continue;
}
case WQ_RETRY_NOW:
/* a RETRY_NOW that gets here has exceeded max_tries, same as
* ERROR */
- case WQ_ERROR: {
- if (wq->spec.errorfunc)
- wq->spec.errorfunc(wq, item);
- }
/* fallthru */
case WQ_SUCCESS:
default: {
/* action value, for use by item processor and item error handlers */
typedef enum {
WQ_SUCCESS = 0,
- WQ_ERROR, /* Error, run error handler if provided */
WQ_RETRY_NOW, /* retry immediately */
WQ_RETRY_LATER, /* retry later, cease processing work queue */
WQ_REQUEUE, /* requeue item, continue processing work queue */
*/
wq_item_status (*workfunc)(struct work_queue *, void *);
- /* error handling function, optional */
- void (*errorfunc)(struct work_queue *,
- struct work_queue_item *);
-
/* callback to delete user specific item data */
void (*del_item_data)(struct work_queue *, void *);
return;
}
-static void slow_func_err(struct work_queue *wq, struct work_queue_item *item)
-{
- printf("%s: running error function\n", __func__);
-}
-
static void slow_func_del(struct work_queue *wq, void *data)
{
struct heavy_wq_node *hn = data;
heavy_wq = work_queue_new(master, "heavy_work_queue");
heavy_wq->spec.workfunc = &slow_func;
- heavy_wq->spec.errorfunc = &slow_func_err;
heavy_wq->spec.del_item_data = &slow_func_del;
heavy_wq->spec.max_retries = 3;
heavy_wq->spec.hold = 1000;
zrouter.lsp_process_q->spec.workfunc = &lsp_process;
zrouter.lsp_process_q->spec.del_item_data = &lsp_processq_del;
- zrouter.lsp_process_q->spec.errorfunc = NULL;
zrouter.lsp_process_q->spec.completion_func = &lsp_processq_complete;
zrouter.lsp_process_q->spec.max_retries = 0;
zrouter.lsp_process_q->spec.hold = 10;
/* fill in the work queue spec */
zrouter.ribq->spec.workfunc = &meta_queue_process;
- zrouter.ribq->spec.errorfunc = NULL;
zrouter.ribq->spec.completion_func = NULL;
/* XXX: TODO: These should be runtime configurable via vty */
zrouter.ribq->spec.max_retries = 3;