From 865428f1db88734bdd0c6789c4e78a14b3e6bd6d Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 8 Oct 2002 07:03:58 +0000 Subject: For now, don't wait for drives to stop returning EBUSY. There is too much broken harware around it seems. Sponsored by: DARPA & NAI Labs. --- sys/geom/geom_io.c | 61 +++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 35 deletions(-) (limited to 'sys/geom/geom_io.c') diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 0846d8a..f1d21da 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -192,21 +192,16 @@ g_io_getattr(const char *attr, struct g_consumer *cp, int *len, void *ptr) int error; g_trace(G_T_BIO, "bio_getattr(%s)", attr); - do { - bp = g_new_bio(); - bp->bio_cmd = BIO_GETATTR; - bp->bio_done = NULL; - bp->bio_attribute = attr; - bp->bio_length = *len; - bp->bio_data = ptr; - g_io_request(bp, cp); - error = biowait(bp, "ggetattr"); - *len = bp->bio_completed; - g_destroy_bio(bp); - if (error == EBUSY) - tsleep(&error, 0, "getattr_busy", hz); - - } while(error == EBUSY); + bp = g_new_bio(); + bp->bio_cmd = BIO_GETATTR; + bp->bio_done = NULL; + bp->bio_attribute = attr; + bp->bio_length = *len; + bp->bio_data = ptr; + g_io_request(bp, cp); + error = biowait(bp, "ggetattr"); + *len = bp->bio_completed; + g_destroy_bio(bp); return (error); } @@ -355,26 +350,22 @@ g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error) void *ptr; int errorc; - do { - bp = g_new_bio(); - bp->bio_cmd = BIO_READ; - bp->bio_done = NULL; - bp->bio_offset = offset; - bp->bio_length = length; - ptr = g_malloc(length, M_WAITOK); - bp->bio_data = ptr; - g_io_request(bp, cp); - errorc = biowait(bp, "gread"); - if (error != NULL) - *error = errorc; - g_destroy_bio(bp); - if (errorc) { - g_free(ptr); - ptr = NULL; - } - if (errorc == EBUSY) - tsleep(&errorc, 0, "g_read_data_busy", hz); - } while (errorc == EBUSY); + bp = g_new_bio(); + bp->bio_cmd = BIO_READ; + bp->bio_done = NULL; + bp->bio_offset = offset; + bp->bio_length = length; + ptr = g_malloc(length, M_WAITOK); + bp->bio_data = ptr; + g_io_request(bp, cp); + errorc = biowait(bp, "gread"); + if (error != NULL) + *error = errorc; + g_destroy_bio(bp); + if (errorc) { + g_free(ptr); + ptr = NULL; + } return (ptr); } -- cgit v1.1