]> Gentwo Git Trees - linux/.git/commit
smb: client: Reduce the scopes for a few variables in two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 5 Oct 2025 17:01:48 +0000 (19:01 +0200)
committerSteve French <stfrench@microsoft.com>
Mon, 6 Oct 2025 21:43:39 +0000 (16:43 -0500)
commite7933f5b019c1daef0a138661d6e504f0259de98
treef67d498f954d8075739034769c29c9572799c99c
parent63e62baaa72e1aceb422f64a50408bc9b02a6022
smb: client: Reduce the scopes for a few variables in two functions

* cifs_lookup():
  Move the definition for the local variable “cfid” into an else branch
  so that the corresponding setting will only be performed if a NULL inode
  was detected during lookup by this function.

* cifs_d_revalidate():
  Move the definition for the local variables “inode” and “rc” into
  an if branch so that the corresponding setting will only be performed
  after a d_really_is_positive() call.

  Move the definition for the local variable “cfid” into an else branch
  so that the corresponding setting will only be performed if further data
  processing will be needed for an open_cached_dir_by_dentry() call.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/dir.c