Add support for renameat2(RENAME_EXCHANGE) on bpffs. This is useful for atomic upgrades of our sk_lookup control plane. v3: - Re-use shmem_exchange (Miklos) v2: - Test exchanging a map and a directory (Alexei) - Use ASSERT macros (Andrii) Lorenz Bauer (4): libfs: move shmem_exchange to simple_rename_exchange libfs: support RENAME_EXCHANGE in simple_rename() selftests: bpf: convert test_bpffs to ASSERT macros selftests: bpf: test RENAME_EXCHANGE and RENAME_NOREPLACE on bpffs fs/libfs.c | 29 ++++++- include/linux/fs.h | 2 + mm/shmem.c | 24 +----- .../selftests/bpf/prog_tests/test_bpffs.c | 85 ++++++++++++++++--- 4 files changed, 105 insertions(+), 35 deletions(-) -- 2.32.0