]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb/client: autogenerate SMB1 DOS/SRV to POSIX error mapping
authorHuiwen He <hehuiwen@kylinos.cn>
Thu, 2 Apr 2026 14:18:36 +0000 (14:18 +0000)
committerSteve French <stfrench@microsoft.com>
Mon, 6 Apr 2026 00:58:40 +0000 (19:58 -0500)
commit58ac796bb3c0f7b8295046404629724b68b40fa0
tree8cb370a0d25afb639427507239693702e2a05a94
parentcd4e653a2f75517b4ba8a0589856aeb529a27871
smb/client: autogenerate SMB1 DOS/SRV to POSIX error mapping

Extend the `gen_smb1_mapping` script to support generating sorted POSIX
error mapping tables for both ERRDOS and ERRSRV classes at compile time.

The script parses annotations from smberr.h to generate smb1_err_dos_map.c
and smb1_err_srv_map.c, which are included as the contents of the arrays
mapping_table_ERRDOS[] and mapping_table_ERRSRV[], respectively.

This ensures that the mapping logic remains synchronized with the source
headers and prepares for faster error lookups using binary search in the
future.

Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/.gitignore
fs/smb/client/Makefile
fs/smb/client/gen_smb1_mapping
fs/smb/client/smb1maperror.c
fs/smb/client/smberr.h