summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/atapi-cd.c9
-rw-r--r--sys/dev/ata/atapi-tape.c8
-rw-r--r--sys/dev/ata/atapi-tape.h2
3 files changed, 7 insertions, 12 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index e7d98d6..4a33b91 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -159,7 +159,7 @@ acdattach(struct ata_device *atadev)
tmpcdp->slot = count;
tmpcdp->changer_info = chp;
acd_make_dev(tmpcdp);
- devstat_add_entry(tmpcdp->stats, "acd", tmpcdp->lun, DEV_BSIZE,
+ tmpcdp->stats = devstat_new_entry("acd", tmpcdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_CD);
@@ -178,7 +178,7 @@ acdattach(struct ata_device *atadev)
}
else {
acd_make_dev(cdp);
- devstat_add_entry(cdp->stats, "acd", cdp->lun, DEV_BSIZE,
+ cdp->stats = devstat_new_entry("acd", cdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_CD);
@@ -249,11 +249,6 @@ acd_init_lun(struct ata_device *atadev)
cdp->block_size = 2048;
cdp->slot = -1;
cdp->changer_info = NULL;
- if (!(cdp->stats = malloc(sizeof(struct devstat), M_ACD,
- M_NOWAIT | M_ZERO))) {
- free(cdp, M_ACD);
- return NULL;
- }
return cdp;
}
diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c
index b81dd94..5aecc16 100644
--- a/sys/dev/ata/atapi-tape.c
+++ b/sys/dev/ata/atapi-tape.c
@@ -122,7 +122,7 @@ astattach(struct ata_device *atadev)
ast_read_position(stp, 0, &position);
}
- devstat_add_entry(&stp->stats, "ast", stp->lun, DEV_BSIZE,
+ stp->stats = devstat_new_entry("ast", stp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_SEQUENTIAL | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_TAPE);
@@ -154,7 +154,7 @@ astdetach(struct ata_device *atadev)
}
destroy_dev(stp->dev1);
destroy_dev(stp->dev2);
- devstat_remove_entry(&stp->stats);
+ devstat_remove_entry(stp->stats);
ata_free_name(atadev);
ata_free_lun(&ast_lun_map, stp->lun);
free(stp, M_AST);
@@ -477,7 +477,7 @@ ast_start(struct ata_device *atadev)
ccb[3] = blkcount>>8;
ccb[4] = blkcount;
- devstat_start_transaction(&stp->stats);
+ devstat_start_transaction(stp->stats);
atapi_queue_cmd(stp->device, ccb, bp->bio_data, blkcount * stp->blksize,
(bp->bio_cmd == BIO_READ) ? ATPR_F_READ : 0,
@@ -500,7 +500,7 @@ ast_done(struct atapi_request *request)
bp->bio_resid = bp->bio_bcount - request->donecount;
ast_total += (bp->bio_bcount - bp->bio_resid);
}
- biofinish(bp, &stp->stats, 0);
+ biofinish(bp, stp->stats, 0);
return 0;
}
diff --git a/sys/dev/ata/atapi-tape.h b/sys/dev/ata/atapi-tape.h
index 96ef84e..18b4449 100644
--- a/sys/dev/ata/atapi-tape.h
+++ b/sys/dev/ata/atapi-tape.h
@@ -157,6 +157,6 @@ struct ast_softc {
struct bio_queue_head queue; /* queue of i/o requests */
struct atapi_params *param; /* drive parameters table */
struct ast_cappage cap; /* capabilities page info */
- struct devstat stats; /* devstat entry */
+ struct devstat *stats; /* devstat entry */
dev_t dev1, dev2; /* device place holders */
};
OpenPOWER on IntegriCloud