Skip to content

smb: improve search speed of SMB1 maperror

[email protected] linux-cifs lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest30 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30smb/client: fix NT_STATUS_NO_DATA_DETECTED valuefs/smb/client/nterr.h+1 -13 replies
2/30smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN valuefs/smb/client/nterr.h+1 -10 replies
3/30smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM valuefs/smb/client/nterr.h+1 -10 replies
4/30smb/server: remove unused nterr.hfs/smb/server/nterr.h fs/smb/server/smb2misc.c fs/smb/server/smb_common.h+0 -5450 replies
5/30smb/client: add 4 NT error code definitionsfs/smb/client/nterr.c fs/smb/client/nterr.h+9 -00 replies
6/30smb/client: add parentheses to NT error code definitions containing bitwise OR operatorfs/smb/client/nterr.h+506 -5060 replies
7/30smb/client: introduce DEFINE_CMP_FUNC()fs/smb/client/netmisc.c+13 -00 replies
8/30smb/client: sort ntstatus_to_dos_map arrayfs/smb/client/cifsfs.c fs/smb/client/cifsproto.h fs/smb/client/netmisc.c+21 -20 replies
9/30smb/client: create netmisc_test.c and introduce DEFINE_CHECK_SORT_FUNC()fs/smb/client/netmisc.c fs/smb/client/netmisc_test.c+50 -00 replies
10/30smb/client: introduce KUnit test to check sort result of ntstatus_to_dos_map arrayfs/smb/client/netmisc_test.c+5 -00 replies
11/30smb/client: introduce DEFINE_SEARCH_FUNC()fs/smb/client/netmisc.c+16 -00 replies
12/30smb/client: use bsearch() to find target in ntstatus_to_dos_map arrayfs/smb/client/netmisc.c+12 -70 replies
13/30smb/client: remove useless elements from ntstatus_to_dos_map arrayfs/smb/client/netmisc.c+1 -20 replies
14/30smb/client: introduce DEFINE_CHECK_SEARCH_FUNC()fs/smb/client/netmisc_test.c+15 -00 replies
15/30smb/client: introduce KUnit test to check search result of ntstatus_to_dos_map arrayfs/smb/client/netmisc_test.c+14 -00 replies
16/30smb/client: sort nt_errs arrayfs/smb/client/netmisc.c fs/smb/client/nterr.c fs/smb/client/nterr.h+10 -20 replies
17/30smb/client: introduce KUnit test to check sort result of nt_errs arrayfs/smb/client/netmisc_test.c+3 -00 replies
18/30smb/client: use bsearch() to find target in nt_errs arrayfs/smb/client/netmisc.c+9 -100 replies
19/30smb/client: remove useless elements from nt_errs arrayfs/smb/client/nterr.c+0 -20 replies
20/30smb/client: introduce KUnit test to check search result of nt_errs arrayfs/smb/client/netmisc_test.c+11 -00 replies
21/30smb/client: sort mapping_table_ERRDOS arrayfs/smb/client/netmisc.c+8 -10 replies
22/30smb/client: introduce KUnit test to check sort result of mapping_table_ERRDOS arrayfs/smb/client/netmisc_test.c+3 -00 replies
23/30smb/client: use bsearch() to find target in mapping_table_ERRDOS arrayfs/smb/client/netmisc.c+6 -130 replies
24/30smb/client: remove useless elements from mapping_table_ERRDOS arrayfs/smb/client/netmisc.c+0 -10 replies
25/30smb/client: introduce KUnit test to check search result of mapping_table_ERRDOS arrayfs/smb/client/netmisc_test.c+11 -00 replies
26/30smb/client: sort mapping_table_ERRSRV arrayfs/smb/client/netmisc.c+6 -10 replies
27/30smb/client: introduce KUnit test to check sort result of mapping_table_ERRSRV arrayfs/smb/client/netmisc_test.c+3 -00 replies
28/30smb/client: use bsearch() to find target in mapping_table_ERRSRV arrayfs/smb/client/netmisc.c+5 -140 replies
29/30smb/client: remove useless elements from mapping_table_ERRSRV arrayfs/smb/client/netmisc.c+0 -20 replies
30/30smb/client: introduce KUnit test to check search result of mapping_table_ERRSRV arrayfs/smb/client/netmisc_test.c+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/30] smb: improve search speed of SMB1 maperror

