aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-24 22:47:00 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-01-25 23:16:26 -0500
commitd6cb125b9983e1ea9444f794b2d3ed5e3ad737b7 (patch)
tree9758e077dd788590273921af0719a34b6fde4ce4
parent5e993e2534e29b62790f9a2908b551b7fb3a63f0 (diff)
kill d_validate()
no users left Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/dcache.c31
-rw-r--r--include/linux/dcache.h3
2 files changed, 0 insertions, 34 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index e368d4f412f9..40432e59d72e 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2187,37 +2187,6 @@ struct dentry *d_hash_and_lookup(struct dentry *dir, struct qstr *name)
2187} 2187}
2188EXPORT_SYMBOL(d_hash_and_lookup); 2188EXPORT_SYMBOL(d_hash_and_lookup);
2189 2189
2190/**
2191 * d_validate - verify dentry provided from insecure source (deprecated)
2192 * @dentry: The dentry alleged to be valid child of @dparent
2193 * @dparent: The parent dentry (known to be valid)
2194 *
2195 * An insecure source has sent us a dentry, here we verify it and dget() it.
2196 * This is used by ncpfs in its readdir implementation.
2197 * Zero is returned in the dentry is invalid.
2198 *
2199 * This function is slow for big directories, and deprecated, do not use it.
2200 */
2201int d_validate(struct dentry *dentry, struct dentry *dparent)
2202{
2203 struct dentry *child;
2204
2205 spin_lock(&dparent->d_lock);
2206 list_for_each_entry(child, &dparent->d_subdirs, d_child) {
2207 if (dentry == child) {
2208 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
2209 __dget_dlock(dentry);
2210 spin_unlock(&dentry->d_lock);
2211 spin_unlock(&dparent->d_lock);
2212 return 1;
2213 }
2214 }
2215 spin_unlock(&dparent->d_lock);
2216
2217 return 0;
2218}
2219EXPORT_SYMBOL(d_validate);
2220
2221/* 2190/*
2222 * When a file is deleted, we have two options: 2191 * When a file is deleted, we have two options:
2223 * - turn this dentry into a negative dentry 2192 * - turn this dentry into a negative dentry
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 5a813988e6d4..92c08cf7670e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -319,9 +319,6 @@ static inline unsigned d_count(const struct dentry *dentry)
319 return dentry->d_lockref.count; 319 return dentry->d_lockref.count;
320} 320}
321 321
322/* validate "insecure" dentry pointer */
323extern int d_validate(struct dentry *, struct dentry *);
324
325/* 322/*
326 * helper function for dentry_operations.d_dname() members 323 * helper function for dentry_operations.d_dname() members
327 */ 324 */