summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-09 23:29:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-09 23:29:35 +0000
commit35385d7a83b4cae6d5ea5f80f3b3377d94178344 (patch)
tree49494d95dfef31ba4f9a697d31e4028cf65a57bd /include/linux
parentd9d8062e7b49943b2a2fb034f817a9fc217fd40f (diff)
Merge with 2.4.0-test3-pre7.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dcache.h17
-rw-r--r--include/linux/parport.h7
2 files changed, 19 insertions, 5 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 7c0acf4bb..4c3f211cc 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -217,23 +217,30 @@ extern char * __d_path(struct dentry *, struct vfsmount *, struct dentry *,
/* Allocation counts.. */
/**
- * dget - get a reference to a dentry
+ * dget, dget_locked - get a reference to a dentry
* @dentry: dentry to get a reference to
*
* Given a dentry or %NULL pointer increment the reference count
* if appropriate and return the dentry. A dentry will not be
- * destroyed when it has references.
+ * destroyed when it has references. dget() should never be
+ * called for dentries with zero reference counter. For these cases
+ * (preferably none, functions in dcache.c are sufficient for normal
+ * needs and they take necessary precautions) you should hold dcache_lock
+ * and call dget_locked() instead of dget().
*/
static __inline__ struct dentry * dget(struct dentry *dentry)
{
- if (!atomic_read(&dentry->d_count))
- BUG();
- if (dentry)
+ if (dentry) {
+ if (!atomic_read(&dentry->d_count))
+ BUG();
atomic_inc(&dentry->d_count);
+ }
return dentry;
}
+extern struct dentry * dget_locked(struct dentry *);
+
/**
* d_unhashed - is dentry hashed
* @dentry: entry to check
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 0597addd4..294464b65 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -1,5 +1,12 @@
/* $Id: parport.h,v 1.1 1998/05/17 10:57:52 andrea Exp andrea $ */
+/*
+ * The block comments above the functions in this file are
+ * licensed as part of the generated file
+ * Documentation/DocBook/parportbook.sgml under the GNU Free
+ * Documentation License.
+ */
+
#ifndef _PARPORT_H_
#define _PARPORT_H_