2 * Directory notification for Linux
4 * Copyright (C) 2000,2002 Stephen Rothwell
7 struct dnotify_struct {
8 struct dnotify_struct * dn_next;
9 unsigned long dn_mask; /* Events to be notified
12 struct file * dn_filp;
16 extern void __inode_dir_notify(struct inode *, unsigned long);
17 extern void dnotify_flush(struct file *filp, fl_owner_t id);
18 extern int fcntl_dirnotify(int, struct file *, unsigned long);
20 static inline void inode_dir_notify(struct inode *inode, unsigned long event)
22 if ((inode)->i_dnotify_mask & (event))
23 __inode_dir_notify(inode, event);
27 * This is hopelessly wrong, but unfixable without API changes. At
28 * least it doesn't oops the kernel...
30 static inline void dnotify_parent(struct dentry *dentry, unsigned long event)
32 struct dentry *parent;
33 spin_lock(&dcache_lock);
34 parent = dentry->d_parent;
35 if (parent->d_inode->i_dnotify_mask & event) {
37 spin_unlock(&dcache_lock);
38 __inode_dir_notify(parent->d_inode, event);
41 spin_unlock(&dcache_lock);