aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exportfs/expfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exportfs/expfs.c')
-rw-r--r--fs/exportfs/expfs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index b0201ca6e9c6..29ab099e3e08 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -19,19 +19,19 @@
19#define dprintk(fmt, args...) do{}while(0) 19#define dprintk(fmt, args...) do{}while(0)
20 20
21 21
22static int get_name(struct vfsmount *mnt, struct dentry *dentry, char *name, 22static int get_name(const struct path *path, char *name, struct dentry *child);
23 struct dentry *child);
24 23
25 24
26static int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir, 25static int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir,
27 char *name, struct dentry *child) 26 char *name, struct dentry *child)
28{ 27{
29 const struct export_operations *nop = dir->d_sb->s_export_op; 28 const struct export_operations *nop = dir->d_sb->s_export_op;
29 struct path path = {.mnt = mnt, .dentry = dir};
30 30
31 if (nop->get_name) 31 if (nop->get_name)
32 return nop->get_name(dir, name, child); 32 return nop->get_name(dir, name, child);
33 else 33 else
34 return get_name(mnt, dir, name, child); 34 return get_name(&path, name, child);
35} 35}
36 36
37/* 37/*
@@ -44,13 +44,14 @@ find_acceptable_alias(struct dentry *result,
44{ 44{
45 struct dentry *dentry, *toput = NULL; 45 struct dentry *dentry, *toput = NULL;
46 struct inode *inode; 46 struct inode *inode;
47 struct hlist_node *p;
47 48
48 if (acceptable(context, result)) 49 if (acceptable(context, result))
49 return result; 50 return result;
50 51
51 inode = result->d_inode; 52 inode = result->d_inode;
52 spin_lock(&inode->i_lock); 53 spin_lock(&inode->i_lock);
53 list_for_each_entry(dentry, &inode->i_dentry, d_alias) { 54 hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) {
54 dget(dentry); 55 dget(dentry);
55 spin_unlock(&inode->i_lock); 56 spin_unlock(&inode->i_lock);
56 if (toput) 57 if (toput)
@@ -248,11 +249,10 @@ static int filldir_one(void * __buf, const char * name, int len,
248 * calls readdir on the parent until it finds an entry with 249 * calls readdir on the parent until it finds an entry with
249 * the same inode number as the child, and returns that. 250 * the same inode number as the child, and returns that.
250 */ 251 */
251static int get_name(struct vfsmount *mnt, struct dentry *dentry, 252static int get_name(const struct path *path, char *name, struct dentry *child)
252 char *name, struct dentry *child)
253{ 253{
254 const struct cred *cred = current_cred(); 254 const struct cred *cred = current_cred();
255 struct inode *dir = dentry->d_inode; 255 struct inode *dir = path->dentry->d_inode;
256 int error; 256 int error;
257 struct file *file; 257 struct file *file;
258 struct getdents_callback buffer; 258 struct getdents_callback buffer;
@@ -266,7 +266,7 @@ static int get_name(struct vfsmount *mnt, struct dentry *dentry,
266 /* 266 /*
267 * Open the directory ... 267 * Open the directory ...
268 */ 268 */
269 file = dentry_open(dget(dentry), mntget(mnt), O_RDONLY, cred); 269 file = dentry_open(path, O_RDONLY, cred);
270 error = PTR_ERR(file); 270 error = PTR_ERR(file);
271 if (IS_ERR(file)) 271 if (IS_ERR(file))
272 goto out; 272 goto out;