diff options
| author | Enzo Matsumiya <ematsumiya@suse.de> | 2024-11-13 18:20:18 -0300 |
|---|---|---|
| committer | Enzo Matsumiya <ematsumiya@suse.de> | 2024-11-14 15:54:44 -0300 |
| commit | c75d799be8438b263ff3f3d97b951fe83a647afc (patch) | |
| tree | 4607c99fe8ba5074a6e419ee00354afa30facb27 | |
| parent | 02ad0c3a78c8ad960c5e843ce4adb63433f1b074 (diff) | |
| download | linux-c75d799be8438b263ff3f3d97b951fe83a647afc.tar.gz linux-c75d799be8438b263ff3f3d97b951fe83a647afc.tar.bz2 linux-c75d799be8438b263ff3f3d97b951fe83a647afc.zip | |
smb: client: remove ->query_server_interfaces op
Call SMB3_request_interfaces() directly instead.
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
| -rw-r--r-- | fs/smb/client/cifsglob.h | 3 | ||||
| -rw-r--r-- | fs/smb/client/cifsproto.h | 2 | ||||
| -rw-r--r-- | fs/smb/client/connect.c | 22 | ||||
| -rw-r--r-- | fs/smb/client/smb2ops.c | 2 | ||||
| -rw-r--r-- | fs/smb/client/smb2pdu.c | 11 | ||||
| -rw-r--r-- | fs/smb/client/smb2proto.h | 1 |
6 files changed, 12 insertions, 29 deletions
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index 7ad100def66f..1bbfb8e07409 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -287,9 +287,6 @@ struct smb_version_operations { /* informational QFS call */ void (*qfs_tcon)(const unsigned int, struct cifs_tcon *, struct cifs_sb_info *); - /* query for server interfaces */ - int (*query_server_interfaces)(const unsigned int, struct cifs_tcon *, - bool); /* create directory */ int (*posix_mkdir)(const unsigned int xid, struct inode *inode, umode_t mode, struct cifs_tcon *tcon, diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h index fc8ee571d7c5..daadff2f7663 100644 --- a/fs/smb/client/cifsproto.h +++ b/fs/smb/client/cifsproto.h @@ -396,8 +396,6 @@ void cifs_disable_secondary_channels(struct cifs_ses *ses); void cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server); -int -SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_mount); void extract_unc_hostname(const char *unc, const char **h, size_t *len); int copy_path_name(char *dst, const char *src); diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index ed6812b888a5..e4027b97e168 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -50,6 +50,7 @@ #endif #include "fs_context.h" #include "cifs_swn.h" +#include "smb2proto.h" /* FIXME: should these be tunable? */ #define TLINK_ERROR_EXPIRE (1 * HZ) @@ -114,33 +115,25 @@ static int reconn_set_ipaddr_from_hostname(struct TCP_Server_Info *server) static void smb2_query_server_interfaces(struct work_struct *work) { - int rc; + struct cifs_tcon *tcon = container_of(work, struct cifs_tcon, query_interfaces.work); int xid; - struct cifs_tcon *tcon = container_of(work, - struct cifs_tcon, - query_interfaces.work); - struct TCP_Server_Info *server = tcon->ses->server; + int rc; /* * query server network interfaces, in case they change */ - if (!server->ops->query_server_interfaces) - return; - xid = get_xid(); - rc = server->ops->query_server_interfaces(xid, tcon, false); + rc = SMB3_request_interfaces(xid, tcon, false); free_xid(xid); if (rc) { if (rc == -EOPNOTSUPP) return; - cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n", - __func__, rc); + cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n", __func__, rc); } - queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, - (SMB_INTERFACE_POLL_INTERVAL * HZ)); + queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, (SMB_INTERFACE_POLL_INTERVAL * HZ)); } /* @@ -2694,10 +2687,9 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx) INIT_LIST_HEAD(&tcon->pending_opens); tcon->status = TID_GOOD; - INIT_DELAYED_WORK(&tcon->query_interfaces, - smb2_query_server_interfaces); if (ses->server->dialect >= SMB30_PROT_ID && (ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { + INIT_DELAYED_WORK(&tcon->query_interfaces, smb2_query_server_interfaces); /* schedule query interfaces poll */ queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, (SMB_INTERFACE_POLL_INTERVAL * HZ)); diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index c6f182e575cb..75eca2a44b2f 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -5099,7 +5099,6 @@ struct smb_version_operations smb30_operations = { .negotiate_wsize = smb3_negotiate_wsize, .negotiate_rsize = smb3_negotiate_rsize, .qfs_tcon = smb3_qfs_tcon, - .query_server_interfaces = SMB3_request_interfaces, /* WSL tags introduced long after smb2.1, enable for SMB3, 3.11 only */ .close_getattr = smb2_close_getattr, .queryfs = smb2_queryfs, @@ -5122,7 +5121,6 @@ struct smb_version_operations smb311_operations = { .negotiate_wsize = smb3_negotiate_wsize, .negotiate_rsize = smb3_negotiate_rsize, .qfs_tcon = smb3_qfs_tcon, - .query_server_interfaces = SMB3_request_interfaces, .posix_mkdir = smb311_posix_mkdir, .close_getattr = smb2_close_getattr, .queryfs = smb311_queryfs, diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index 7d10c84ea8e9..17634cdd60ba 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -424,15 +424,14 @@ skip_sess_setup: ses->flags |= CIFS_SES_FLAG_SCALE_CHANNELS; spin_unlock(&ses->ses_lock); - if (!rc && (server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL) && - server->ops->query_server_interfaces) { + if (!rc && (server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { mutex_unlock(&ses->session_mutex); /* * query server network interfaces, in case they change */ xid = get_xid(); - rc = server->ops->query_server_interfaces(xid, tcon, false); + rc = SMB3_request_interfaces(xid, tcon, false); free_xid(xid); if (rc == -EOPNOTSUPP && ses->chan_count > 1) { @@ -443,15 +442,13 @@ skip_sess_setup: * treat this as server not supporting multichannel */ - rc = cifs_chan_skip_or_disable(ses, server, - from_reconnect); + rc = cifs_chan_skip_or_disable(ses, server, from_reconnect); goto skip_add_channels; } else if (rc) cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n", __func__, rc); - if (ses->chan_max > ses->chan_count && - ses->iface_count && + if (ses->chan_max > ses->chan_count && ses->iface_count && !SERVER_IS_CHAN(server)) { if (ses->chan_count == 1) { cifs_server_dbg(VFS, "supports multichannel now\n"); diff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h index c3bee0cc3e28..d59f6ec082a6 100644 --- a/fs/smb/client/smb2proto.h +++ b/fs/smb/client/smb2proto.h @@ -180,6 +180,7 @@ extern int SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, struct cifs_tcon *tcon, const struct nls_table *); extern int SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon); +extern int SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_mount); extern int SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, __u8 *oplock, struct smb2_file_all_info *buf, |
