Merge branch 'server-cluster-locking-api' of git://linux-nfs.org/~bfields/linux
[powerpc.git] / fs / 9p / vfs_dentry.c
index 12c9cc9..ddffd8a 100644 (file)
@@ -7,9 +7,8 @@
  *  Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
  *
  *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *
  */
 
-int v9fs_dentry_delete(struct dentry *dentry)
+static int v9fs_dentry_delete(struct dentry *dentry)
 {
        dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
+
        return 1;
 }
 
+/**
+ * v9fs_cached_dentry_delete - called when dentry refcount equals 0
+ * @dentry:  dentry in question
+ *
+ * Only return 1 if our inode is invalid.  Only non-synthetic files
+ * (ones without mtime == 0) should be calling this function.
+ *
+ */
+
+static int v9fs_cached_dentry_delete(struct dentry *dentry)
+{
+       struct inode *inode = dentry->d_inode;
+       dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
+
+       if(!inode)
+               return 1;
+
+       return 0;
+}
+
 /**
  * v9fs_dentry_release - called when dentry is going to be freed
  * @dentry:  dentry that is being release
@@ -88,6 +108,11 @@ void v9fs_dentry_release(struct dentry *dentry)
        }
 }
 
+struct dentry_operations v9fs_cached_dentry_operations = {
+       .d_delete = v9fs_cached_dentry_delete,
+       .d_release = v9fs_dentry_release,
+};
+
 struct dentry_operations v9fs_dentry_operations = {
        .d_delete = v9fs_dentry_delete,
        .d_release = v9fs_dentry_release,