aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-24 18:10:25 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:34 -0500
commit21b9b073924aceb6b8d19c49f61daa86c0340e1a (patch)
tree8541c341b6742450dfe1958d3d234f11ca3ec580
parent5f4a6a695075b79261793c25b1128e3b30007646 (diff)
get rid of name and type arguments of walk_component()
... always can be found in nameidata now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/namei.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 14eab848f7d8..5f6da6cca394 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1519,7 +1519,7 @@ static inline int should_follow_link(struct inode *inode, int follow)
1519} 1519}
1520 1520
1521static inline int walk_component(struct nameidata *nd, struct path *path, 1521static inline int walk_component(struct nameidata *nd, struct path *path,
1522 struct qstr *name, int type, int follow) 1522 int follow)
1523{ 1523{
1524 struct inode *inode; 1524 struct inode *inode;
1525 int err; 1525 int err;
@@ -1528,14 +1528,14 @@ static inline int walk_component(struct nameidata *nd, struct path *path,
1528 * to be able to know about the current root directory and 1528 * to be able to know about the current root directory and
1529 * parent relationships. 1529 * parent relationships.
1530 */ 1530 */
1531 if (unlikely(type != LAST_NORM)) 1531 if (unlikely(nd->last_type != LAST_NORM))
1532 return handle_dots(nd, type); 1532 return handle_dots(nd, nd->last_type);
1533 err = lookup_fast(nd, name, path, &inode); 1533 err = lookup_fast(nd, &nd->last, path, &inode);
1534 if (unlikely(err)) { 1534 if (unlikely(err)) {
1535 if (err < 0) 1535 if (err < 0)
1536 goto out_err; 1536 goto out_err;
1537 1537
1538 err = lookup_slow(nd, name, path); 1538 err = lookup_slow(nd, &nd->last, path);
1539 if (err < 0) 1539 if (err < 0)
1540 goto out_err; 1540 goto out_err;
1541 1541
@@ -1594,8 +1594,7 @@ static inline int nested_symlink(struct path *path, struct nameidata *nd)
1594 res = follow_link(&link, nd, &cookie); 1594 res = follow_link(&link, nd, &cookie);
1595 if (res) 1595 if (res)
1596 break; 1596 break;
1597 res = walk_component(nd, path, &nd->last, 1597 res = walk_component(nd, path, LOOKUP_FOLLOW);
1598 nd->last_type, LOOKUP_FOLLOW);
1599 put_link(nd, &link, cookie); 1598 put_link(nd, &link, cookie);
1600 } while (res > 0); 1599 } while (res > 0);
1601 1600
@@ -1819,7 +1818,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
1819 1818
1820 name += len; 1819 name += len;
1821 1820
1822 err = walk_component(nd, &next, &this, type, LOOKUP_FOLLOW); 1821 err = walk_component(nd, &next, LOOKUP_FOLLOW);
1823 if (err < 0) 1822 if (err < 0)
1824 return err; 1823 return err;
1825 1824
@@ -1930,8 +1929,7 @@ static inline int lookup_last(struct nameidata *nd, struct path *path)
1930 nd->flags |= LOOKUP_FOLLOW | LOOKUP_DIRECTORY; 1929 nd->flags |= LOOKUP_FOLLOW | LOOKUP_DIRECTORY;
1931 1930
1932 nd->flags &= ~LOOKUP_PARENT; 1931 nd->flags &= ~LOOKUP_PARENT;
1933 return walk_component(nd, path, &nd->last, nd->last_type, 1932 return walk_component(nd, path, nd->flags & LOOKUP_FOLLOW);
1934 nd->flags & LOOKUP_FOLLOW);
1935} 1933}
1936 1934
1937/* Returns 0 and nd will be valid on success; Retuns error, otherwise. */ 1935/* Returns 0 and nd will be valid on success; Retuns error, otherwise. */