]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs: Create sb_encoding() helper
authorAndré Almeida <andrealmeid@igalia.com>
Thu, 14 Aug 2025 17:22:12 +0000 (14:22 -0300)
committerAmir Goldstein <amir73il@gmail.com>
Tue, 23 Sep 2025 10:28:50 +0000 (12:28 +0200)
commit9095d207417477eb50e84fd0652895db77ec584e
tree62ca511ca01fba5e98f2d983c5986abb4467c212
parent1b237f190eb3d36f52dffe07a40b5eb210280e00
fs: Create sb_encoding() helper

Filesystems that need to deal with the super block encoding need to use
a if IS_ENABLED(CONFIG_UNICODE) around it because this struct member is
not declared otherwise. In order to move this if/endif guards outside of
the filesytem code and make it simpler, create a new function that
returns the s_encoding member of struct super_block if Unicode is
enabled, and return NULL otherwise.

Suggested-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Gabriel Krisman Bertazi <gabriel@krisman.be>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
include/linux/fs.h