public inbox for linux-api@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] vfs: mkdirat_fd() syscall
@ 2026-03-31 17:19 Jori Koolstra
  2026-03-31 17:19 ` [RFC PATCH 1/2] vfs: syscalls: add mkdirat_fd() Jori Koolstra
  2026-03-31 17:19 ` [RFC PATCH 2/2] selftest: add tests for mkdirat_fd() Jori Koolstra
  0 siblings, 2 replies; 13+ messages in thread
From: Jori Koolstra @ 2026-03-31 17:19 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, Alexander Viro, Christian Brauner, Jeff Layton,
	Chuck Lever, Arnd Bergmann, Shuah Khan, Greg Kroah-Hartman
  Cc: H . Peter Anvin, Jan Kara, Alexander Aring, Peter Zijlstra,
	Oleg Nesterov, Andrey Albershteyn, Jiri Olsa, Mathieu Desnoyers,
	Thomas Weißschuh, Namhyung Kim, Arnaldo Carvalho de Melo,
	Aleksa Sarai, linux-kernel, linux-fsdevel, linux-api, linux-arch,
	linux-kselftest, cmirabil, Jori Koolstra

This series implements the mkdirat_fd() syscall that was suggested over
at the UAPI group kernel feature page [1] with some tests.

Obviously, if we want this we should also implement mknodeat_fd() and
symlinkat_fd(), but their implementation can be done quite similar I
believe.

I have added an unigned int flags like [2] suggests and an example flag
that we may want to remove (it right now mainly serves an internal
purpose). But it marks where I would want to place the definitions.

This has been compiled and tested on x86 only. [2] is a bit confusing
here and there, so I hope I have added the proper syscall definitions
everywhere where they needs to be added.

[1]: https://github.com/uapi-group/kernel-features?tab=readme-ov-file#race-free-creation-and-opening-of-non-file-inodes
[2]: https://www.kernel.org/doc/html/latest/process/adding-syscalls.html

Jori Koolstra (2):
  vfs: syscalls: add mkdirat_fd()
  selftest: add tests for mkdirat_fd()

 arch/x86/entry/syscalls/syscall_64.tbl        |   1 +
 fs/internal.h                                 |   1 +
 fs/namei.c                                    |  26 +++-
 include/linux/fcntl.h                         |   2 +
 include/linux/syscalls.h                      |   2 +
 include/uapi/asm-generic/fcntl.h              |   3 +
 include/uapi/asm-generic/unistd.h             |   5 +-
 scripts/syscall.tbl                           |   1 +
 tools/include/uapi/asm-generic/unistd.h       |   5 +-
 tools/testing/selftests/filesystems/Makefile  |   4 +-
 .../selftests/filesystems/mkdirat_fd_test.c   | 139 ++++++++++++++++++
 11 files changed, 183 insertions(+), 6 deletions(-)
 create mode 100644 tools/testing/selftests/filesystems/mkdirat_fd_test.c

-- 
2.53.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-04-07  9:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 17:19 [RFC PATCH 0/2] vfs: mkdirat_fd() syscall Jori Koolstra
2026-03-31 17:19 ` [RFC PATCH 1/2] vfs: syscalls: add mkdirat_fd() Jori Koolstra
2026-03-31 19:13   ` Arnd Bergmann
2026-04-01 14:09     ` David Laight
2026-03-31 20:25   ` Yann Droneaud
2026-03-31 20:42     ` H. Peter Anvin
2026-04-01  4:19   ` Mateusz Guzik
2026-04-01  9:44     ` Cyril Hrubis
2026-04-01 10:25     ` Jori Koolstra
2026-04-07  9:00       ` Mateusz Guzik
2026-04-02  2:52     ` Aleksa Sarai
2026-04-07  8:52       ` Mateusz Guzik
2026-03-31 17:19 ` [RFC PATCH 2/2] selftest: add tests for mkdirat_fd() Jori Koolstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox