linux/fs/fat
Javier Martinez Canillas da87e1725a fat: add renameat2 RENAME_EXCHANGE flag support
The renameat2 RENAME_EXCHANGE flag allows to atomically exchange two paths
but is currently not supported by the Linux vfat filesystem driver.

Add a vfat_rename_exchange() helper function that implements this support.

The super block lock is acquired during the operation to ensure atomicity,
and in the error path actions made are reversed also with the mutex held.

It makes the operation as transactional as possible, within the limitation
impossed by vfat due not having a journal with logs to replay.

Link: https://lkml.kernel.org/r/20220610075721.1182745-4-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Alexander Larsson <alexl@redhat.com>
Cc: Christian Kellner <ckellner@redhat.com>
Cc: Chung-Chiang Cheng <cccheng@synology.com>
Cc: Colin Walters <walters@verbum.org>
Cc: Lennart Poettering <lennart@poettering.net>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Peter Jones <pjones@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-16 19:58:22 -07:00
..
.kunitconfig fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
cache.c fat: new inline functions to determine the FAT variant (32, 16 or 12) 2019-01-04 13:13:47 -08:00
dir.c fat: use pointer to simple type in put_user() 2022-03-23 19:00:34 -07:00
fat_test.c fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
fat.h fat: remove time truncations in vfat_create/vfat_mkdir 2022-05-19 14:10:31 -07:00
fatent.c fat: add ratelimit to fat*_ent_bread() 2022-04-29 14:38:02 -07:00
file.c Not a lot of material this cycle. Many singleton patches against various 2022-05-27 11:22:03 -07:00
inode.c Not a lot of material this cycle. Many singleton patches against various 2022-05-27 11:22:03 -07:00
Kconfig fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
Makefile fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
misc.c fat: remove time truncations in vfat_create/vfat_mkdir 2022-05-19 14:10:31 -07:00
namei_msdos.c fat: handle idmapped mounts 2021-01-24 14:43:46 +01:00
namei_vfat.c fat: add renameat2 RENAME_EXCHANGE flag support 2022-06-16 19:58:22 -07:00
nfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00