if: report error codes

This commit is contained in:
Thomas Schoebel-Theuer 2016-02-01 09:05:30 +01:00 committed by Thomas Schoebel-Theuer
parent 61bbdec62f
commit 1c6a89f70b
2 changed files with 5 additions and 0 deletions

View File

@ -259,6 +259,8 @@ void if_endio(struct generic_callback *cb)
int bi_size = bio->bi_size;
#endif
// end_remove_this
if (likely(input->brick))
input->brick->error_code = error;
MARS_ERR("NYI: error=%d RETRY LOGIC %u\n", error, bi_size);
} else { // bio conventions are slightly different...
error = 0;
@ -802,6 +804,7 @@ err:
if (error < 0) {
MARS_ERR("cannot submit request from bio, status=%d\n", error);
if (!assigned) {
brick->error_code = error;
_call_bio_endio(bio, error);
}
}
@ -1271,6 +1274,7 @@ if_release(struct gendisk *gd, fmode_t mode)
wait_io_done(brick);
MARS_DBG("status button=%d led_on=%d led_off=%d\n", brick->power.button, brick->power.led_on, brick->power.led_off);
brick->error_code = 0;
mars_trigger();
mars_remote_trigger();
}

View File

@ -110,6 +110,7 @@ struct if_brick {
atomic_t open_count;
atomic_t flying_count;
struct mars_limiter io_limiter;
int error_code;
// private
struct semaphore switch_sem;
struct say_channel *say_channel;