예제 #1
0
/**
 * Set chunk sectors.
 *
 * @chunk_sectors variable to be set.
 * @pbs physical block size.
 * @q request queue to see io_min parameter.
 */
void set_chunk_sectors(
	unsigned int *chunk_sectors, unsigned int pbs,
	const struct request_queue *q)
{
	unsigned int io_min = queue_io_min((struct request_queue *)q);
	ASSERT(io_min % LOGICAL_BLOCK_SIZE == 0);
	if (pbs < io_min) {
		*chunk_sectors = io_min / LOGICAL_BLOCK_SIZE;
	} else {
		*chunk_sectors = 0;
	}
}
static ssize_t queue_io_min_show(struct request_queue *q, char *page)
{
	return queue_var_show(queue_io_min(q), page);
}