infra: move io_timeout to generic interface

This is needed for the next commit.
This commit is contained in:
Thomas Schoebel-Theuer 2014-09-27 09:28:24 +02:00
parent ee2f544994
commit 1295c43a7a
4 changed files with 8 additions and 9 deletions

View File

@ -249,11 +249,12 @@ struct generic_output_ops;
struct generic_brick_type;
struct generic_switch {
bool button;
bool led_on;
bool led_off;
bool force_off;
int percent_done;
bool button; /* in: main switch (on/off) */
bool led_on; /* out: indicate regular operation */
bool led_off; /* out: indicate no activity of any kind */
bool force_off; /* in: make ready for destruction */
int io_timeout; /* in: report IO errors after timeout (seconds) */
int percent_done; /* out: generic progress indicator */
wait_queue_head_t event;
};

View File

@ -404,7 +404,7 @@ void _do_timeout(struct client_output *output, struct list_head *anchor, bool fo
struct list_head *next;
LIST_HEAD(tmp_list);
int rounds = 0;
long io_timeout = brick->io_timeout;
long io_timeout = brick->power.io_timeout;
unsigned long flags;
if (io_timeout <= 0)
@ -639,7 +639,7 @@ char *client_statistics(struct client_brick *brick, int verbose)
"fly_count = %d\n",
output->socket.s_debug_nr,
brick->max_flying,
brick->io_timeout,
brick->power.io_timeout,
atomic_read(&output->timeout_count),
atomic_read(&output->fly_count));

View File

@ -23,7 +23,6 @@ struct client_brick {
MARS_BRICK(client);
// tunables
int max_flying; // limit on parallelism
int io_timeout; // > 0: report IO errors after timeout (in seconds)
bool limit_mode;
// readonly from outside
int connection_state; // 0 = switched off, 1 = not connected, 2 = connected

View File

@ -635,7 +635,6 @@ int _set_client_params(struct mars_brick *_brick, void *private)
{
struct client_brick *client_brick = (void*)_brick;
struct client_cookie *clc = private;
client_brick->io_timeout = 0;
client_brick->limit_mode = clc ? clc->limit_mode : false;
client_brick->killme = true;
MARS_INF("name = '%s' path = '%s'\n", _brick->brick_name, _brick->brick_path);