
This patch from William Lee Irwin III privatizes __d_path() to dcache.c,
uninlines d_path(), moves its declaration to dcache.h, moves it to
dcache.c, and exports d_path() instead of __d_path().

 fs/dcache.c            |   25 ++++++++++++++++++++++---
 include/linux/dcache.h |    3 +--
 include/linux/sched.h  |   20 --------------------
 kernel/ksyms.c         |    2 +-
 4 files changed, 24 insertions(+), 26 deletions(-)


diff -urpN linux-2.5.47/fs/dcache.c linux-2.5.47-wait/fs/dcache.c
--- linux-2.5.47/fs/dcache.c	2002-11-14 23:42:01.000000000 -0800
+++ linux-2.5.47-wait/fs/dcache.c	2002-11-15 15:09:46.000000000 -0800
@@ -1136,9 +1136,9 @@ void d_move(struct dentry * dentry, stru
  *
  * "buflen" should be %PAGE_SIZE or more. Caller holds the dcache_lock.
  */
-char * __d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
-		struct dentry *root, struct vfsmount *rootmnt,
-		char *buffer, int buflen)
+static char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt,
+			struct dentry *root, struct vfsmount *rootmnt,
+			char *buffer, int buflen)
 {
 	char * end = buffer+buflen;
 	char * retval;
@@ -1191,6 +1191,25 @@ global_root:
 	return retval;
 }
 
+/* write full pathname into buffer and return start of pathname */
+char * d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
+				char *buf, int buflen)
+{
+	char *res;
+	struct vfsmount *rootmnt;
+	struct dentry *root;
+	read_lock(&current->fs->lock);
+	rootmnt = mntget(current->fs->rootmnt);
+	root = dget(current->fs->root);
+	read_unlock(&current->fs->lock);
+	spin_lock(&dcache_lock);
+	res = __d_path(dentry, vfsmnt, root, rootmnt, buf, buflen);
+	spin_unlock(&dcache_lock);
+	dput(root);
+	mntput(rootmnt);
+	return res;
+}
+
 /*
  * NOTE! The user-level library version returns a
  * character pointer. The kernel system call just
diff -urpN linux-2.5.47/include/linux/dcache.h linux-2.5.47-wait/include/linux/dcache.h
--- linux-2.5.47/include/linux/dcache.h	2002-11-14 23:42:02.000000000 -0800
+++ linux-2.5.47-wait/include/linux/dcache.h	2002-11-15 15:09:46.000000000 -0800
@@ -238,8 +238,7 @@ extern struct dentry * __d_lookup(struct
 /* validate "insecure" dentry pointer */
 extern int d_validate(struct dentry *, struct dentry *);
 
-extern char * __d_path(struct dentry *, struct vfsmount *, struct dentry *,
-	struct vfsmount *, char *, int);
+extern char * d_path(struct dentry *, struct vfsmount *, char *, int);
   
 /* Allocation counts.. */
 
diff -urpN linux-2.5.47/include/linux/sched.h linux-2.5.47-wait/include/linux/sched.h
--- linux-2.5.47/include/linux/sched.h	2002-11-15 01:50:53.000000000 -0800
+++ linux-2.5.47-wait/include/linux/sched.h	2002-11-15 15:09:43.000000000 -0800
@@ -794,26 +794,6 @@ static inline void task_unlock(struct ta
 {
 	spin_unlock(&p->alloc_lock);
 }
-
-/* write full pathname into buffer and return start of pathname */
-static inline char * d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
-				char *buf, int buflen)
-{
-	char *res;
-	struct vfsmount *rootmnt;
-	struct dentry *root;
-	read_lock(&current->fs->lock);
-	rootmnt = mntget(current->fs->rootmnt);
-	root = dget(current->fs->root);
-	read_unlock(&current->fs->lock);
-	spin_lock(&dcache_lock);
-	res = __d_path(dentry, vfsmnt, root, rootmnt, buf, buflen);
-	spin_unlock(&dcache_lock);
-	dput(root);
-	mntput(rootmnt);
-	return res;
-}
-
  
 /**
  * get_task_mm - acquire a reference to the task's mm
diff -urpN linux-2.5.47/kernel/ksyms.c linux-2.5.47-wait/kernel/ksyms.c
--- linux-2.5.47/kernel/ksyms.c	2002-11-14 23:42:02.000000000 -0800
+++ linux-2.5.47-wait/kernel/ksyms.c	2002-11-15 15:09:46.000000000 -0800
@@ -166,7 +166,7 @@ EXPORT_SYMBOL(d_alloc);
 EXPORT_SYMBOL(d_alloc_anon);
 EXPORT_SYMBOL(d_splice_alias);
 EXPORT_SYMBOL(d_lookup);
-EXPORT_SYMBOL(__d_path);
+EXPORT_SYMBOL(d_path);
 EXPORT_SYMBOL(mark_buffer_dirty);
 EXPORT_SYMBOL(end_buffer_io_sync);
 EXPORT_SYMBOL(__mark_inode_dirty);
