Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

CIFS: add iface info to struct cifs_ses

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Aurelien Aptel and committed by
Steve French
b6f0dd5d bead042c

+23
+21
fs/cifs/cifsglob.h
··· 841 841 842 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 852 * Session structure. One of these for each uid session with a particular host 846 853 */ ··· 885 878 #ifdef CONFIG_CIFS_SMB311 886 879 __u8 preauth_sha_hash[SMB2_PREAUTH_HASH_SIZE]; 887 880 #endif /* 3.1.1 */ 881 + 882 + /* 883 + * Network interfaces available on the server this session is 884 + * connected to. 885 + * 886 + * Other channels can be opened by connecting and binding this 887 + * session to interfaces from this list. 888 + * 889 + * iface_lock should be taken when accessing any of these fields 890 + */ 891 + spinlock_t iface_lock; 892 + struct cifs_server_iface *iface_list; 893 + size_t iface_count; 894 + unsigned long iface_last_update; /* jiffies */ 888 895 }; 889 896 890 897 static inline bool
+2
fs/cifs/misc.c
··· 82 82 INIT_LIST_HEAD(&ret_buf->smb_ses_list); 83 83 INIT_LIST_HEAD(&ret_buf->tcon_list); 84 84 mutex_init(&ret_buf->session_mutex); 85 + spin_lock_init(&ret_buf->iface_lock); 85 86 } 86 87 return ret_buf; 87 88 } ··· 103 102 kfree(buf_to_free->user_name); 104 103 kfree(buf_to_free->domainName); 105 104 kzfree(buf_to_free->auth_key.response); 105 + kfree(buf_to_free->iface_list); 106 106 kzfree(buf_to_free); 107 107 } 108 108