Bluetooth: Verify that l2cap_get_conf_opt provides large enough buffer
[pandora-kernel.git] / drivers / virtio / virtio_balloon.c
index 2975c50..bc7c26d 100644 (file)
@@ -180,12 +180,14 @@ static void update_balloon_stats(struct virtio_balloon *vb)
        all_vm_events(events);
        si_meminfo(&i);
 
+#ifdef CONFIG_VM_EVENT_COUNTERS
        update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_IN,
                                pages_to_bytes(events[PSWPIN]));
        update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_OUT,
                                pages_to_bytes(events[PSWPOUT]));
        update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
        update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
+#endif
        update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
                                pages_to_bytes(i.freeram));
        update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMTOT,
@@ -320,6 +322,8 @@ static int virtballoon_probe(struct virtio_device *vdev)
                 * Prime this virtqueue with one buffer so the hypervisor can
                 * use it to signal us later.
                 */
+               update_balloon_stats(vb);
+
                sg_init_one(&sg, vb->stats, sizeof vb->stats);
                if (virtqueue_add_buf(vb->stats_vq, &sg, 1, 0, vb) < 0)
                        BUG();