mirror of
https://github.com/schoebel/mars
synced 2024-12-26 00:22:31 +00:00
infra: move io_timeout to generic interface
This is needed for the next commit.
This commit is contained in:
parent
ee2f544994
commit
1295c43a7a
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user