patch-2.4.18 linux/include/linux/dnotify.h

Next file: linux/include/linux/ext3_fs.h
Previous file: linux/include/linux/cyclades.h
Back to the patch index
Back to the overall index

diff -Naur -X /home/marcelo/lib/dontdiff linux.orig/include/linux/dnotify.h linux/include/linux/dnotify.h
@@ -23,3 +23,21 @@
 	if ((inode)->i_dnotify_mask & (event))
 		__inode_dir_notify(inode, event);
 }
+
+/*
+ * This is hopelessly wrong, but unfixable without API changes.  At
+ * least it doesn't oops the kernel...
+ */
+static inline void dnotify_parent(struct dentry *dentry, unsigned long event)
+{
+	struct dentry *parent;
+	spin_lock(&dcache_lock);
+	parent = dentry->d_parent;
+	if (parent->d_inode->i_dnotify_mask & event) {
+		dget(parent);
+		spin_unlock(&dcache_lock);
+		__inode_dir_notify(parent->d_inode, event);
+		dput(parent);
+	} else
+		spin_unlock(&dcache_lock);
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)