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

Commit d774a058 authored by Al Viro's avatar Al Viro
Browse files

untangling do_lookup() - massage !dentry case towards __lookup_hash()



Reorder if-else cases for starters...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 08b0ab7c
Loading
Loading
Loading
Loading
+20 −25
Original line number Diff line number Diff line
@@ -1174,23 +1174,13 @@ retry:

		mutex_lock(&dir->i_mutex);
		dentry = d_lookup(parent, name);
		if (likely(!dentry)) {
			dentry = d_alloc_and_lookup(parent, name, nd);
			if (IS_ERR(dentry)) {
				mutex_unlock(&dir->i_mutex);
				return PTR_ERR(dentry);
			}
			/* known good */
			status = 1;
		} else if (unlikely(d_need_lookup(dentry))) {
		if (dentry && d_need_lookup(dentry)) {
			dentry = d_inode_lookup(parent, dentry, nd);
			if (IS_ERR(dentry)) {
				mutex_unlock(&dir->i_mutex);
				return PTR_ERR(dentry);
			}
			/* known good */
			status = 1;
		} else if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE))
		} else if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) {
			status = d_revalidate(dentry, nd);
			if (unlikely(status <= 0)) {
				if (status < 0) {
@@ -1205,8 +1195,13 @@ retry:
						mutex_unlock(&dir->i_mutex);
						return PTR_ERR(dentry);
					}
				/* known good */
				status = 1;
				}
			}
		} else if (!dentry) {
			dentry = d_alloc_and_lookup(parent, name, nd);
			if (IS_ERR(dentry)) {
				mutex_unlock(&dir->i_mutex);
				return PTR_ERR(dentry);
			}
		}
		mutex_unlock(&dir->i_mutex);