diff options
author | Steve French <sfrench@us.ibm.com> | 2008-05-06 18:05:51 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-05-06 18:05:51 -0400 |
commit | dea570e08a69b14808b2cab56d6b0dda72145fa6 (patch) | |
tree | 4ce8fb7e018083b77d63ce78f5a6350bcd0209ad /fs | |
parent | a815752ac0ffdb910e92958d41d28f4fb28e5296 (diff) |
[CIFS] Remove over-indented code in find_unc().
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/connect.c | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 6c4332f8da6c..f2259db075c4 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1362,45 +1362,43 @@ find_unc(__be32 new_target_ip_addr, char *uncName, char *userName) | |||
1362 | { | 1362 | { |
1363 | struct list_head *tmp; | 1363 | struct list_head *tmp; |
1364 | struct cifsTconInfo *tcon; | 1364 | struct cifsTconInfo *tcon; |
1365 | __be32 old_ip; | ||
1365 | 1366 | ||
1366 | read_lock(&GlobalSMBSeslock); | 1367 | read_lock(&GlobalSMBSeslock); |
1368 | |||
1367 | list_for_each(tmp, &GlobalTreeConnectionList) { | 1369 | list_for_each(tmp, &GlobalTreeConnectionList) { |
1368 | cFYI(1, ("Next tcon")); | 1370 | cFYI(1, ("Next tcon")); |
1369 | tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); | 1371 | tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); |
1370 | if (tcon->ses) { | 1372 | if (!tcon->ses || !tcon->ses->server) |
1371 | if (tcon->ses->server) { | 1373 | continue; |
1372 | cFYI(1, | 1374 | |
1373 | ("old ip addr: %x == new ip %x ?", | 1375 | old_ip = tcon->ses->server->addr.sockAddr.sin_addr.s_addr; |
1374 | tcon->ses->server->addr.sockAddr.sin_addr. | 1376 | cFYI(1, ("old ip addr: %x == new ip %x ?", |
1375 | s_addr, new_target_ip_addr)); | 1377 | old_ip, new_target_ip_addr)); |
1376 | if (tcon->ses->server->addr.sockAddr.sin_addr. | 1378 | |
1377 | s_addr == new_target_ip_addr) { | 1379 | if (old_ip != new_target_ip_addr) |
1378 | /* BB lock tcon, server and tcp session and increment use count here? */ | 1380 | continue; |
1379 | /* found a match on the TCP session */ | 1381 | |
1380 | /* BB check if reconnection needed */ | 1382 | /* BB lock tcon, server, tcp session and increment use count? */ |
1381 | cFYI(1, | 1383 | /* found a match on the TCP session */ |
1382 | ("IP match, old UNC: %s new: %s", | 1384 | /* BB check if reconnection needed */ |
1383 | tcon->treeName, uncName)); | 1385 | cFYI(1, ("IP match, old UNC: %s new: %s", |
1384 | if (strncmp | 1386 | tcon->treeName, uncName)); |
1385 | (tcon->treeName, uncName, | 1387 | |
1386 | MAX_TREE_SIZE) == 0) { | 1388 | if (strncmp(tcon->treeName, uncName, MAX_TREE_SIZE)) |
1387 | cFYI(1, | 1389 | continue; |
1388 | ("and old usr: %s new: %s", | 1390 | |
1389 | tcon->treeName, uncName)); | 1391 | cFYI(1, ("and old usr: %s new: %s", |
1390 | if (strncmp | 1392 | tcon->treeName, uncName)); |
1391 | (tcon->ses->userName, | 1393 | |
1392 | userName, | 1394 | if (strncmp(tcon->ses->userName, userName, MAX_USERNAME_SIZE)) |
1393 | MAX_USERNAME_SIZE) == 0) { | 1395 | continue; |
1394 | read_unlock(&GlobalSMBSeslock); | 1396 | |
1395 | /* matched smb session | 1397 | /* matched smb session (user name) */ |
1396 | (user name */ | 1398 | read_unlock(&GlobalSMBSeslock); |
1397 | return tcon; | 1399 | return tcon; |
1398 | } | ||
1399 | } | ||
1400 | } | ||
1401 | } | ||
1402 | } | ||
1403 | } | 1400 | } |
1401 | |||
1404 | read_unlock(&GlobalSMBSeslock); | 1402 | read_unlock(&GlobalSMBSeslock); |
1405 | return NULL; | 1403 | return NULL; |
1406 | } | 1404 | } |