Merge branch 'vhost-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
This commit is contained in:
commit
0dea7c12fc
2 changed files with 8 additions and 9 deletions
|
@ -519,13 +519,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
|
||||||
|
|
||||||
/* start polling new socket */
|
/* start polling new socket */
|
||||||
oldsock = vq->private_data;
|
oldsock = vq->private_data;
|
||||||
if (sock == oldsock)
|
if (sock != oldsock){
|
||||||
goto done;
|
vhost_net_disable_vq(n, vq);
|
||||||
|
rcu_assign_pointer(vq->private_data, sock);
|
||||||
|
vhost_net_enable_vq(n, vq);
|
||||||
|
}
|
||||||
|
|
||||||
vhost_net_disable_vq(n, vq);
|
|
||||||
rcu_assign_pointer(vq->private_data, sock);
|
|
||||||
vhost_net_enable_vq(n, vq);
|
|
||||||
done:
|
|
||||||
if (oldsock) {
|
if (oldsock) {
|
||||||
vhost_net_flush_vq(n, index);
|
vhost_net_flush_vq(n, index);
|
||||||
fput(oldsock->file);
|
fput(oldsock->file);
|
||||||
|
@ -626,7 +625,7 @@ static long vhost_net_compat_ioctl(struct file *f, unsigned int ioctl,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const static struct file_operations vhost_net_fops = {
|
static const struct file_operations vhost_net_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.release = vhost_net_release,
|
.release = vhost_net_release,
|
||||||
.unlocked_ioctl = vhost_net_ioctl,
|
.unlocked_ioctl = vhost_net_ioctl,
|
||||||
|
|
|
@ -237,8 +237,8 @@ static int vq_memory_access_ok(void __user *log_base, struct vhost_memory *mem,
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!mem)
|
if (!mem)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 0; i < mem->nregions; ++i) {
|
for (i = 0; i < mem->nregions; ++i) {
|
||||||
struct vhost_memory_region *m = mem->regions + i;
|
struct vhost_memory_region *m = mem->regions + i;
|
||||||
|
|
Loading…
Reference in a new issue