[v4 0/3] bcachefs: Casefolding implementation

Joshua Ashton
2023-08-14T01:25:19Z

This implements support for case-insensitive file and directory
lookups using the regular `chattr +F` (`S_CASEFOLD`, `FS_CASEFOLD_FL`)
casefolding attributes for bcachefs.

The implementation uses the same UTF-8 lowering and normalization that
ext4 and f2fs is using currently

The main usecase for casefolding is compatibility with software written
against other filesystems that rely on casefolded lookups
(eg. NTFS and Wine/Proton).
Taking advantage of file-system level casefolding can lead to great
loading time gains in many applications and games.

See more information and rationale in:
Documentation/filesystems/bcachefs/casefolding.rst

You can see/review the work in my tree here:
https://github.com/Joshua-Ashton/bcachefs/tree/casefold

v2: Update format to store length in dirent based on flag, add comments, cleanup
dirent_create_key, other misc. nits from IRC.

v3: Cleanup the dirent code, utilize the fact that BCH_NAME_MAX is smaller now,
remove fallbacks for too big keys that won't make sense anymore. Improved
lookup string lowering.

v4: Move cf_name allocation from stack to trans alloc, validated bkey in invalid,
used length directly, misc. nits.

Joshua Ashton (3):
bcachefs: Split out dirent alloc and name initialization
bcachefs: Move dirent_val_u64s to dirent.c
bcachefs: Implement casefolding

.../filesystems/bcachefs/casefolding.rst | 73 ++++++
fs/bcachefs/bcachefs.h | 6 +
fs/bcachefs/bcachefs_format.h | 26 ++-
fs/bcachefs/dirent.c | 219 +++++++++++++++---
fs/bcachefs/dirent.h | 6 -
fs/bcachefs/fs-common.c | 4 +
fs/bcachefs/fs-ioctl.c | 22 ++
fs/bcachefs/fs-ioctl.h | 20 +-
fs/bcachefs/str_hash.h | 4 +
fs/bcachefs/super.c | 19 ++
10 files changed, 353 insertions(+), 46 deletions(-)
create mode 100644 Documentation/filesystems/bcachefs/casefolding.rst

--
2.41.0