void __inode_dir_notify(struct inode *inode, unsigned long event) { struct dnotify_struct * dn; struct dnotify_struct **prev; struct fown_struct * fown; int changed = 0; spin_lock(&inode->i_lock); prev = &inode->i_dnotify; while ((dn = *prev) != NULL) { if ((dn->dn_mask & event) == 0) { prev = &dn->dn_next; continue; } fown = &dn->dn_filp->f_owner; send_sigio(fown, dn->dn_fd, POLL_MSG); if (dn->dn_mask & DN_MULTISHOT) prev = &dn->dn_next; else { *prev = dn->dn_next; changed = 1; kmem_cache_free(dn_cache, dn); } } if (changed) redo_inode_mask(inode); spin_unlock(&inode->i_lock); }
void __inode_dir_notify(struct inode *inode, unsigned long event) { struct dnotify_struct * dn; struct dnotify_struct **prev; struct fown_struct * fown; int changed = 0; write_lock(&dn_lock); prev = &inode->i_dnotify; while ((dn = *prev) != NULL) { if (dn->dn_magic != DNOTIFY_MAGIC) { printk(KERN_ERR "__inode_dir_notify: bad magic " "number in dnotify_struct!\n"); goto out; } if ((dn->dn_mask & event) == 0) { prev = &dn->dn_next; continue; } fown = &dn->dn_filp->f_owner; if (fown->pid) send_sigio(fown, dn->dn_fd, POLL_MSG); if (dn->dn_mask & DN_MULTISHOT) prev = &dn->dn_next; else { *prev = dn->dn_next; changed = 1; kmem_cache_free(dn_cache, dn); } } if (changed) redo_inode_mask(inode); out: write_unlock(&dn_lock); }
void kill_fasync(struct fasync_struct *fa, int sig) { while (fa) { struct fown_struct * fown; if (fa->magic != FASYNC_MAGIC) { printk("kill_fasync: bad magic number in " "fasync_struct!\n"); return; } fown = &fa->fa_file->f_owner; if (fown->pid) send_sigio(fown, fa); fa = fa->fa_next; } }