diff options
author | Aurelien Aptel <aaptel@suse.com> | 2018-06-14 09:43:18 -0400 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2018-06-15 03:38:08 -0400 |
commit | b6f0dd5d75f9689d57c7ea49e52c80cabb876cb4 (patch) | |
tree | 95c487b99249eca1427e75614c7ee31f5acc1dd7 | |
parent | bead042cccca5a7c5626b851b66a30698aa0ac36 (diff) |
CIFS: add iface info to struct cifs_ses
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r-- | fs/cifs/cifsglob.h | 21 | ||||
-rw-r--r-- | fs/cifs/misc.c | 2 |
2 files changed, 23 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index ff280447dae5..9dd5f1a3d64b 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -841,6 +841,13 @@ static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net) | |||
841 | 841 | ||
842 | #endif | 842 | #endif |
843 | 843 | ||
844 | struct cifs_server_iface { | ||
845 | size_t speed; | ||
846 | unsigned int rdma_capable : 1; | ||
847 | unsigned int rss_capable : 1; | ||
848 | struct sockaddr_storage sockaddr; | ||
849 | }; | ||
850 | |||
844 | /* | 851 | /* |
845 | * Session structure. One of these for each uid session with a particular host | 852 | * Session structure. One of these for each uid session with a particular host |
846 | */ | 853 | */ |
@@ -878,6 +885,20 @@ struct cifs_ses { | |||
878 | #ifdef CONFIG_CIFS_SMB311 | 885 | #ifdef CONFIG_CIFS_SMB311 |
879 | __u8 preauth_sha_hash[SMB2_PREAUTH_HASH_SIZE]; | 886 | __u8 preauth_sha_hash[SMB2_PREAUTH_HASH_SIZE]; |
880 | #endif /* 3.1.1 */ | 887 | #endif /* 3.1.1 */ |
888 | |||
889 | /* | ||
890 | * Network interfaces available on the server this session is | ||
891 | * connected to. | ||
892 | * | ||
893 | * Other channels can be opened by connecting and binding this | ||
894 | * session to interfaces from this list. | ||
895 | * | ||
896 | * iface_lock should be taken when accessing any of these fields | ||
897 | */ | ||
898 | spinlock_t iface_lock; | ||
899 | struct cifs_server_iface *iface_list; | ||
900 | size_t iface_count; | ||
901 | unsigned long iface_last_update; /* jiffies */ | ||
881 | }; | 902 | }; |
882 | 903 | ||
883 | static inline bool | 904 | static inline bool |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index bb40f3c050f6..53e8362cbc4a 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -82,6 +82,7 @@ sesInfoAlloc(void) | |||
82 | INIT_LIST_HEAD(&ret_buf->smb_ses_list); | 82 | INIT_LIST_HEAD(&ret_buf->smb_ses_list); |
83 | INIT_LIST_HEAD(&ret_buf->tcon_list); | 83 | INIT_LIST_HEAD(&ret_buf->tcon_list); |
84 | mutex_init(&ret_buf->session_mutex); | 84 | mutex_init(&ret_buf->session_mutex); |
85 | spin_lock_init(&ret_buf->iface_lock); | ||
85 | } | 86 | } |
86 | return ret_buf; | 87 | return ret_buf; |
87 | } | 88 | } |
@@ -102,6 +103,7 @@ sesInfoFree(struct cifs_ses *buf_to_free) | |||
102 | kfree(buf_to_free->user_name); | 103 | kfree(buf_to_free->user_name); |
103 | kfree(buf_to_free->domainName); | 104 | kfree(buf_to_free->domainName); |
104 | kzfree(buf_to_free->auth_key.response); | 105 | kzfree(buf_to_free->auth_key.response); |
106 | kfree(buf_to_free->iface_list); | ||
105 | kzfree(buf_to_free); | 107 | kzfree(buf_to_free); |
106 | } | 108 | } |
107 | 109 | ||