From: ChenXiaoSong <[email protected]>

Before applying this patchset, the patchset ("smb: improve search speed of SMB2 maperror") must be applied first, which introduces CONFIG_SMB_KUNIT_TESTS and avoids some conflicts in fs/smb/client/cifsfs.c:
https://chenxiaosong.com/lkml-improve-search-speed-of-smb2-maperror.html (Redirect to the LKML link)

When searching for the last element, the comparison counts are shown in the table below:

+--------------------+--------+--------+
|                    |Before  |After   |
|                    |Patchset|Patchset|
+--------------------+--------+--------+
| ntstatus_to_dos_map|   525  |    9   |
+--------------------+--------+--------+
|             nt_errs|   516  |    9   |
+--------------------+--------+--------+
|mapping_table_ERRDOS|    39  |    5   |
+--------------------+--------+--------+
|mapping_table_ERRSRV|    37  |    5   |
+--------------------+--------+--------+

ChenXiaoSong (30):
smb/client: fix NT_STATUS_NO_DATA_DETECTED value smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value smb/server: remove unused nterr.h
smb/client: add 4 NT error code definitions
smb/client: add parentheses to NT error code definitions containing
bitwise OR operator
smb/client: introduce DEFINE_CMP_FUNC()
smb/client: sort ntstatus_to_dos_map array
smb/client: create netmisc_test.c and introduce
DEFINE_CHECK_SORT_FUNC()
smb/client: introduce KUnit test to check sort result of
ntstatus_to_dos_map array
smb/client: introduce DEFINE_SEARCH_FUNC()
smb/client: use bsearch() to find target in ntstatus_to_dos_map array smb/client: remove useless elements from ntstatus_to_dos_map array smb/client: introduce DEFINE_CHECK_SEARCH_FUNC() smb/client: introduce KUnit test to check search result of
ntstatus_to_dos_map array
smb/client: sort nt_errs array
smb/client: introduce KUnit test to check sort result of nt_errs array smb/client: use bsearch() to find target in nt_errs array smb/client: remove useless elements from nt_errs array smb/client: introduce KUnit test to check search result of nt_errs
array
smb/client: sort mapping_table_ERRDOS array
smb/client: introduce KUnit test to check sort result of
mapping_table_ERRDOS array
smb/client: use bsearch() to find target in mapping_table_ERRDOS array smb/client: remove useless elements from mapping_table_ERRDOS array smb/client: introduce KUnit test to check search result of
mapping_table_ERRDOS array
smb/client: sort mapping_table_ERRSRV array
smb/client: introduce KUnit test to check sort result of
mapping_table_ERRSRV array
smb/client: use bsearch() to find target in mapping_table_ERRSRV array smb/client: remove useless elements from mapping_table_ERRSRV array smb/client: introduce KUnit test to check search result of
mapping_table_ERRSRV array

 fs/smb/client/cifsfs.c       |    2 +
 fs/smb/client/cifsproto.h    |    1 +
 fs/smb/client/netmisc.c      |  155 ++++--
 fs/smb/client/netmisc_test.c |  114 ++++
 fs/smb/client/nterr.c        |   12 +-
 fs/smb/client/nterr.h        | 1017 +++++++++++++++++-----------------
 fs/smb/server/nterr.h        |  543 ------------------
 fs/smb/server/smb2misc.c     |    1 -
 fs/smb/server/smb_common.h   |    1 -
 9 files changed, 739 insertions(+), 1107 deletions(-)
 create mode 100644 fs/smb/client/netmisc_test.c
 delete mode 100644 fs/smb/server/nterr.h
Signature · 1 line
2.43.0