lkml.org 
[lkml]   [2020]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 04/17] follow_automount() doesn't need the entire nameidata
Date
From: Al Viro <viro@zeniv.linux.org.uk>

only the address of ->total_link_count and the flags

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/namei.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index d30a74a18da9..3b6f60c02f8a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1133,7 +1133,7 @@ EXPORT_SYMBOL(follow_up);
* - return -EISDIR to tell follow_managed() to stop and return the path we
* were called with.
*/
-static int follow_automount(struct path *path, struct nameidata *nd)
+static int follow_automount(struct path *path, int *count, unsigned lookup_flags)
{
struct dentry *dentry = path->dentry;

@@ -1148,13 +1148,12 @@ static int follow_automount(struct path *path, struct nameidata *nd)
* as being automount points. These will need the attentions
* of the daemon to instantiate them before they can be used.
*/
- if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
+ if (!(lookup_flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
LOOKUP_OPEN | LOOKUP_CREATE | LOOKUP_AUTOMOUNT)) &&
dentry->d_inode)
return -EISDIR;

- nd->total_link_count++;
- if (nd->total_link_count >= 40)
+ if (count && *count++ >= 40)
return -ELOOP;

return finish_automount(dentry->d_op->d_automount(path), path);
@@ -1215,7 +1214,8 @@ static int follow_managed(struct path *path, struct nameidata *nd)

/* Handle an automount point */
if (flags & DCACHE_NEED_AUTOMOUNT) {
- ret = follow_automount(path, nd);
+ ret = follow_automount(path, &nd->total_link_count,
+ nd->flags);
if (ret < 0)
break;
continue;
--
2.20.1
\
 
 \ /
  Last update: 2020-01-19 04:19    [W:0.172 / U:8.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site