Commit b3773b19 authored by Steve French's avatar Steve French
Browse files

SMB3: rename macro CIFS_SERVER_IS_CHAN to avoid confusion



Since older dialects such as CIFS do not support multichannel
the macro CIFS_SERVER_IS_CHAN can be confusing (it requires SMB 3
or later) so shorten its name to "SERVER_IS_CHAN"

Suggested-by: default avatarTom Talpey <tom@talpey.com>
Acked-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 09ee7a3b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -331,7 +331,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
	spin_lock(&cifs_tcp_ses_lock);
	list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
		/* channel info will be printed as a part of sessions below */
		if (CIFS_SERVER_IS_CHAN(server))
		if (SERVER_IS_CHAN(server))
			continue;

		c++;
+1 −1
Original line number Diff line number Diff line
@@ -745,7 +745,7 @@ struct TCP_Server_Info {
	 * primary_server holds the ref-counted
	 * pointer to primary channel connection for the session.
	 */
#define CIFS_SERVER_IS_CHAN(server)	(!!(server)->primary_server)
#define SERVER_IS_CHAN(server)	(!!(server)->primary_server)
	struct TCP_Server_Info *primary_server;
	__u16 channel_sequence_num;  /* incremented on primary channel on each chan reconnect */

+6 −6
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ cifs_signal_cifsd_for_reconnect(struct TCP_Server_Info *server,
	int i;

	/* If server is a channel, select the primary channel */
	pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
	pserver = SERVER_IS_CHAN(server) ? server->primary_server : server;

	spin_lock(&pserver->srv_lock);
	if (!all_channels) {
@@ -202,7 +202,7 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
	cifs_dbg(FYI, "%s: marking necessary sessions and tcons for reconnect\n", __func__);

	/* If server is a channel, select the primary channel */
	pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
	pserver = SERVER_IS_CHAN(server) ? server->primary_server : server;


	spin_lock(&cifs_tcp_ses_lock);
@@ -1551,7 +1551,7 @@ cifs_find_tcp_session(struct smb3_fs_context *ctx)
		 * Skip ses channels since they're only handled in lower layers
		 * (e.g. cifs_send_recv).
		 */
		if (CIFS_SERVER_IS_CHAN(server) ||
		if (SERVER_IS_CHAN(server) ||
		    !match_server(server, ctx, false)) {
			spin_unlock(&server->srv_lock);
			continue;
@@ -1587,7 +1587,7 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)
	spin_unlock(&cifs_tcp_ses_lock);

	/* For secondary channels, we pick up ref-count on the primary server */
	if (CIFS_SERVER_IS_CHAN(server))
	if (SERVER_IS_CHAN(server))
		cifs_put_tcp_session(server->primary_server, from_reconnect);

	cancel_delayed_work_sync(&server->echo);
@@ -1793,7 +1793,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,

out_err:
	if (tcp_ses) {
		if (CIFS_SERVER_IS_CHAN(tcp_ses))
		if (SERVER_IS_CHAN(tcp_ses))
			cifs_put_tcp_session(tcp_ses->primary_server, false);
		kfree(tcp_ses->hostname);
		kfree(tcp_ses->leaf_fullpath);
@@ -3814,7 +3814,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
		   struct nls_table *nls_info)
{
	int rc = -ENOSYS;
	struct TCP_Server_Info *pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
	struct TCP_Server_Info *pserver = SERVER_IS_CHAN(server) ? server->primary_server : server;
	struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&pserver->dstaddr;
	struct sockaddr_in *addr = (struct sockaddr_in *)&pserver->dstaddr;
	bool is_binding = false;
+1 −1
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
		return false;

	/* If server is a channel, select the primary channel */
	pserver = CIFS_SERVER_IS_CHAN(srv) ? srv->primary_server : srv;
	pserver = SERVER_IS_CHAN(srv) ? srv->primary_server : srv;

	/* look up tcon based on tid & uid */
	spin_lock(&cifs_tcp_ses_lock);
+2 −2
Original line number Diff line number Diff line
@@ -323,12 +323,12 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
	ses->chans[chan_index].iface = iface;

	/* No iface is found. if secondary chan, drop connection */
	if (!iface && CIFS_SERVER_IS_CHAN(server))
	if (!iface && SERVER_IS_CHAN(server))
		ses->chans[chan_index].server = NULL;

	spin_unlock(&ses->chan_lock);

	if (!iface && CIFS_SERVER_IS_CHAN(server))
	if (!iface && SERVER_IS_CHAN(server))
		cifs_put_tcp_session(server, false);

	return rc;
Loading