Loading fs/namespace.c +15 −0 Original line number Diff line number Diff line Loading @@ -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; Loading fs/proc/base.c +2 −8 Original line number Diff line number Diff line Loading @@ -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; } Loading include/linux/mnt_namespace.h +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
fs/namespace.c +15 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
fs/proc/base.c +2 −8 Original line number Diff line number Diff line Loading @@ -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; } Loading
include/linux/mnt_namespace.h +1 −0 Original line number Diff line number Diff line Loading @@ -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