提交 f6d76178 编写于 作者: P Pavel Shilovsky

CIFS: Move echo code to osp struct

Signed-off-by: NPavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: NSteve French <smfrench@gmail.com>
上级 c95b8eed
...@@ -234,6 +234,10 @@ struct smb_version_operations { ...@@ -234,6 +234,10 @@ struct smb_version_operations {
/* build a full path to the root of the mount */ /* build a full path to the root of the mount */
char * (*build_path_to_root)(struct smb_vol *, struct cifs_sb_info *, char * (*build_path_to_root)(struct smb_vol *, struct cifs_sb_info *,
struct cifs_tcon *); struct cifs_tcon *);
/* check if we can send an echo or nor */
bool (*can_echo)(struct TCP_Server_Info *);
/* send echo request */
int (*echo)(struct TCP_Server_Info *);
}; };
struct smb_version_values { struct smb_version_values {
......
...@@ -406,15 +406,17 @@ cifs_echo_request(struct work_struct *work) ...@@ -406,15 +406,17 @@ cifs_echo_request(struct work_struct *work)
struct TCP_Server_Info, echo.work); struct TCP_Server_Info, echo.work);
/* /*
* We cannot send an echo until the NEGOTIATE_PROTOCOL request is * We cannot send an echo if it is disabled or until the
* done, which is indicated by maxBuf != 0. Also, no need to ping if * NEGOTIATE_PROTOCOL request is done, which is indicated by
* we got a response recently * server->ops->need_neg() == true. Also, no need to ping if
* we got a response recently.
*/ */
if (!server->ops->need_neg || server->ops->need_neg(server) || if (!server->ops->need_neg || server->ops->need_neg(server) ||
(server->ops->can_echo && !server->ops->can_echo(server)) ||
time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ))
goto requeue_echo; goto requeue_echo;
rc = CIFSSMBEcho(server); rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS;
if (rc) if (rc)
cFYI(1, "Unable to send echo request to server: %s", cFYI(1, "Unable to send echo request to server: %s",
server->hostname); server->hostname);
......
...@@ -551,6 +551,7 @@ struct smb_version_operations smb1_operations = { ...@@ -551,6 +551,7 @@ struct smb_version_operations smb1_operations = {
.query_path_info = cifs_query_path_info, .query_path_info = cifs_query_path_info,
.get_srv_inum = cifs_get_srv_inum, .get_srv_inum = cifs_get_srv_inum,
.build_path_to_root = cifs_build_path_to_root, .build_path_to_root = cifs_build_path_to_root,
.echo = CIFSSMBEcho,
}; };
struct smb_version_values smb1_values = { struct smb_version_values smb1_values = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册