Commit dea570e0 authored by Steve French's avatar Steve French

[CIFS] Remove over-indented code in find_unc().

Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent a815752a
...@@ -1362,45 +1362,43 @@ find_unc(__be32 new_target_ip_addr, char *uncName, char *userName) ...@@ -1362,45 +1362,43 @@ find_unc(__be32 new_target_ip_addr, char *uncName, char *userName)
{ {
struct list_head *tmp; struct list_head *tmp;
struct cifsTconInfo *tcon; struct cifsTconInfo *tcon;
__be32 old_ip;
read_lock(&GlobalSMBSeslock); read_lock(&GlobalSMBSeslock);
list_for_each(tmp, &GlobalTreeConnectionList) { list_for_each(tmp, &GlobalTreeConnectionList) {
cFYI(1, ("Next tcon")); cFYI(1, ("Next tcon"));
tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
if (tcon->ses) { if (!tcon->ses || !tcon->ses->server)
if (tcon->ses->server) { continue;
cFYI(1,
("old ip addr: %x == new ip %x ?", old_ip = tcon->ses->server->addr.sockAddr.sin_addr.s_addr;
tcon->ses->server->addr.sockAddr.sin_addr. cFYI(1, ("old ip addr: %x == new ip %x ?",
s_addr, new_target_ip_addr)); old_ip, new_target_ip_addr));
if (tcon->ses->server->addr.sockAddr.sin_addr.
s_addr == new_target_ip_addr) { if (old_ip != new_target_ip_addr)
/* BB lock tcon, server and tcp session and increment use count here? */ continue;
/* found a match on the TCP session */
/* BB check if reconnection needed */ /* BB lock tcon, server, tcp session and increment use count? */
cFYI(1, /* found a match on the TCP session */
("IP match, old UNC: %s new: %s", /* BB check if reconnection needed */
tcon->treeName, uncName)); cFYI(1, ("IP match, old UNC: %s new: %s",
if (strncmp tcon->treeName, uncName));
(tcon->treeName, uncName,
MAX_TREE_SIZE) == 0) { if (strncmp(tcon->treeName, uncName, MAX_TREE_SIZE))
cFYI(1, continue;
("and old usr: %s new: %s",
tcon->treeName, uncName)); cFYI(1, ("and old usr: %s new: %s",
if (strncmp tcon->treeName, uncName));
(tcon->ses->userName,
userName, if (strncmp(tcon->ses->userName, userName, MAX_USERNAME_SIZE))
MAX_USERNAME_SIZE) == 0) { continue;
read_unlock(&GlobalSMBSeslock);
/* matched smb session /* matched smb session (user name) */
(user name */ read_unlock(&GlobalSMBSeslock);
return tcon; return tcon;
}
}
}
}
}
} }
read_unlock(&GlobalSMBSeslock); read_unlock(&GlobalSMBSeslock);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment