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
9f5596af
Commit
9f5596af
authored
Feb 05, 2010
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
take check for new events in namespace (guts of mounts_poll()) to namespace.c
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e21e7095
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
fs/namespace.c
fs/namespace.c
+15
-0
fs/proc/base.c
fs/proc/base.c
+2
-8
include/linux/mnt_namespace.h
include/linux/mnt_namespace.h
+1
-0
No files found.
fs/namespace.c
View file @
9f5596af
...
...
@@ -737,6 +737,21 @@ static void m_stop(struct seq_file *m, void *v)
up_read
(
&
namespace_sem
);
}
int
mnt_had_events
(
struct
proc_mounts
*
p
)
{
struct
mnt_namespace
*
ns
=
p
->
ns
;
int
res
=
0
;
spin_lock
(
&
vfsmount_lock
);
if
(
p
->
event
!=
ns
->
event
)
{
p
->
event
=
ns
->
event
;
res
=
1
;
}
spin_unlock
(
&
vfsmount_lock
);
return
res
;
}
struct
proc_fs_info
{
int
flag
;
const
char
*
str
;
...
...
fs/proc/base.c
View file @
9f5596af
...
...
@@ -647,17 +647,11 @@ static int mounts_release(struct inode *inode, struct file *file)
static
unsigned
mounts_poll
(
struct
file
*
file
,
poll_table
*
wait
)
{
struct
proc_mounts
*
p
=
file
->
private_data
;
struct
mnt_namespace
*
ns
=
p
->
ns
;
unsigned
res
=
POLLIN
|
POLLRDNORM
;
poll_wait
(
file
,
&
ns
->
poll
,
wait
);
spin_lock
(
&
vfsmount_lock
);
if
(
p
->
event
!=
ns
->
event
)
{
p
->
event
=
ns
->
event
;
poll_wait
(
file
,
&
p
->
ns
->
poll
,
wait
);
if
(
mnt_had_events
(
p
))
res
|=
POLLERR
|
POLLPRI
;
}
spin_unlock
(
&
vfsmount_lock
);
return
res
;
}
...
...
include/linux/mnt_namespace.h
View file @
9f5596af
...
...
@@ -35,6 +35,7 @@ static inline void get_mnt_ns(struct mnt_namespace *ns)
extern
const
struct
seq_operations
mounts_op
;
extern
const
struct
seq_operations
mountinfo_op
;
extern
const
struct
seq_operations
mountstats_op
;
extern
int
mnt_had_events
(
struct
proc_mounts
*
);
#endif
#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