Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185723
b: refs/heads/master
c: 9f5596a
h: refs/heads/master
i:
  185721: a48bfeb
  185719: 1b407ef
v: v3
  • Loading branch information
Al Viro committed Mar 3, 2010
1 parent 030f427 commit a47c19a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e21e7095a78867364d7aa9223d833ccb966f93f3
refs/heads/master: 9f5596af44514f99e3a654a4f7cb813354b9e516
15 changes: 15 additions & 0 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 2 additions & 8 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mnt_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a47c19a

Please sign in to comment.