patch-2.3.99-pre4 linux/include/linux/dcache.h
Next file: linux/include/linux/errno.h
Previous file: linux/include/linux/cycx_x25.h
Back to the patch index
Back to the overall index
- Lines: 102
- Date:
Mon Apr 10 23:23:18 2000
- Orig file:
v2.3.99-pre3/linux/include/linux/dcache.h
- Orig date:
Mon Mar 27 08:08:32 2000
diff -u --recursive --new-file v2.3.99-pre3/linux/include/linux/dcache.h linux/include/linux/dcache.h
@@ -1,6 +1,9 @@
#ifndef __LINUX_DCACHE_H
#define __LINUX_DCACHE_H
+#include <asm/atomic.h>
+#include <linux/mount.h>
+
#ifdef __KERNEL__
/*
@@ -105,7 +108,10 @@
* s_nfsd_free_path semaphore will be down
*/
-/*
+/**
+ * d_drop - drop a dentry
+ * @dentry: dentry to drop
+ *
* d_drop() unhashes the entry from the parent
* dentry hashes, so that it won't be found through
* a VFS lookup any more. Note that this is different
@@ -118,6 +124,7 @@
* to invalidate a dentry for some reason (NFS
* timeouts or autofs deletes).
*/
+
static __inline__ void d_drop(struct dentry * dentry)
{
list_del(&dentry->d_hash);
@@ -164,10 +171,16 @@
* This adds the entry to the hash queues.
*/
extern void d_rehash(struct dentry *);
-/*
+
+/**
+ * d_add - add dentry to hash queues
+ * @entry: dentry to add
+ * @inode: The inode to attach to this dentry
+ *
* This adds the entry to the hash queues and initializes "d_inode".
* The entry was actually filled in earlier during "d_alloc()"
*/
+
static __inline__ void d_add(struct dentry * entry, struct inode * inode)
{
d_rehash(entry);
@@ -183,10 +196,24 @@
/* validate "insecure" dentry pointer */
extern int d_validate(struct dentry *, struct dentry *, unsigned int, unsigned int);
+extern char * __d_path(struct dentry *, struct vfsmount *, struct dentry *,
+ struct vfsmount *, char *, int);
/* write full pathname into buffer and return start of pathname */
-extern char * d_path(struct dentry *, char *, int);
-
+#define d_path(dentry, vfsmnt, buffer, buflen) \
+ __d_path(dentry, vfsmnt, current->fs->root, current->fs->rootmnt, \
+ buffer, buflen)
+
/* Allocation counts.. */
+
+/**
+ * dget - get a reference to a dentry
+ * @dentry: dentry to get a reference too
+ *
+ * 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.
+ */
+
static __inline__ struct dentry * dget(struct dentry *dentry)
{
if (dentry)
@@ -194,12 +221,26 @@
return dentry;
}
+/**
+ * d_unhashed - is dentry hashed
+ * @dentry: entry to check
+ *
+ * Returns true if the dentry passed is not currently hashed
+ */
+
static __inline__ int d_unhashed(struct dentry *dentry)
{
return list_empty(&dentry->d_hash);
}
extern void dput(struct dentry *);
+
+/* MOUNT_REWRITE: replace with the check for d_vfsmnt */
+static __inline__ int d_mountpoint(struct dentry *dentry)
+{
+ return dentry != dentry->d_mounts;
+}
+
#endif /* __KERNEL__ */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)