aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-05-25 06:47:16 -0400
committerPavel Shilovsky <pshilovsky@samba.org>2012-07-24 13:55:15 -0400
commitf6d7617862e106affc59c6933099e45629af5c4e (patch)
treee2e6ff0197e1adddb99079580db191955610cf54 /fs/cifs
parentc95b8eeda3efcb419ea0a3f864cf99e32c038c21 (diff)
CIFS: Move echo code to osp struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsglob.h4
-rw-r--r--fs/cifs/connect.c10
-rw-r--r--fs/cifs/smb1ops.c1
3 files changed, 11 insertions, 4 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 5e4d1c56767d..0c53a8339253 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -234,6 +234,10 @@ struct smb_version_operations {
234 /* build a full path to the root of the mount */ 234 /* build a full path to the root of the mount */
235 char * (*build_path_to_root)(struct smb_vol *, struct cifs_sb_info *, 235 char * (*build_path_to_root)(struct smb_vol *, struct cifs_sb_info *,
236 struct cifs_tcon *); 236 struct cifs_tcon *);
237 /* check if we can send an echo or nor */
238 bool (*can_echo)(struct TCP_Server_Info *);
239 /* send echo request */
240 int (*echo)(struct TCP_Server_Info *);
237}; 241};
238 242
239struct smb_version_values { 243struct smb_version_values {
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 7b4bc1e0b08e..a83ed766aa94 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -406,15 +406,17 @@ cifs_echo_request(struct work_struct *work)
406 struct TCP_Server_Info, echo.work); 406 struct TCP_Server_Info, echo.work);
407 407
408 /* 408 /*
409 * We cannot send an echo until the NEGOTIATE_PROTOCOL request is 409 * We cannot send an echo if it is disabled or until the
410 * done, which is indicated by maxBuf != 0. Also, no need to ping if 410 * NEGOTIATE_PROTOCOL request is done, which is indicated by
411 * we got a response recently 411 * server->ops->need_neg() == true. Also, no need to ping if
412 * we got a response recently.
412 */ 413 */
413 if (!server->ops->need_neg || server->ops->need_neg(server) || 414 if (!server->ops->need_neg || server->ops->need_neg(server) ||
415 (server->ops->can_echo && !server->ops->can_echo(server)) ||
414 time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) 416 time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ))
415 goto requeue_echo; 417 goto requeue_echo;
416 418
417 rc = CIFSSMBEcho(server); 419 rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS;
418 if (rc) 420 if (rc)
419 cFYI(1, "Unable to send echo request to server: %s", 421 cFYI(1, "Unable to send echo request to server: %s",
420 server->hostname); 422 server->hostname);
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 7bd4973591de..c9326b4ec6cd 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -551,6 +551,7 @@ struct smb_version_operations smb1_operations = {
551 .query_path_info = cifs_query_path_info, 551 .query_path_info = cifs_query_path_info,
552 .get_srv_inum = cifs_get_srv_inum, 552 .get_srv_inum = cifs_get_srv_inum,
553 .build_path_to_root = cifs_build_path_to_root, 553 .build_path_to_root = cifs_build_path_to_root,
554 .echo = CIFSSMBEcho,
554}; 555};
555 556
556struct smb_version_values smb1_values = { 557struct smb_version_values smb1_values = {