diff options
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index cb4a10690868..265e0ce9769c 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -3116,26 +3116,28 @@ char *simple_dname(struct dentry *dentry, char *buffer, int buflen) | |||
3116 | /* | 3116 | /* |
3117 | * Write full pathname from the root of the filesystem into the buffer. | 3117 | * Write full pathname from the root of the filesystem into the buffer. |
3118 | */ | 3118 | */ |
3119 | static char *__dentry_path(struct dentry *dentry, char *buf, int buflen) | 3119 | static char *__dentry_path(struct dentry *d, char *buf, int buflen) |
3120 | { | 3120 | { |
3121 | struct dentry *dentry; | ||
3121 | char *end, *retval; | 3122 | char *end, *retval; |
3122 | int len, seq = 0; | 3123 | int len, seq = 0; |
3123 | int error = 0; | 3124 | int error = 0; |
3124 | 3125 | ||
3126 | if (buflen < 2) | ||
3127 | goto Elong; | ||
3128 | |||
3125 | rcu_read_lock(); | 3129 | rcu_read_lock(); |
3126 | restart: | 3130 | restart: |
3131 | dentry = d; | ||
3127 | end = buf + buflen; | 3132 | end = buf + buflen; |
3128 | len = buflen; | 3133 | len = buflen; |
3129 | prepend(&end, &len, "\0", 1); | 3134 | prepend(&end, &len, "\0", 1); |
3130 | if (buflen < 1) | ||
3131 | goto Elong; | ||
3132 | /* Get '/' right */ | 3135 | /* Get '/' right */ |
3133 | retval = end-1; | 3136 | retval = end-1; |
3134 | *retval = '/'; | 3137 | *retval = '/'; |
3135 | read_seqbegin_or_lock(&rename_lock, &seq); | 3138 | read_seqbegin_or_lock(&rename_lock, &seq); |
3136 | while (!IS_ROOT(dentry)) { | 3139 | while (!IS_ROOT(dentry)) { |
3137 | struct dentry *parent = dentry->d_parent; | 3140 | struct dentry *parent = dentry->d_parent; |
3138 | int error; | ||
3139 | 3141 | ||
3140 | prefetch(parent); | 3142 | prefetch(parent); |
3141 | error = prepend_name(&end, &len, &dentry->d_name); | 3143 | error = prepend_name(&end, &len, &dentry->d_name); |