summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-14 21:28:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-15 17:16:25 -0400
commitce0525449da56444948c368f52e10f3db0465338 (patch)
treedf50f16b0af733738b39c9430145d94e35a2abdb /fs/namei.c
parentbd92d7fed877ed1e6997e4f3f13dbcd872947653 (diff)
simplify link_path_walk() tail
Now that link_path_walk() is called without LOOKUP_PARENT only from do_follow_link(), we can simplify the checks in last component handling. First of all, checking if we'd arrived to a directory is not needed - the caller will check it anyway. And LOOKUP_FOLLOW is guaranteed to be there, since we only get to that place with nd->depth > 0. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/namei.c b/fs/namei.c
index a3431639e16..9575d003969 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1467,8 +1467,7 @@ last_component:
nd->last_type = type;
return 0;
}
- err = walk_component(nd, &next, &this, type,
- lookup_flags & LOOKUP_FOLLOW);
+ err = walk_component(nd, &next, &this, type, LOOKUP_FOLLOW);
if (err < 0)
return err;
if (err) {
@@ -1476,11 +1475,6 @@ last_component:
if (err)
return err;
}
- if (lookup_flags & LOOKUP_DIRECTORY) {
- err = -ENOTDIR;
- if (!nd->inode->i_op->lookup)
- break;
- }
return 0;
}
terminate_walk(nd);