From: Volker Lendecke Date: Tue, 13 Dec 2022 16:38:25 +0000 (+0100) Subject: smbd: Slightly simplify set_current_case_sensitive() X-Git-Tag: talloc-2.4.0~237 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=b94fd4229d77ef150530eb434006adff346151f5;p=samba.git smbd: Slightly simplify set_current_case_sensitive() Remove a global cache of calculating case sensivity. The calculation is really simple: It only references a bool per-share parameter and a global variable. I really doubt there is any measurable benefit from this cache, and if there was, I don't care if SMB1 gets a tiny bit slower in response to reduced global state. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c index 4d4553649c0..9989a73dc85 100644 --- a/source3/smbd/globals.c +++ b/source3/smbd/globals.c @@ -61,9 +61,6 @@ int sec_ctx_stack_ndx = 0; bool become_uid_done = false; bool become_gid_done = false; -connection_struct *last_conn = NULL; -uint16_t last_flags = 0; - uint32_t global_client_caps = 0; uint16_t fnf_handle = 257; diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 44be970510a..d1c0d145de7 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -79,9 +79,6 @@ extern int sec_ctx_stack_ndx; extern bool become_uid_done; extern bool become_gid_done; -extern connection_struct *last_conn; -extern uint16_t last_flags; - extern uint32_t global_client_caps; extern uint16_t fnf_handle; diff --git a/source3/smbd/smb1_process.c b/source3/smbd/smb1_process.c index 8ea68e57a62..1834c67b91f 100644 --- a/source3/smbd/smb1_process.c +++ b/source3/smbd/smb1_process.c @@ -1027,13 +1027,6 @@ static void set_current_case_sensitive(connection_struct *conn, uint16_t flags) snum = SNUM(conn); - if ((conn == last_conn) && (last_flags == flags)) { - return; - } - - last_conn = conn; - last_flags = flags; - /* * Obey the client case sensitivity requests - only for clients that * support it. */ @@ -1060,7 +1053,6 @@ static void set_current_case_sensitive(connection_struct *conn, uint16_t flags) conn->case_sensitive = false; break; } - return; } /****************************************************************************