Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: lguest: don't force VIRTIO_F_NOTIFY_ON_EMPTY lguest: cleanup for map_switcher() lguest: use PGDIR_SHIFT for PAE code to allow different PAGE_OFFSET lguest: use set_pte/set_pmd uniformly for real page table entries lguest: move panic notifier registration to its expected place. virtio_blk: add support for cache flush virtio: add virtio IDs file virtio: get rid of redundant VIRTIO_ID_9P definition virtio: make add_buf return capacity remaining virtio_pci: minor MSI-X cleanups
此提交包含在:
@@ -21,6 +21,7 @@
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/virtio.h>
|
||||
#include <linux/virtio_ids.h>
|
||||
#include <linux/virtio_rng.h>
|
||||
|
||||
/* The host will fill any buffer we give it with sweet, sweet randomness. We
|
||||
@@ -51,7 +52,7 @@ static void register_buffer(void)
|
||||
|
||||
sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left);
|
||||
/* There should always be room for one buffer. */
|
||||
if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0)
|
||||
if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) < 0)
|
||||
BUG();
|
||||
vq->vq_ops->kick(vq);
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/virtio.h>
|
||||
#include <linux/virtio_ids.h>
|
||||
#include <linux/virtio_console.h>
|
||||
#include "hvc_console.h"
|
||||
|
||||
@@ -65,7 +66,7 @@ static int put_chars(u32 vtermno, const char *buf, int count)
|
||||
|
||||
/* add_buf wants a token to identify this buffer: we hand it any
|
||||
* non-NULL pointer, since there's only ever one buffer. */
|
||||
if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) == 0) {
|
||||
if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) >= 0) {
|
||||
/* Tell Host to go! */
|
||||
out_vq->vq_ops->kick(out_vq);
|
||||
/* Chill out until it's done with the buffer. */
|
||||
@@ -85,7 +86,7 @@ static void add_inbuf(void)
|
||||
sg_init_one(sg, inbuf, PAGE_SIZE);
|
||||
|
||||
/* We should always be able to add one buffer to an empty queue. */
|
||||
if (in_vq->vq_ops->add_buf(in_vq, sg, 0, 1, inbuf) != 0)
|
||||
if (in_vq->vq_ops->add_buf(in_vq, sg, 0, 1, inbuf) < 0)
|
||||
BUG();
|
||||
in_vq->vq_ops->kick(in_vq);
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者