[Ocfs2-commits] jlbec commits r1092 - branches/format-changes/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Jun 14 11:34:36 CDT 2004


Author: jlbec
Date: 2004-06-14 10:34:34 -0500 (Mon, 14 Jun 2004)
New Revision: 1092

Modified:
   branches/format-changes/src/dcache.c
   branches/format-changes/src/dcache.h
   branches/format-changes/src/namei.c
Log:

o Make dentry_revalidate more portable and remove empty_dir.  From
   Christoph Hellwig <hch at lst.de>



Modified: branches/format-changes/src/dcache.c
===================================================================
--- branches/format-changes/src/dcache.c	2004-06-14 08:18:35 UTC (rev 1091)
+++ branches/format-changes/src/dcache.c	2004-06-14 15:34:34 UTC (rev 1092)
@@ -44,24 +44,11 @@
 #define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_DCACHE
 
 
-static int ocfs_empty_func(struct dentry *dentry, void *ignore);
-
-/*
- * ocfs_dentry_revalidate()
- *
- */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-int ocfs_dentry_revalidate (struct dentry *dentry, struct nameidata *nd)
-#else
-int ocfs_dentry_revalidate (struct dentry *dentry, int flags)
-#endif
+static int ocfs_dentry_revalidate24(struct dentry *dentry, int flags)
 {
-	int ret = 0;    /* if all else fails, just return false */
 	struct inode *inode = dentry->d_inode;
+	int ret = 0;    /* if all else fails, just return false */
 	ocfs_super *osb;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	int flags = nd ? nd->flags : 0;
-#endif
 
 	LOG_ENTRY_ARGS ("(0x%p, %d, '%*s')\n", dentry, flags,
 			dentry->d_name.len, dentry->d_name.name);
@@ -106,24 +93,21 @@
 
 	LOG_EXIT_INT (ret);
 	return ret;
-}				/* ocfs_dentry_revalidate */
-
-
-/* exits if it finds any hashed dentries */
-static int ocfs_empty_func(struct dentry *dentry, void *ignore)
-{
-	return 1;
 }
 
-
-/*
- * ocfs_empty()
- *
- */
-int ocfs_empty (struct dentry *dentry)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+static int ocfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd)
 {
-	return ocfs_foreach_child (dentry, ocfs_empty_func, NULL);
+	return ocfs_dentry_revalidate24(dentry, nd ? nd->flags : 0);
 }
+struct dentry_operations ocfs_dentry_ops = {
+	.d_revalidate		= ocfs_dentry_revalidate,
+};
+#else
+struct dentry_operations ocfs_dentry_ops = {
+	.d_revalidate		= ocfs_dentry_revalidate24,
+};
+#endif
 
 /*
  * ocfs_foreach_child()
@@ -157,6 +141,4 @@
 
 	LOG_EXIT_INT (ret);
 	return ret;
-}				/* ocfs_foreach_child */
-
-
+}

Modified: branches/format-changes/src/dcache.h
===================================================================
--- branches/format-changes/src/dcache.h	2004-06-14 08:18:35 UTC (rev 1091)
+++ branches/format-changes/src/dcache.h	2004-06-14 15:34:34 UTC (rev 1092)
@@ -29,12 +29,8 @@
 #ifndef OCFS2_DCACHE_H
 #define OCFS2_DCACHE_H
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-int ocfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd);
-#else
-int ocfs_dentry_revalidate(struct dentry *dentry, int flags);
-#endif
-int ocfs_empty(struct dentry *dentry);
+extern struct dentry_operations ocfs_dentry_ops;
+
 int ocfs_foreach_child(struct dentry *dentry,
 		       int (*func)(struct dentry *, void *),
 		       void *data);

Modified: branches/format-changes/src/namei.c
===================================================================
--- branches/format-changes/src/namei.c	2004-06-14 08:18:35 UTC (rev 1091)
+++ branches/format-changes/src/namei.c	2004-06-14 15:34:34 UTC (rev 1092)
@@ -105,10 +105,6 @@
 static int ocfs_orphan_add(ocfs_super *osb, ocfs_journal_handle *handle,
 			   struct inode *inode, ocfs2_dinode *fe);
 
-static struct dentry_operations ocfs_dentry_ops = {
-	.d_revalidate = ocfs_dentry_revalidate	// let's test it out!
-};
-
 static inline int ocfs_add_entry(ocfs_journal_handle *handle, 
 				 struct dentry *dentry, 
 				 struct inode *inode, __u64 inode_off, 



More information about the Ocfs2-commits mailing list