search for: update_blk_stats

Displaying 2 results from an estimated 2 matches for "update_blk_stats".

2011 Aug 16
1
[PATCH] virtio-blk: Add stats VQ to collect information about devices
...terlist sg[/*sg_elems*/]; }; @@ -48,6 +52,75 @@ struct virtblk_req u8 status; }; +static inline void update_stat(struct virtio_blk *vb, int idx, + u16 tag, u64 val) +{ + BUG_ON(idx >= VIRTIO_BLK_S_NR); + vb->stats[idx].tag = tag; + vb->stats[idx].val = val; +} + +static void update_blk_stats(struct virtio_blk *vb) +{ + struct hd_struct *p = disk_get_part(vb->disk, 0); + int cpu; + int idx = 0; + + cpu = part_stat_lock(); + part_round_stats(cpu, p); + part_stat_unlock(); + + update_stat(vb, idx++, VIRTIO_BLK_S_READ_IO, + part_stat_read(p, ios[READ])); + update_stat(vb, idx++, VI...
2011 Aug 16
1
[PATCH] virtio-blk: Add stats VQ to collect information about devices
...terlist sg[/*sg_elems*/]; }; @@ -48,6 +52,75 @@ struct virtblk_req u8 status; }; +static inline void update_stat(struct virtio_blk *vb, int idx, + u16 tag, u64 val) +{ + BUG_ON(idx >= VIRTIO_BLK_S_NR); + vb->stats[idx].tag = tag; + vb->stats[idx].val = val; +} + +static void update_blk_stats(struct virtio_blk *vb) +{ + struct hd_struct *p = disk_get_part(vb->disk, 0); + int cpu; + int idx = 0; + + cpu = part_stat_lock(); + part_round_stats(cpu, p); + part_stat_unlock(); + + update_stat(vb, idx++, VIRTIO_BLK_S_READ_IO, + part_stat_read(p, ios[READ])); + update_stat(vb, idx++, VI...