if: redirect messages of external threads to resource channels

This commit is contained in:
Thomas Schoebel-Theuer 2012-11-15 13:53:26 +01:00 committed by Thomas Schoebel-Theuer
parent f88c3c12ad
commit ea9068e992
3 changed files with 8 additions and 1 deletions

View File

@ -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",

View File

@ -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);

View File

@ -80,6 +80,7 @@ struct if_brick {
// inspectable
// private
struct semaphore switch_sem;
struct say_channel *say_channel;
};
MARS_TYPES(if);