Skip to content

Commit b3773b1

Browse files
author
Steve French
committed
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: Tom Talpey <[email protected]> Acked-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 09ee7a3 commit b3773b1

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

fs/smb/client/cifs_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
331331
spin_lock(&cifs_tcp_ses_lock);
332332
list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
333333
/* channel info will be printed as a part of sessions below */
334-
if (CIFS_SERVER_IS_CHAN(server))
334+
if (SERVER_IS_CHAN(server))
335335
continue;
336336

337337
c++;

fs/smb/client/cifsglob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ struct TCP_Server_Info {
745745
* primary_server holds the ref-counted
746746
* pointer to primary channel connection for the session.
747747
*/
748-
#define CIFS_SERVER_IS_CHAN(server) (!!(server)->primary_server)
748+
#define SERVER_IS_CHAN(server) (!!(server)->primary_server)
749749
struct TCP_Server_Info *primary_server;
750750
__u16 channel_sequence_num; /* incremented on primary channel on each chan reconnect */
751751

fs/smb/client/connect.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ cifs_signal_cifsd_for_reconnect(struct TCP_Server_Info *server,
154154
int i;
155155

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

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

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

207207

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

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

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

17941794
out_err:
17951795
if (tcp_ses) {
1796-
if (CIFS_SERVER_IS_CHAN(tcp_ses))
1796+
if (SERVER_IS_CHAN(tcp_ses))
17971797
cifs_put_tcp_session(tcp_ses->primary_server, false);
17981798
kfree(tcp_ses->hostname);
17991799
kfree(tcp_ses->leaf_fullpath);
@@ -3814,7 +3814,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
38143814
struct nls_table *nls_info)
38153815
{
38163816
int rc = -ENOSYS;
3817-
struct TCP_Server_Info *pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
3817+
struct TCP_Server_Info *pserver = SERVER_IS_CHAN(server) ? server->primary_server : server;
38183818
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&pserver->dstaddr;
38193819
struct sockaddr_in *addr = (struct sockaddr_in *)&pserver->dstaddr;
38203820
bool is_binding = false;

fs/smb/client/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
476476
return false;
477477

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

481481
/* look up tcon based on tid & uid */
482482
spin_lock(&cifs_tcp_ses_lock);

fs/smb/client/sess.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
323323
ses->chans[chan_index].iface = iface;
324324

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

329329
spin_unlock(&ses->chan_lock);
330330

331-
if (!iface && CIFS_SERVER_IS_CHAN(server))
331+
if (!iface && SERVER_IS_CHAN(server))
332332
cifs_put_tcp_session(server, false);
333333

334334
return rc;

fs/smb/client/smb2misc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)
145145
__u64 mid;
146146

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

150150
/*
151151
* Add function to do table lookup of StructureSize by command
@@ -623,7 +623,7 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
623623
cifs_dbg(FYI, "Checking for lease break\n");
624624

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

628628
/* look up tcon based on tid & uid */
629629
spin_lock(&cifs_tcp_ses_lock);
@@ -698,7 +698,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
698698
cifs_dbg(FYI, "oplock level 0x%x\n", rsp->OplockLevel);
699699

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

703703
/* look up tcon based on tid & uid */
704704
spin_lock(&cifs_tcp_ses_lock);

fs/smb/client/smb2ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ smb2_set_credits(struct TCP_Server_Info *server, const int val)
178178
* ChannelSequence updated for all channels in primary channel so that consistent
179179
* across SMB3 requests sent on any channel. See MS-SMB2 3.2.4.1 and 3.2.7.1
180180
*/
181-
if (CIFS_SERVER_IS_CHAN(server))
181+
if (SERVER_IS_CHAN(server))
182182
server->primary_server->channel_sequence_num++;
183183
else
184184
server->channel_sequence_num++;
@@ -2406,7 +2406,7 @@ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server)
24062406
return false;
24072407

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

24112411
spin_lock(&cifs_tcp_ses_lock);
24122412
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
@@ -4282,7 +4282,7 @@ smb2_get_enc_key(struct TCP_Server_Info *server, __u64 ses_id, int enc, u8 *key)
42824282
u8 *ses_enc_key;
42834283

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

42874287
spin_lock(&cifs_tcp_ses_lock);
42884288
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {

fs/smb/client/smb2pdu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ smb2_hdr_assemble(struct smb2_hdr *shdr, __le16 smb2_cmd,
9696
/* After reconnect SMB3 must set ChannelSequence on subsequent reqs */
9797
smb3_hdr = (struct smb3_hdr_req *)shdr;
9898
/* if primary channel is not set yet, use default channel for chan sequence num */
99-
if (CIFS_SERVER_IS_CHAN(server))
99+
if (SERVER_IS_CHAN(server))
100100
smb3_hdr->ChannelSequence =
101101
cpu_to_le16(server->primary_server->channel_sequence_num);
102102
else
@@ -564,7 +564,7 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
564564
* secondary channels don't have the hostname field populated
565565
* use the hostname field in the primary channel instead
566566
*/
567-
pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
567+
pserver = SERVER_IS_CHAN(server) ? server->primary_server : server;
568568
cifs_server_lock(pserver);
569569
hostname = pserver->hostname;
570570
if (hostname && (hostname[0] != 0)) {
@@ -3796,7 +3796,7 @@ void smb2_reconnect_server(struct work_struct *work)
37963796
bool resched = false;
37973797

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

38013801
/* Prevent simultaneous reconnects that can corrupt tcon->rlist list */
38023802
mutex_lock(&pserver->reconnect_mutex);

fs/smb/client/smb2transport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key)
8686
spin_lock(&cifs_tcp_ses_lock);
8787

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

9191
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
9292
if (ses->Suid == ses_id)
@@ -149,7 +149,7 @@ smb2_find_smb_ses_unlocked(struct TCP_Server_Info *server, __u64 ses_id)
149149
struct cifs_ses *ses;
150150

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

154154
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
155155
if (ses->Suid != ses_id)

0 commit comments

Comments
 (0)