Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
af984413
Commit
af984413
authored
Mar 20, 2010
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'vhost' of
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
parents
37b7ef72
535297a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
drivers/vhost/net.c
drivers/vhost/net.c
+6
-4
drivers/vhost/vhost.c
drivers/vhost/vhost.c
+12
-6
No files found.
drivers/vhost/net.c
View file @
af984413
...
@@ -125,7 +125,7 @@ static void handle_tx(struct vhost_net *net)
...
@@ -125,7 +125,7 @@ static void handle_tx(struct vhost_net *net)
mutex_lock
(
&
vq
->
mutex
);
mutex_lock
(
&
vq
->
mutex
);
vhost_disable_notify
(
vq
);
vhost_disable_notify
(
vq
);
if
(
wmem
<
sock
->
sk
->
sk_sndbuf
*
2
)
if
(
wmem
<
sock
->
sk
->
sk_sndbuf
/
2
)
tx_poll_stop
(
net
);
tx_poll_stop
(
net
);
hdr_size
=
vq
->
hdr_size
;
hdr_size
=
vq
->
hdr_size
;
...
@@ -508,12 +508,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
...
@@ -508,12 +508,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
/* Verify that ring has been setup correctly. */
/* Verify that ring has been setup correctly. */
if
(
!
vhost_vq_access_ok
(
vq
))
{
if
(
!
vhost_vq_access_ok
(
vq
))
{
r
=
-
EFAULT
;
r
=
-
EFAULT
;
goto
err
;
goto
err
_vq
;
}
}
sock
=
get_socket
(
fd
);
sock
=
get_socket
(
fd
);
if
(
IS_ERR
(
sock
))
{
if
(
IS_ERR
(
sock
))
{
r
=
PTR_ERR
(
sock
);
r
=
PTR_ERR
(
sock
);
goto
err
;
goto
err
_vq
;
}
}
/* start polling new socket */
/* start polling new socket */
...
@@ -524,12 +524,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
...
@@ -524,12 +524,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
vhost_net_disable_vq
(
n
,
vq
);
vhost_net_disable_vq
(
n
,
vq
);
rcu_assign_pointer
(
vq
->
private_data
,
sock
);
rcu_assign_pointer
(
vq
->
private_data
,
sock
);
vhost_net_enable_vq
(
n
,
vq
);
vhost_net_enable_vq
(
n
,
vq
);
mutex_unlock
(
&
vq
->
mutex
);
done:
done:
if
(
oldsock
)
{
if
(
oldsock
)
{
vhost_net_flush_vq
(
n
,
index
);
vhost_net_flush_vq
(
n
,
index
);
fput
(
oldsock
->
file
);
fput
(
oldsock
->
file
);
}
}
err_vq:
mutex_unlock
(
&
vq
->
mutex
);
err:
err:
mutex_unlock
(
&
n
->
dev
.
mutex
);
mutex_unlock
(
&
n
->
dev
.
mutex
);
return
r
;
return
r
;
...
...
drivers/vhost/vhost.c
View file @
af984413
...
@@ -476,8 +476,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
...
@@ -476,8 +476,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
if
(
r
<
0
)
if
(
r
<
0
)
break
;
break
;
eventfp
=
f
.
fd
==
-
1
?
NULL
:
eventfd_fget
(
f
.
fd
);
eventfp
=
f
.
fd
==
-
1
?
NULL
:
eventfd_fget
(
f
.
fd
);
if
(
IS_ERR
(
eventfp
))
if
(
IS_ERR
(
eventfp
))
{
return
PTR_ERR
(
eventfp
);
r
=
PTR_ERR
(
eventfp
);
break
;
}
if
(
eventfp
!=
vq
->
kick
)
{
if
(
eventfp
!=
vq
->
kick
)
{
pollstop
=
filep
=
vq
->
kick
;
pollstop
=
filep
=
vq
->
kick
;
pollstart
=
vq
->
kick
=
eventfp
;
pollstart
=
vq
->
kick
=
eventfp
;
...
@@ -489,8 +491,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
...
@@ -489,8 +491,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
if
(
r
<
0
)
if
(
r
<
0
)
break
;
break
;
eventfp
=
f
.
fd
==
-
1
?
NULL
:
eventfd_fget
(
f
.
fd
);
eventfp
=
f
.
fd
==
-
1
?
NULL
:
eventfd_fget
(
f
.
fd
);
if
(
IS_ERR
(
eventfp
))
if
(
IS_ERR
(
eventfp
))
{
return
PTR_ERR
(
eventfp
);
r
=
PTR_ERR
(
eventfp
);
break
;
}
if
(
eventfp
!=
vq
->
call
)
{
if
(
eventfp
!=
vq
->
call
)
{
filep
=
vq
->
call
;
filep
=
vq
->
call
;
ctx
=
vq
->
call_ctx
;
ctx
=
vq
->
call_ctx
;
...
@@ -505,8 +509,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
...
@@ -505,8 +509,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
if
(
r
<
0
)
if
(
r
<
0
)
break
;
break
;
eventfp
=
f
.
fd
==
-
1
?
NULL
:
eventfd_fget
(
f
.
fd
);
eventfp
=
f
.
fd
==
-
1
?
NULL
:
eventfd_fget
(
f
.
fd
);
if
(
IS_ERR
(
eventfp
))
if
(
IS_ERR
(
eventfp
))
{
return
PTR_ERR
(
eventfp
);
r
=
PTR_ERR
(
eventfp
);
break
;
}
if
(
eventfp
!=
vq
->
error
)
{
if
(
eventfp
!=
vq
->
error
)
{
filep
=
vq
->
error
;
filep
=
vq
->
error
;
vq
->
error
=
eventfp
;
vq
->
error
=
eventfp
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment