From ea9068e9921c2da59a119d15000dfb89d369c084 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 15 Nov 2012 13:53:26 +0100 Subject: [PATCH] if: redirect messages of external threads to resource channels --- brick_say.c | 2 +- mars_if.c | 6 ++++++ mars_if.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brick_say.c b/brick_say.c index 27dbea93..d575dffa 100644 --- a/brick_say.c +++ b/brick_say.c @@ -29,7 +29,7 @@ #define SAY_ORDER 0 #define SAY_BUFMAX (PAGE_SIZE << SAY_ORDER) #define MAX_FILELEN 16 -#define MAX_IDS 64 +#define MAX_IDS 1000 char *say_class[MAX_SAY_CLASS] = { [SAY_DEBUG] = "debug", diff --git a/mars_if.c b/mars_if.c index dc4e7b02..e899d604 100644 --- a/mars_if.c +++ b/mars_if.c @@ -274,6 +274,8 @@ if_make_request(struct request_queue *q, struct bio *bio) int total_len = bio->bi_size; int error = -ENOSYS; + bind_to_channel(brick->say_channel, current); + MARS_IO("bio %p " "size = %d " "rw = %d " @@ -576,6 +578,8 @@ err: #endif done: + remove_binding_from(brick->say_channel, current); + #ifdef BIO_CPU_AFFINE return error; #else @@ -661,6 +665,8 @@ static int if_switch(struct if_brick *brick) if (brick->power.button && brick->power.led_off) { mars_power_led_off((void*)brick, false); + brick->say_channel = get_binding(current); + capacity = compute_capacity(brick); status = -ENOMEM; q = blk_alloc_queue(GFP_MARS); diff --git a/mars_if.h b/mars_if.h index 87b82f64..185a9ca5 100644 --- a/mars_if.h +++ b/mars_if.h @@ -80,6 +80,7 @@ struct if_brick { // inspectable // private struct semaphore switch_sem; + struct say_channel *say_channel; }; MARS_TYPES(if);