Loading fs/namei.c +4 −14 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ void nd_jump_link(struct nameidata *nd, struct path *path) static inline void put_link(struct nameidata *nd) { struct saved *last = nd->stack + nd->depth; struct saved *last = nd->stack + --nd->depth; struct inode *inode = last->link.dentry->d_inode; if (last->cookie && inode->i_op->put_link) inode->i_op->put_link(last->link.dentry, last->cookie); Loading Loading @@ -1840,7 +1840,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) err = 0; if (unlikely(!s)) { /* jumped */ nd->depth--; put_link(nd); } else { if (*s == '/') { Loading Loading @@ -1868,16 +1867,13 @@ static int link_path_walk(const char *name, struct nameidata *nd) } terminate_walk(nd); Err: while (unlikely(nd->depth > 1)) { nd->depth--; while (unlikely(nd->depth > 1)) put_link(nd); } return err; OK: if (unlikely(nd->depth > 1)) { name = nd->stack[nd->depth - 1].name; err = walk_component(nd, LOOKUP_FOLLOW); nd->depth--; put_link(nd); goto Walked; } Loading Loading @@ -2021,13 +2017,10 @@ static int trailing_symlink(struct nameidata *nd) } nd->inode = nd->path.dentry->d_inode; error = link_path_walk(s, nd); if (unlikely(error)) { nd->depth--; if (unlikely(error)) put_link(nd); return error; } return 0; } static inline int lookup_last(struct nameidata *nd) { Loading Loading @@ -2066,7 +2059,6 @@ static int path_lookupat(int dfd, const struct filename *name, if (err) break; err = lookup_last(nd); nd->depth--; put_link(nd); } } Loading Loading @@ -2416,7 +2408,6 @@ path_mountpoint(int dfd, const struct filename *name, struct path *path, if (err) break; err = mountpoint_last(nd, path); nd->depth--; put_link(nd); } out: Loading Loading @@ -3301,7 +3292,6 @@ static struct file *path_openat(int dfd, struct filename *pathname, if (unlikely(error)) break; error = do_last(nd, file, op, &opened, pathname); nd->depth--; put_link(nd); } out: Loading Loading
fs/namei.c +4 −14 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ void nd_jump_link(struct nameidata *nd, struct path *path) static inline void put_link(struct nameidata *nd) { struct saved *last = nd->stack + nd->depth; struct saved *last = nd->stack + --nd->depth; struct inode *inode = last->link.dentry->d_inode; if (last->cookie && inode->i_op->put_link) inode->i_op->put_link(last->link.dentry, last->cookie); Loading Loading @@ -1840,7 +1840,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) err = 0; if (unlikely(!s)) { /* jumped */ nd->depth--; put_link(nd); } else { if (*s == '/') { Loading Loading @@ -1868,16 +1867,13 @@ static int link_path_walk(const char *name, struct nameidata *nd) } terminate_walk(nd); Err: while (unlikely(nd->depth > 1)) { nd->depth--; while (unlikely(nd->depth > 1)) put_link(nd); } return err; OK: if (unlikely(nd->depth > 1)) { name = nd->stack[nd->depth - 1].name; err = walk_component(nd, LOOKUP_FOLLOW); nd->depth--; put_link(nd); goto Walked; } Loading Loading @@ -2021,13 +2017,10 @@ static int trailing_symlink(struct nameidata *nd) } nd->inode = nd->path.dentry->d_inode; error = link_path_walk(s, nd); if (unlikely(error)) { nd->depth--; if (unlikely(error)) put_link(nd); return error; } return 0; } static inline int lookup_last(struct nameidata *nd) { Loading Loading @@ -2066,7 +2059,6 @@ static int path_lookupat(int dfd, const struct filename *name, if (err) break; err = lookup_last(nd); nd->depth--; put_link(nd); } } Loading Loading @@ -2416,7 +2408,6 @@ path_mountpoint(int dfd, const struct filename *name, struct path *path, if (err) break; err = mountpoint_last(nd, path); nd->depth--; put_link(nd); } out: Loading Loading @@ -3301,7 +3292,6 @@ static struct file *path_openat(int dfd, struct filename *pathname, if (unlikely(error)) break; error = do_last(nd, file, op, &opened, pathname); nd->depth--; put_link(nd); } out: Loading