val = simple_strtoul(p, &p, 10); if (val)
blk_queue_flag_set(QUEUE_FLAG_FAIL_IO, q); else
blk_queue_flag_clear(QUEUE_FLAG_FAIL_IO, q);
}
return count;
}
#endif/* CONFIG_FAIL_IO_TIMEOUT */
/** * blk_abort_request - Request recovery for the specified command * @req: pointer to the request of interest * * This function requests that the block layer start recovery for the * request by deleting the timer and calling the q's timeout function. * LLDDs who implement their own error recovery MAY ignore the timeout * event if they generated blk_abort_request.
*/ void blk_abort_request(struct request *req)
{ /* * All we need to ensure is that timeout scan takes place * immediately and that scan sees the new timeout value. * No need for fancy synchronizations.
*/
WRITE_ONCE(req->deadline, jiffies);
kblockd_schedule_work(&req->q->timeout_work);
}
EXPORT_SYMBOL_GPL(blk_abort_request);
/* * Just a rough estimate, we don't care about specific values for timeouts.
*/ staticinlineunsignedlong blk_round_jiffies(unsignedlong j)
{ return (j + blk_timeout_mask) + 1;
}
/** * blk_add_timer - Start timeout timer for a single request * @req: request that is about to start running. * * Notes: * Each request has its own timer, and as it is added to the queue, we * set up the timer. When the request completes, we cancel the timer.
*/ void blk_add_timer(struct request *req)
{ struct request_queue *q = req->q; unsignedlong expiry;
/* * Some LLDs, like scsi, peek at the timeout to prevent a * command from being retried forever.
*/ if (!req->timeout)
req->timeout = q->rq_timeout;
/* * If the timer isn't already pending or this timeout is earlier * than an existing one, modify the timer. Round up to next nearest * second.
*/
expiry = blk_rq_timeout(blk_round_jiffies(expiry));
/* * Due to added timer slack to group timers, the timer * will often be a little in front of what we asked for. * So apply some tolerance here too, otherwise we keep * modifying the timer because expires for value X * will be X + something.
*/ if (!timer_pending(&q->timeout) || (diff >= HZ / 2))
mod_timer(&q->timeout, expiry);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.