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
Kirill Smelkov
linux
Commits
f1e84eb3
Commit
f1e84eb3
authored
Mar 23, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'vhost-net' of
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
parents
8c6b0865
ea5d4046
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
6 deletions
+12
-6
drivers/vhost/net.c
drivers/vhost/net.c
+1
-1
drivers/vhost/vhost.c
drivers/vhost/vhost.c
+7
-4
drivers/vhost/vhost.h
drivers/vhost/vhost.h
+1
-1
tools/virtio/linux/hrtimer.h
tools/virtio/linux/hrtimer.h
+0
-0
tools/virtio/linux/module.h
tools/virtio/linux/module.h
+0
-0
tools/virtio/linux/virtio.h
tools/virtio/linux/virtio.h
+3
-0
No files found.
drivers/vhost/net.c
View file @
f1e84eb3
...
...
@@ -588,7 +588,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
vhost_net_stop
(
n
,
&
tx_sock
,
&
rx_sock
);
vhost_net_flush
(
n
);
vhost_dev_cleanup
(
&
n
->
dev
);
vhost_dev_cleanup
(
&
n
->
dev
,
false
);
if
(
tx_sock
)
fput
(
tx_sock
->
file
);
if
(
rx_sock
)
...
...
drivers/vhost/vhost.c
View file @
f1e84eb3
...
...
@@ -222,6 +222,8 @@ static int vhost_worker(void *data)
if
(
work
)
{
__set_current_state
(
TASK_RUNNING
);
work
->
fn
(
work
);
if
(
need_resched
())
schedule
();
}
else
schedule
();
...
...
@@ -403,7 +405,7 @@ long vhost_dev_reset_owner(struct vhost_dev *dev)
if
(
!
memory
)
return
-
ENOMEM
;
vhost_dev_cleanup
(
dev
);
vhost_dev_cleanup
(
dev
,
true
);
memory
->
nregions
=
0
;
RCU_INIT_POINTER
(
dev
->
memory
,
memory
);
...
...
@@ -434,8 +436,8 @@ int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq)
return
j
;
}
/* Caller should have device mutex */
void
vhost_dev_cleanup
(
struct
vhost_dev
*
dev
)
/* Caller should have device mutex
if and only if locked is set
*/
void
vhost_dev_cleanup
(
struct
vhost_dev
*
dev
,
bool
locked
)
{
int
i
;
...
...
@@ -472,6 +474,7 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
dev
->
log_file
=
NULL
;
/* No one will access memory at this point */
kfree
(
rcu_dereference_protected
(
dev
->
memory
,
locked
==
lockdep_is_held
(
&
dev
->
mutex
)));
RCU_INIT_POINTER
(
dev
->
memory
,
NULL
);
WARN_ON
(
!
list_empty
(
&
dev
->
work_list
));
...
...
drivers/vhost/vhost.h
View file @
f1e84eb3
...
...
@@ -163,7 +163,7 @@ struct vhost_dev {
long
vhost_dev_init
(
struct
vhost_dev
*
,
struct
vhost_virtqueue
*
vqs
,
int
nvqs
);
long
vhost_dev_check_owner
(
struct
vhost_dev
*
);
long
vhost_dev_reset_owner
(
struct
vhost_dev
*
);
void
vhost_dev_cleanup
(
struct
vhost_dev
*
);
void
vhost_dev_cleanup
(
struct
vhost_dev
*
,
bool
locked
);
long
vhost_dev_ioctl
(
struct
vhost_dev
*
,
unsigned
int
ioctl
,
unsigned
long
arg
);
int
vhost_vq_access_ok
(
struct
vhost_virtqueue
*
vq
);
int
vhost_log_access_ok
(
struct
vhost_dev
*
);
...
...
tools/virtio/linux/hrtimer.h
0 → 100644
View file @
f1e84eb3
tools/virtio/linux/module.h
0 → 100644
View file @
f1e84eb3
tools/virtio/linux/virtio.h
View file @
f1e84eb3
...
...
@@ -181,6 +181,9 @@ struct virtqueue {
#define smp_mb() mb()
# define smp_rmb() barrier()
# define smp_wmb() barrier()
/* Weak barriers should be used. If not - it's a bug */
# define rmb() abort()
# define wmb() abort()
#else
#error Please fill in barrier macros
#endif
...
...
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