File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 44
44
#include <net/ipv6.h>
45
45
#include <linux/parser.h>
46
46
#include <linux/bvec.h>
47
-
48
47
#include "cifspdu.h"
49
48
#include "cifsglob.h"
50
49
#include "cifsproto.h"
56
55
#include "rfc1002pdu.h"
57
56
#include "fscache.h"
58
57
#include "smb2proto.h"
58
+ #include "smbdirect.h"
59
59
60
60
#define CIFS_PORT 445
61
61
#define RFC1001_PORT 139
@@ -2310,13 +2310,29 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
2310
2310
tcp_ses -> echo_interval = volume_info -> echo_interval * HZ ;
2311
2311
else
2312
2312
tcp_ses -> echo_interval = SMB_ECHO_INTERVAL_DEFAULT * HZ ;
2313
-
2313
+ if (tcp_ses -> rdma ) {
2314
+ #ifndef CONFIG_CIFS_SMB_DIRECT
2315
+ cifs_dbg (VFS , "CONFIG_CIFS_SMB_DIRECT is not enabled\n" );
2316
+ rc = - ENOENT ;
2317
+ goto out_err_crypto_release ;
2318
+ #endif
2319
+ tcp_ses -> smbd_conn = smbd_get_connection (
2320
+ tcp_ses , (struct sockaddr * )& volume_info -> dstaddr );
2321
+ if (tcp_ses -> smbd_conn ) {
2322
+ cifs_dbg (VFS , "RDMA transport established\n" );
2323
+ rc = 0 ;
2324
+ goto smbd_connected ;
2325
+ } else {
2326
+ rc = - ENOENT ;
2327
+ goto out_err_crypto_release ;
2328
+ }
2329
+ }
2314
2330
rc = ip_connect (tcp_ses );
2315
2331
if (rc < 0 ) {
2316
2332
cifs_dbg (VFS , "Error connecting to socket. Aborting operation.\n" );
2317
2333
goto out_err_crypto_release ;
2318
2334
}
2319
-
2335
+ smbd_connected :
2320
2336
/*
2321
2337
* since we're in a cifs function already, we know that
2322
2338
* this will succeed. No need for try_module_get().
You can’t perform that action at this time.
0 commit comments