diff options
| -rw-r--r-- | fs/dcache.c | 25 | ||||
| -rw-r--r-- | include/linux/dcache.h | 3 | ||||
| -rw-r--r-- | include/linux/sched.h | 20 | ||||
| -rw-r--r-- | kernel/ksyms.c | 2 |
4 files changed, 24 insertions, 26 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index d0fcfeba16ee..38ea3d78ab6a 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1085,9 +1085,9 @@ void d_move(struct dentry * dentry, struct dentry * target) * * "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; @@ -1140,6 +1140,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(¤t->fs->lock); + rootmnt = mntget(current->fs->rootmnt); + root = dget(current->fs->root); + read_unlock(¤t->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 --git a/include/linux/dcache.h b/include/linux/dcache.h index 0afc6a560a8d..72bafcf17fce 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -228,8 +228,7 @@ extern struct dentry * __d_lookup(struct dentry *, struct qstr *); /* 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 --git a/include/linux/sched.h b/include/linux/sched.h index 93b1328d59e4..2a339b572d04 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -848,26 +848,6 @@ static inline void task_unlock(struct task_struct *p) { 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(¤t->fs->lock); - rootmnt = mntget(current->fs->rootmnt); - root = dget(current->fs->root); - read_unlock(¤t->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 --git a/kernel/ksyms.c b/kernel/ksyms.c index 65537e41d098..1b85bc771653 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -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); |
