Fixed a problem where not all of a device structure was being cleaned out
authorAlan D. Brunelle <Alan.Brunelle@hp.com>
Thu, 8 Feb 2007 14:58:55 +0000 (15:58 +0100)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Thu, 8 Feb 2007 14:58:55 +0000 (15:58 +0100)
Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
btt/devs.c

index 3691fd6a1a539f1c706b20d21aba70abb3bc3e36..465f44dfb7c1248db803de57e791ccb90b4cb9c5 100644 (file)
@@ -101,6 +101,7 @@ struct d_info *dip_add(__u32 device, struct io *iop)
 
        if (dip == NULL) {
                dip = malloc(sizeof(struct d_info));
+               memset(dip, 0, sizeof(*dip));
                dip->heads = dip_rb_mkhds();
                init_region(&dip->regions);
                dip->device = device;
@@ -108,8 +109,6 @@ struct d_info *dip_add(__u32 device, struct io *iop)
                dip->map = dev_map_find(device);
                dip->seek_handle = seeki_init(device);
                latency_init(dip);
-               memset(&dip->stats, 0, sizeof(dip->stats));
-               memset(&dip->all_stats, 0, sizeof(dip->all_stats));
                list_add_tail(&dip->hash_head, &dev_heads[DEV_HASH(device)]);
                list_add_tail(&dip->all_head, &all_devs);
                n_devs++;