[CIFS] minor cleanup to cifs_mount

Signed-off-by: Steve French <sfrench@us.ibm.com>

+35 -41
+35 -41
fs/cifs/connect.c
··· 1368 list_for_each(tmp, &cifs_tcp_ses_list) { 1369 server = list_entry(tmp, struct TCP_Server_Info, 1370 tcp_ses_list); 1371 - 1372 /* 1373 * the demux thread can exit on its own while still in CifsNew 1374 * so don't accept any sockets in that state. Since the ··· 1388 1389 ++server->srv_count; 1390 write_unlock(&cifs_tcp_ses_lock); 1391 return server; 1392 } 1393 write_unlock(&cifs_tcp_ses_lock); ··· 2076 } 2077 2078 srvTcp = cifs_find_tcp_session(&addr); 2079 - if (srvTcp) { 2080 - cFYI(1, ("Existing tcp session with server found")); 2081 - } else { /* create socket */ 2082 if (addr.sa_family == AF_INET6) { 2083 cFYI(1, ("attempting ipv6 connect")); 2084 /* BB should we allow ipv6 on port 139? */ ··· 2290 cifs_put_smb_ses(pSesInfo); 2291 else 2292 cifs_put_tcp_session(srvTcp); 2293 - } else { 2294 - atomic_inc(&tcon->useCount); 2295 - cifs_sb->tcon = tcon; 2296 - tcon->ses = pSesInfo; 2297 - 2298 - /* do not care if following two calls succeed - informational */ 2299 - if (!tcon->ipc) { 2300 - CIFSSMBQFSDeviceInfo(xid, tcon); 2301 - CIFSSMBQFSAttributeInfo(xid, tcon); 2302 - } 2303 - 2304 - /* tell server which Unix caps we support */ 2305 - if (tcon->ses->capabilities & CAP_UNIX) 2306 - /* reset of caps checks mount to see if unix extensions 2307 - disabled for just this mount */ 2308 - reset_cifs_unix_caps(xid, tcon, sb, &volume_info); 2309 - else 2310 - tcon->unix_ext = 0; /* server does not support them */ 2311 - 2312 - /* convert forward to back slashes in prepath here if needed */ 2313 - if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) == 0) 2314 - convert_delimiter(cifs_sb->prepath, 2315 - CIFS_DIR_SEP(cifs_sb)); 2316 - 2317 - if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) { 2318 - cifs_sb->rsize = 1024 * 127; 2319 - cFYI(DBG2, 2320 - ("no very large read support, rsize now 127K")); 2321 - } 2322 - if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X)) 2323 - cifs_sb->wsize = min(cifs_sb->wsize, 2324 - (tcon->ses->server->maxBuf - 2325 - MAX_CIFS_HDR_SIZE)); 2326 - if (!(tcon->ses->capabilities & CAP_LARGE_READ_X)) 2327 - cifs_sb->rsize = min(cifs_sb->rsize, 2328 - (tcon->ses->server->maxBuf - 2329 - MAX_CIFS_HDR_SIZE)); 2330 } 2331 2332 /* volume_info.password is freed above when existing session found 2333 (in which case it is not needed anymore) but when new sesion is created
··· 1368 list_for_each(tmp, &cifs_tcp_ses_list) { 1369 server = list_entry(tmp, struct TCP_Server_Info, 1370 tcp_ses_list); 1371 /* 1372 * the demux thread can exit on its own while still in CifsNew 1373 * so don't accept any sockets in that state. Since the ··· 1389 1390 ++server->srv_count; 1391 write_unlock(&cifs_tcp_ses_lock); 1392 + cFYI(1, ("Existing tcp session with server found")); 1393 return server; 1394 } 1395 write_unlock(&cifs_tcp_ses_lock); ··· 2076 } 2077 2078 srvTcp = cifs_find_tcp_session(&addr); 2079 + if (!srvTcp) { /* create socket */ 2080 if (addr.sa_family == AF_INET6) { 2081 cFYI(1, ("attempting ipv6 connect")); 2082 /* BB should we allow ipv6 on port 139? */ ··· 2292 cifs_put_smb_ses(pSesInfo); 2293 else 2294 cifs_put_tcp_session(srvTcp); 2295 + goto out; 2296 } 2297 + atomic_inc(&tcon->useCount); 2298 + cifs_sb->tcon = tcon; 2299 + tcon->ses = pSesInfo; 2300 + 2301 + /* do not care if following two calls succeed - informational */ 2302 + if (!tcon->ipc) { 2303 + CIFSSMBQFSDeviceInfo(xid, tcon); 2304 + CIFSSMBQFSAttributeInfo(xid, tcon); 2305 + } 2306 + 2307 + /* tell server which Unix caps we support */ 2308 + if (tcon->ses->capabilities & CAP_UNIX) 2309 + /* reset of caps checks mount to see if unix extensions 2310 + disabled for just this mount */ 2311 + reset_cifs_unix_caps(xid, tcon, sb, &volume_info); 2312 + else 2313 + tcon->unix_ext = 0; /* server does not support them */ 2314 + 2315 + /* convert forward to back slashes in prepath here if needed */ 2316 + if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) == 0) 2317 + convert_delimiter(cifs_sb->prepath, CIFS_DIR_SEP(cifs_sb)); 2318 + 2319 + if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) { 2320 + cifs_sb->rsize = 1024 * 127; 2321 + cFYI(DBG2, ("no very large read support, rsize now 127K")); 2322 + } 2323 + if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X)) 2324 + cifs_sb->wsize = min(cifs_sb->wsize, 2325 + (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE)); 2326 + if (!(tcon->ses->capabilities & CAP_LARGE_READ_X)) 2327 + cifs_sb->rsize = min(cifs_sb->rsize, 2328 + (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE)); 2329 2330 /* volume_info.password is freed above when existing session found 2331 (in which case it is not needed anymore) but when new sesion is created