diff options
author | phk <phk@FreeBSD.org> | 2002-10-08 07:03:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-08 07:03:58 +0000 |
commit | 865428f1db88734bdd0c6789c4e78a14b3e6bd6d (patch) | |
tree | bced54b93a7a10711bb2583ef75de3df4a3d8584 /sys | |
parent | 4e8fedbd217b2d9e452a6112a0fd5d56b6360c84 (diff) | |
download | FreeBSD-src-865428f1db88734bdd0c6789c4e78a14b3e6bd6d.zip FreeBSD-src-865428f1db88734bdd0c6789c4e78a14b3e6bd6d.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/geom_io.c | 61 |
1 files changed, 26 insertions, 35 deletions
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); } |