aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exportfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exportfs')
-rw-r--r--fs/exportfs/expfs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index abf0a316aa1a..085d6c547f44 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -37,6 +37,9 @@ static int exportfs_get_name(struct dentry *dir, char *name,
37 return get_name(dir, name, child); 37 return get_name(dir, name, child);
38} 38}
39 39
40/*
41 * Check if the dentry or any of it's aliases is acceptable.
42 */
40static struct dentry * 43static struct dentry *
41find_acceptable_alias(struct dentry *result, 44find_acceptable_alias(struct dentry *result,
42 int (*acceptable)(void *context, struct dentry *dentry), 45 int (*acceptable)(void *context, struct dentry *dentry),
@@ -44,6 +47,9 @@ find_acceptable_alias(struct dentry *result,
44{ 47{
45 struct dentry *dentry, *toput = NULL; 48 struct dentry *dentry, *toput = NULL;
46 49
50 if (acceptable(context, result))
51 return result;
52
47 spin_lock(&dcache_lock); 53 spin_lock(&dcache_lock);
48 list_for_each_entry(dentry, &result->d_inode->i_dentry, d_alias) { 54 list_for_each_entry(dentry, &result->d_inode->i_dentry, d_alias) {
49 dget_locked(dentry); 55 dget_locked(dentry);
@@ -126,9 +132,6 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
126 132
127 target_dir = dget(result); 133 target_dir = dget(result);
128 } else { 134 } else {
129 if (acceptable(context, result))
130 return result;
131
132 alias = find_acceptable_alias(result, acceptable, context); 135 alias = find_acceptable_alias(result, acceptable, context);
133 if (alias) 136 if (alias)
134 return alias; 137 return alias;
@@ -289,9 +292,6 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
289 } 292 }
290 } 293 }
291 dput(target_dir); 294 dput(target_dir);
292 /* now result is properly connected, it is our best bet */
293 if (acceptable(context, result))
294 return result;
295 295
296 alias = find_acceptable_alias(result, acceptable, context); 296 alias = find_acceptable_alias(result, acceptable, context);
297 if (alias) 297 if (alias)