Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9393bd07 authored by Al Viro's avatar Al Viro
Browse files

switch follow_down()



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 589ff870
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
	case -EBUSY:
		/* someone else made a mount here whilst we were busy */
		while (d_mountpoint(nd->path.dentry) &&
		       follow_down(&nd->path.mnt, &nd->path.dentry))
		       follow_down(&nd->path))
			;
		err = 0;
	default:
+2 −3
Original line number Diff line number Diff line
@@ -85,13 +85,12 @@ struct autofs_dir_ent *autofs_expire(struct super_block *sb,
		}
		path.mnt = mnt;
		path_get(&path);
		if (!follow_down(&path.mnt, &path.dentry)) {
		if (!follow_down(&path)) {
			path_put(&path);
			DPRINTK(("autofs: not expirable (not a mounted directory): %s\n", ent->name));
			continue;
		}
		while (d_mountpoint(path.dentry) &&
		       follow_down(&path.mnt, &path.dentry))
		while (d_mountpoint(path.dentry) && follow_down(&path));
			;
		umount_ok = may_umount(path.mnt);
		path_put(&path);
+3 −3
Original line number Diff line number Diff line
@@ -223,12 +223,12 @@ int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify);
int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int);
void autofs4_catatonic_mode(struct autofs_sb_info *);

static inline int autofs4_follow_mount(struct vfsmount **mnt, struct dentry **dentry)
static inline int autofs4_follow_mount(struct path *path)
{
	int res = 0;

	while (d_mountpoint(*dentry)) {
		int followed = follow_down(mnt, dentry);
	while (d_mountpoint(path->dentry)) {
		int followed = follow_down(path);
		if (!followed)
			break;
		res = 1;
+1 −1
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
		err = have_submounts(path.dentry);

		if (path.mnt->mnt_mountpoint != path.mnt->mnt_root) {
			if (follow_down(&path.mnt, &path.dentry))
			if (follow_down(&path))
				magic = path.mnt->mnt_sb->s_magic;
		}
	}
+7 −8
Original line number Diff line number Diff line
@@ -48,19 +48,19 @@ static inline int autofs4_can_expire(struct dentry *dentry,
static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
{
	struct dentry *top = dentry;
	struct path path = {.mnt = mnt, .dentry = dentry};
	int status = 1;

	DPRINTK("dentry %p %.*s",
		dentry, (int)dentry->d_name.len, dentry->d_name.name);

	mntget(mnt);
	dget(dentry);
	path_get(&path);

	if (!follow_down(&mnt, &dentry))
	if (!follow_down(&path))
		goto done;

	if (is_autofs4_dentry(dentry)) {
		struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
	if (is_autofs4_dentry(path.dentry)) {
		struct autofs_sb_info *sbi = autofs4_sbi(path.dentry->d_sb);

		/* This is an autofs submount, we can't expire it */
		if (autofs_type_indirect(sbi->type))
@@ -70,7 +70,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
		 * Otherwise it's an offset mount and we need to check
		 * if we can umount its mount, if there is one.
		 */
		if (!d_mountpoint(dentry)) {
		if (!d_mountpoint(path.dentry)) {
			status = 0;
			goto done;
		}
@@ -86,8 +86,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
	status = 0;
done:
	DPRINTK("returning = %d", status);
	dput(dentry);
	mntput(mnt);
	path_put(&path);
	return status;
}

Loading