Skip to content

Commit

Permalink
switch follow_up() to struct path
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jun 12, 2009
1 parent e64c390 commit bab77eb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion fs/autofs4/dev-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static int find_autofs_mount(const char *pathname,
err = 0;
}
}
if (!follow_up(&path.mnt, &path.dentry))
if (!follow_up(&path))
break;
}
path_put(&path);
Expand Down
16 changes: 8 additions & 8 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,23 +675,23 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd)
return err;
}

int follow_up(struct vfsmount **mnt, struct dentry **dentry)
int follow_up(struct path *path)
{
struct vfsmount *parent;
struct dentry *mountpoint;
spin_lock(&vfsmount_lock);
parent=(*mnt)->mnt_parent;
if (parent == *mnt) {
parent = path->mnt->mnt_parent;
if (parent == path->mnt) {
spin_unlock(&vfsmount_lock);
return 0;
}
mntget(parent);
mountpoint=dget((*mnt)->mnt_mountpoint);
mountpoint = dget(path->mnt->mnt_mountpoint);
spin_unlock(&vfsmount_lock);
dput(*dentry);
*dentry = mountpoint;
mntput(*mnt);
*mnt = parent;
dput(path->dentry);
path->dentry = mountpoint;
mntput(path->mnt);
path->mnt = parent;
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp,
.dentry = dget(dparent)};

while (path.dentry == path.mnt->mnt_root &&
follow_up(&path.mnt, &path.dentry))
follow_up(&path))
;
dp = dget_parent(path.dentry);
dput(path.dentry);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/namei.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
extern struct dentry *lookup_one_noperm(const char *, struct dentry *);

extern int follow_down(struct vfsmount **, struct dentry **);
extern int follow_up(struct vfsmount **, struct dentry **);
extern int follow_up(struct path *);

extern struct dentry *lock_rename(struct dentry *, struct dentry *);
extern void unlock_rename(struct dentry *, struct dentry *);
Expand Down

0 comments on commit bab77eb

Please sign in to comment.