]> err.no Git - linux-2.6/blobdiff - fs/9p/vfs_dentry.c
[MIPS] Early check for SMTC kernel on non-MT processor
[linux-2.6] / fs / 9p / vfs_dentry.c
index 12c9cc926b71afc45f5722fbfa70fb7b0a44ad37..d93960429c09e042ff512535b4ebe9006804d9a6 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
 #include <linux/pagemap.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/smp_lock.h>
 #include <linux/inet.h>
 #include <linux/namei.h>
 #include <linux/idr.h>
+#include <linux/sched.h>
 
 #include "debug.h"
 #include "v9fs.h"
  *
  */
 
-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,