summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMateusz Guzik <mjguzik@gmail.com>2024-06-25 17:18:06 +0200
committerChristian Brauner <brauner@kernel.org>2024-06-27 18:31:20 +0200
commit0ef625bba6fb2bc0c8ed2aab9524fdf423f67dd5 (patch)
treedac526478b2be72640552a7ab9def6664ece9052 /include/linux
parent27a2d0cb2f38c67b58285e6124b14f7fff3fd1a8 (diff)
downloadlinux-0ef625bba6fb2bc0c8ed2aab9524fdf423f67dd5.tar.gz
linux-0ef625bba6fb2bc0c8ed2aab9524fdf423f67dd5.tar.bz2
linux-0ef625bba6fb2bc0c8ed2aab9524fdf423f67dd5.zip
vfs: support statx(..., NULL, AT_EMPTY_PATH, ...)
The newly used helper also checks for empty ("") paths. NULL paths with any flag value other than AT_EMPTY_PATH go the usual route and end up with -EFAULT to retain compatibility (Rust is abusing calls of the sort to detect availability of statx). This avoids path lookup code, lockref management, memory allocation and in case of NULL path userspace memory access (which can be quite expensive with SMAP on x86_64). Benchmarked with statx(..., AT_EMPTY_PATH, ...) running on Sapphire Rapids, with the "" path for the first two cases and NULL for the last one. Results in ops/s: stock: 4231237 pre-check: 5944063 (+40%) NULL path: 6601619 (+11%/+56%) Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://lore.kernel.org/r/20240625151807.620812-1-mjguzik@gmail.com Tested-by: Xi Ruoyao <xry111@xry111.site> [brauner: use path_mounted() and other tweaks] Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions