mirror of
https://github.com/torvalds/linux.git
synced 2025-11-01 00:58:39 +02:00
stat: use vfs_empty_path() helper
Use the newly added helper for this. Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
1bc6d4452d
commit
27a2d0cb2f
1 changed files with 2 additions and 10 deletions
10
fs/stat.c
10
fs/stat.c
|
|
@ -289,16 +289,8 @@ int vfs_fstatat(int dfd, const char __user *filename,
|
|||
* If AT_EMPTY_PATH is set, we expect the common case to be that
|
||||
* empty path, and avoid doing all the extra pathname work.
|
||||
*/
|
||||
if (dfd >= 0 && flags == AT_EMPTY_PATH) {
|
||||
char c;
|
||||
|
||||
ret = get_user(c, filename);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
|
||||
if (likely(!c))
|
||||
if (flags == AT_EMPTY_PATH && vfs_empty_path(dfd, filename))
|
||||
return vfs_fstat(dfd, stat);
|
||||
}
|
||||
|
||||
name = getname_flags(filename, getname_statx_lookup_flags(statx_flags));
|
||||
ret = vfs_statx(dfd, name, statx_flags, stat, STATX_BASIC_STATS);
|
||||
|
|
|
|||
Loading…
Reference in a new issue