lkml.org 
[lkml]   [2020]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH v4 60/69] reserve_stack(): switch to __nd_alloc_stack()
Date
From: Al Viro <viro@zeniv.linux.org.uk>

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>
---
fs/namei.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index c27f657c6b71..01ffbc58e761 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;
}
--
2.11.0
\
 
 \ /
  Last update: 2020-03-14 00:55    [W:0.269 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site