/*}}}*/ void prepend_child(struct node *child, struct node *parent)/*{{{*/ { child->parent = parent; if (parent) { prepend_node(child, &parent->kids); } else { struct node *narrow_top; narrow_top = get_narrow_top(); prepend_node(child, narrow_top ? &narrow_top->kids : &top); } }
/* Clean up after an error. The caller should usually call do_request() after this function returns. It can be called from an IRQ handler or the normal kernel context. */ void handle_error(const char *from) { u_long flags; if(current_req == NULL) return; save_flags(flags); cli(); kprintf("\nfd: %s (%s): Error (retry number %d)\n", from, REQ_FD_DEV(current_req)->name, current_req->retries); dump_stat(); fd_intr = NULL; if(current_req->retries++ < MAX_RETRIES) { #if 0 if((current_req->retries % RESET_FREQ) == 0) reset_pending = TRUE; #endif if((current_req->retries % RECAL_FREQ) == 0) REQ_FD_DEV(current_req)->recalibrate = TRUE; /* Retry the current request, this simply means stacking it on the front of the queue and calling do_request(). */ prepend_node(&fd_reqs, ¤t_req->node); current_req = NULL; DB(("fd:handle_error: Retrying request %p\n", current_req)); } else { #if 0 reset_pending = TRUE; #endif REQ_FD_DEV(current_req)->recalibrate = TRUE; DB(("\nfd: handle_error: Request %p has no more retries available.\n", current_req)); fd_end_request(-1); } load_flags(flags); }