]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cifs: Don't need state locking in smb2_get_mid_entry()
authorDavid Howells <dhowells@redhat.com>
Mon, 4 Aug 2025 08:38:21 +0000 (09:38 +0100)
committerSteve French <stfrench@microsoft.com>
Fri, 5 Dec 2025 23:11:06 +0000 (17:11 -0600)
commit3a7b6d0afe6e01d054c9334cf1203953a0f72a1e
tree4a5fd7418a53cdc84b94064da890209f4c2fcbba
parent87fba18abbb8433a47045c785f2edc027e4d2bc5
cifs: Don't need state locking in smb2_get_mid_entry()

There's no need to get ->srv_lock or ->ses_lock in smb2_get_mid_entry() as
all that happens of relevance (to the lock) inside the locked sections is
the reading of one status value in each.

Replace the locking with READ_ONCE() and use a switch instead of a chain of
if-statements.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
cc: Shyam Prasad N <sprasad@microsoft.com>
cc: Tom Talpey <tom@talpey.com>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2transport.c