diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-03-03 19:25:31 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-04-02 08:09:26 +0300 |
commit | 4542576b79a680062dc344a8a6e79d34b4c91bf1 (patch) | |
tree | 6aab4d7cd590b1aeccf0a0ad99ff3f72e999a5be /fs/namei.c | |
parent | 49055906af51b59d50a34b18820f85cc7d085218 (diff) | |
download | linux-4542576b79a680062dc344a8a6e79d34b4c91bf1.tar.xz |
reserve_stack(): switch to __nd_alloc_stack()
expand the call of nd_alloc_stack() into it (and don't
recheck the depth on the second call)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/namei.c b/fs/namei.c index 6025406e01e5..0539a26dd9b4 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -566,15 +566,6 @@ static bool path_connected(struct vfsmount *mnt, struct dentry *dentry) return is_subdir(dentry, mnt->mnt_root); } -static inline int nd_alloc_stack(struct nameidata *nd) -{ - if (likely(nd->depth != EMBEDDED_LEVELS)) - return 0; - if (likely(nd->stack != nd->internal)) - return 0; - return __nd_alloc_stack(nd); -} - static void drop_links(struct nameidata *nd) { int i = nd->depth; @@ -1586,7 +1577,13 @@ static int reserve_stack(struct nameidata *nd, struct path *link, unsigned seq) if (unlikely(nd->total_link_count++ >= MAXSYMLINKS)) return -ELOOP; - error = nd_alloc_stack(nd); + + if (likely(nd->depth != EMBEDDED_LEVELS)) + return 0; + if (likely(nd->stack != nd->internal)) + return 0; + + error = __nd_alloc_stack(nd); if (likely(!error)) return 0; if (error == -ECHILD) { @@ -1597,7 +1594,7 @@ static int reserve_stack(struct nameidata *nd, struct path *link, unsigned seq) if (unlikely(!grabbed_link)) error = -ECHILD; if (!error) - error = nd_alloc_stack(nd); + error = __nd_alloc_stack(nd); } return error; } |