Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

user_statfs(): import pathname only once

Convert the user_path_at() call inside a retry loop into getname_flags() +
filename_lookup() + putname() and leave only filename_lookup() inside
the loop.

In this case we never pass LOOKUP_EMPTY, so getname_flags() is equivalent
to plain getname().

The things could be further simplified by use of cleanup.h stuff, but
let's not clutter the patch with that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 85a4fe3c c3fa2b7c

+3 -1
+3 -1
fs/statfs.c
··· 99 99 struct path path; 100 100 int error; 101 101 unsigned int lookup_flags = LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT; 102 + struct filename *name = getname(pathname); 102 103 retry: 103 - error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); 104 + error = filename_lookup(AT_FDCWD, name, lookup_flags, &path, NULL); 104 105 if (!error) { 105 106 error = vfs_statfs(&path, st); 106 107 path_put(&path); ··· 110 109 goto retry; 111 110 } 112 111 } 112 + putname(name); 113 113 return error; 114 114 } 115 115