From 9ccec0b82c399084450d67cf0d13575227fb3934 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Fri, 25 May 2012 14:47:16 +0400 Subject: [PATCH] --- yaml --- r: 318495 b: refs/heads/master c: f6d7617862e106affc59c6933099e45629af5c4e h: refs/heads/master i: 318493: 8414c0b5c4122bbe7a1d4ee41e8924478d59b689 318491: eaa20deba22ff81d4dd0074fdb46b1f296d087ad 318487: 3aafebbbb63b4c69de758d12e741d02c4edf0428 318479: 7b5bddaaa5f4261aa4f5c6438022e3a461a20ba6 318463: ce95fe4fdbe961a8938394a092ad5303fac990b5 v: v3 --- [refs] | 2 +- trunk/fs/cifs/cifsglob.h | 4 ++++ trunk/fs/cifs/connect.c | 10 ++++++---- trunk/fs/cifs/smb1ops.c | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 813dfaa2606e..6454e502a080 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c95b8eeda3efcb419ea0a3f864cf99e32c038c21 +refs/heads/master: f6d7617862e106affc59c6933099e45629af5c4e diff --git a/trunk/fs/cifs/cifsglob.h b/trunk/fs/cifs/cifsglob.h index 5e4d1c56767d..0c53a8339253 100644 --- a/trunk/fs/cifs/cifsglob.h +++ b/trunk/fs/cifs/cifsglob.h @@ -234,6 +234,10 @@ struct smb_version_operations { /* build a full path to the root of the mount */ char * (*build_path_to_root)(struct smb_vol *, struct cifs_sb_info *, 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 { diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index 7b4bc1e0b08e..a83ed766aa94 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -406,15 +406,17 @@ cifs_echo_request(struct work_struct *work) struct TCP_Server_Info, echo.work); /* - * We cannot send an echo until the NEGOTIATE_PROTOCOL request is - * done, which is indicated by maxBuf != 0. Also, no need to ping if - * we got a response recently + * We cannot send an echo if it is disabled or until the + * NEGOTIATE_PROTOCOL request is done, which is indicated by + * 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) || + (server->ops->can_echo && !server->ops->can_echo(server)) || time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) goto requeue_echo; - rc = CIFSSMBEcho(server); + rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS; if (rc) cFYI(1, "Unable to send echo request to server: %s", server->hostname); diff --git a/trunk/fs/cifs/smb1ops.c b/trunk/fs/cifs/smb1ops.c index 7bd4973591de..c9326b4ec6cd 100644 --- a/trunk/fs/cifs/smb1ops.c +++ b/trunk/fs/cifs/smb1ops.c @@ -551,6 +551,7 @@ struct smb_version_operations smb1_operations = { .query_path_info = cifs_query_path_info, .get_srv_inum = cifs_get_srv_inum, .build_path_to_root = cifs_build_path_to_root, + .echo = CIFSSMBEcho, }; struct smb_version_values smb1_values = {