Skip to content

Commit 4542576

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent 4905590 commit 4542576

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

fs/namei.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -566,15 +566,6 @@ static bool path_connected(struct vfsmount *mnt, struct dentry *dentry)
566566
return is_subdir(dentry, mnt->mnt_root);
567567
}
568568

569-
static inline int nd_alloc_stack(struct nameidata *nd)
570-
{
571-
if (likely(nd->depth != EMBEDDED_LEVELS))
572-
return 0;
573-
if (likely(nd->stack != nd->internal))
574-
return 0;
575-
return __nd_alloc_stack(nd);
576-
}
577-
578569
static void drop_links(struct nameidata *nd)
579570
{
580571
int i = nd->depth;
@@ -1586,7 +1577,13 @@ static int reserve_stack(struct nameidata *nd, struct path *link, unsigned seq)
15861577

15871578
if (unlikely(nd->total_link_count++ >= MAXSYMLINKS))
15881579
return -ELOOP;
1589-
error = nd_alloc_stack(nd);
1580+
1581+
if (likely(nd->depth != EMBEDDED_LEVELS))
1582+
return 0;
1583+
if (likely(nd->stack != nd->internal))
1584+
return 0;
1585+
1586+
error = __nd_alloc_stack(nd);
15901587
if (likely(!error))
15911588
return 0;
15921589
if (error == -ECHILD) {
@@ -1597,7 +1594,7 @@ static int reserve_stack(struct nameidata *nd, struct path *link, unsigned seq)
15971594
if (unlikely(!grabbed_link))
15981595
error = -ECHILD;
15991596
if (!error)
1600-
error = nd_alloc_stack(nd);
1597+
error = __nd_alloc_stack(nd);
16011598
}
16021599
return error;
16031600
}

0 commit comments

Comments
 (0)