Commit 8d606c31 authored by Dan Carpenter's avatar Dan Carpenter Committed by Steve French

cifs: make cifs_chan_update_iface() a void function

The return values for cifs_chan_update_iface() didn't match what the
documentation said and nothing was checking them anyway.  Just make it
a void function.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent c3a11c0e
...@@ -656,7 +656,7 @@ cifs_chan_is_iface_active(struct cifs_ses *ses, ...@@ -656,7 +656,7 @@ cifs_chan_is_iface_active(struct cifs_ses *ses,
struct TCP_Server_Info *server); struct TCP_Server_Info *server);
void void
cifs_disable_secondary_channels(struct cifs_ses *ses); cifs_disable_secondary_channels(struct cifs_ses *ses);
int void
cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server); cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server);
int int
SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_mount); SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_mount);
......
...@@ -356,10 +356,9 @@ cifs_disable_secondary_channels(struct cifs_ses *ses) ...@@ -356,10 +356,9 @@ cifs_disable_secondary_channels(struct cifs_ses *ses)
/* /*
* update the iface for the channel if necessary. * update the iface for the channel if necessary.
* will return 0 when iface is updated, 1 if removed, 2 otherwise
* Must be called with chan_lock held. * Must be called with chan_lock held.
*/ */
int void
cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
{ {
unsigned int chan_index; unsigned int chan_index;
...@@ -368,20 +367,19 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) ...@@ -368,20 +367,19 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
struct cifs_server_iface *old_iface = NULL; struct cifs_server_iface *old_iface = NULL;
struct cifs_server_iface *last_iface = NULL; struct cifs_server_iface *last_iface = NULL;
struct sockaddr_storage ss; struct sockaddr_storage ss;
int rc = 0;
spin_lock(&ses->chan_lock); spin_lock(&ses->chan_lock);
chan_index = cifs_ses_get_chan_index(ses, server); chan_index = cifs_ses_get_chan_index(ses, server);
if (chan_index == CIFS_INVAL_CHAN_INDEX) { if (chan_index == CIFS_INVAL_CHAN_INDEX) {
spin_unlock(&ses->chan_lock); spin_unlock(&ses->chan_lock);
return 0; return;
} }
if (ses->chans[chan_index].iface) { if (ses->chans[chan_index].iface) {
old_iface = ses->chans[chan_index].iface; old_iface = ses->chans[chan_index].iface;
if (old_iface->is_active) { if (old_iface->is_active) {
spin_unlock(&ses->chan_lock); spin_unlock(&ses->chan_lock);
return 1; return;
} }
} }
spin_unlock(&ses->chan_lock); spin_unlock(&ses->chan_lock);
...@@ -394,7 +392,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) ...@@ -394,7 +392,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
if (!ses->iface_count) { if (!ses->iface_count) {
spin_unlock(&ses->iface_lock); spin_unlock(&ses->iface_lock);
cifs_dbg(VFS, "server %s does not advertise interfaces\n", ses->server->hostname); cifs_dbg(VFS, "server %s does not advertise interfaces\n", ses->server->hostname);
return 0; return;
} }
last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface, last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface,
...@@ -434,7 +432,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) ...@@ -434,7 +432,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
} }
if (list_entry_is_head(iface, &ses->iface_list, iface_head)) { if (list_entry_is_head(iface, &ses->iface_list, iface_head)) {
rc = 1;
iface = NULL; iface = NULL;
cifs_dbg(FYI, "unable to find a suitable iface\n"); cifs_dbg(FYI, "unable to find a suitable iface\n");
} }
...@@ -449,7 +446,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) ...@@ -449,7 +446,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
} }
spin_unlock(&ses->iface_lock); spin_unlock(&ses->iface_lock);
return 0; return;
} }
/* now drop the ref to the current iface */ /* now drop the ref to the current iface */
...@@ -478,13 +475,13 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) ...@@ -478,13 +475,13 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
chan_index = cifs_ses_get_chan_index(ses, server); chan_index = cifs_ses_get_chan_index(ses, server);
if (chan_index == CIFS_INVAL_CHAN_INDEX) { if (chan_index == CIFS_INVAL_CHAN_INDEX) {
spin_unlock(&ses->chan_lock); spin_unlock(&ses->chan_lock);
return 0; return;
} }
ses->chans[chan_index].iface = iface; ses->chans[chan_index].iface = iface;
spin_unlock(&ses->chan_lock); spin_unlock(&ses->chan_lock);
return rc; return;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment