| summaryrefslogtreecommitdiff |
| author | Jan Kara <jack@suse.cz> | 2011-07-14 12:47:44 (GMT) |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2011-07-14 12:47:44 (GMT) |
| commit | ffa5306f4481fce98a4e5a3a9093bbb4735e84c9 (patch) (side-by-side diff) | |
| tree | 667625237cda9fe4f517cb5cdb75dfb2e42c5a78 | |
| parent | fb2e2b0fe4da8dcebd075ae3b08c9fea4284feb5 (diff) | |
| parent | 191b3fc1bc99ccc3e6b206bdc60db382c69a54b4 (diff) | |
Merge branch 'SLE11-SP1' of ssh://kerncvs.suse.de/home/git/kernel-source into SLE11-SP1rpm-2.6.32.43-0.4
Conflicts:
series.conf
suse-commit: 7da281afbd78855773911f3b44d7d45efa04ec20
| -rw-r--r-- | fs/dcache.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 74aa57f..a3bbcd0 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1448,41 +1448,30 @@ out: } /** - * d_validate - verify dentry provided from insecure source + * d_validate - verify dentry provided from insecure source (deprecated) * @dentry: The dentry alleged to be valid child of @dparent * @dparent: The parent dentry (known to be valid) * * An insecure source has sent us a dentry, here we verify it and dget() it. * This is used by ncpfs in its readdir implementation. * Zero is returned in the dentry is invalid. + * + * This function is slow for big directories, and deprecated, do not use it. */ - int d_validate(struct dentry *dentry, struct dentry *dparent) { - struct hlist_head *base; - struct hlist_node *lhp; - - /* Check whether the ptr might be valid at all.. */ - if (!kmem_ptr_validate(dentry_cache, dentry)) - goto out; - - if (dentry->d_parent != dparent) - goto out; + struct dentry *child; spin_lock(&dcache_lock); - base = d_hash(dparent, dentry->d_name.hash); - hlist_for_each(lhp,base) { - /* hlist_for_each_entry_rcu() not required for d_hash list - * as it is parsed under dcache_lock - */ - if (dentry == hlist_entry(lhp, struct dentry, d_hash)) { + list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) { + if (dentry == child) { __dget_locked(dentry); spin_unlock(&dcache_lock); return 1; } } spin_unlock(&dcache_lock); -out: + return 0; } |