All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 02/13] cifs: make wait_for_free_request take a TCP_Server_Info pointer
Date: Fri, 10 Dec 2010 10:44:26 -0500	[thread overview]
Message-ID: <1291995877-2276-3-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1291995877-2276-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

The cifsSesInfo pointer is only used to get at the server.

Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/cifs/transport.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index e0588cd..9763f89 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -244,31 +244,31 @@ smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer,
 	return smb_sendv(server, &iov, 1);
 }
 
-static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
+static int wait_for_free_request(struct TCP_Server_Info *server,
+				 const int long_op)
 {
 	if (long_op == CIFS_ASYNC_OP) {
 		/* oplock breaks must not be held up */
-		atomic_inc(&ses->server->inFlight);
+		atomic_inc(&server->inFlight);
 		return 0;
 	}
 
 	spin_lock(&GlobalMid_Lock);
 	while (1) {
-		if (atomic_read(&ses->server->inFlight) >=
-				cifs_max_pending){
+		if (atomic_read(&server->inFlight) >= cifs_max_pending) {
 			spin_unlock(&GlobalMid_Lock);
 #ifdef CONFIG_CIFS_STATS2
-			atomic_inc(&ses->server->num_waiters);
+			atomic_inc(&server->num_waiters);
 #endif
-			wait_event(ses->server->request_q,
-				   atomic_read(&ses->server->inFlight)
+			wait_event(server->request_q,
+				   atomic_read(&server->inFlight)
 				     < cifs_max_pending);
 #ifdef CONFIG_CIFS_STATS2
-			atomic_dec(&ses->server->num_waiters);
+			atomic_dec(&server->num_waiters);
 #endif
 			spin_lock(&GlobalMid_Lock);
 		} else {
-			if (ses->server->tcpStatus == CifsExiting) {
+			if (server->tcpStatus == CifsExiting) {
 				spin_unlock(&GlobalMid_Lock);
 				return -ENOENT;
 			}
@@ -278,7 +278,7 @@ static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
 
 			/* update # of requests on the wire to server */
 			if (long_op != CIFS_BLOCKING_OP)
-				atomic_inc(&ses->server->inFlight);
+				atomic_inc(&server->inFlight);
 			spin_unlock(&GlobalMid_Lock);
 			break;
 		}
@@ -413,7 +413,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
 	   to the same server. We may make this configurable later or
 	   use ses->maxReq */
 
-	rc = wait_for_free_request(ses, long_op);
+	rc = wait_for_free_request(ses->server, long_op);
 	if (rc) {
 		cifs_small_buf_release(in_buf);
 		return rc;
@@ -610,7 +610,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 		return -EIO;
 	}
 
-	rc = wait_for_free_request(ses, long_op);
+	rc = wait_for_free_request(ses->server, long_op);
 	if (rc)
 		return rc;
 
@@ -845,7 +845,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
 		return -EIO;
 	}
 
-	rc = wait_for_free_request(ses, CIFS_BLOCKING_OP);
+	rc = wait_for_free_request(ses->server, CIFS_BLOCKING_OP);
 	if (rc)
 		return rc;
 
-- 
1.7.3.2

  parent reply	other threads:[~2010-12-10 15:44 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10 15:44 [PATCH 00/14] cifs: overhaul request timeout behavior in CIFS (try #2) Jeff Layton
     [not found] ` <1291995877-2276-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-10 15:44   ` [PATCH 01/13] cifs: don't fail writepages on -EAGAIN errors Jeff Layton
     [not found]     ` <1291995877-2276-2-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-10 22:14       ` [PATCH 00/13] cifs: don't fail writepages on -EAGAIN errors (try #2) Jeff Layton
     [not found]         ` <1292019275-7248-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-13 20:17           ` Pavel Shilovsky
2010-12-13 20:01       ` [PATCH 01/13] cifs: don't fail writepages on -EAGAIN errors Pavel Shilovsky
     [not found]         ` <AANLkTinzyPMq79aXmzARLpm1+X_GZho38AYR=zuyXKCi-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-13 20:05           ` Jeff Layton
     [not found]             ` <20101213150556.7f0cf2f1-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-12-13 20:10               ` Pavel Shilovsky
2010-12-14  9:26       ` Suresh Jayaraman
     [not found]         ` <4D07383A.6000400-l3A5Bk7waGM@public.gmane.org>
2010-12-14 12:18           ` Jeff Layton
     [not found]             ` <20101214071820.2aa4936b-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-12-16 16:35               ` Steve French
     [not found]                 ` <AANLkTi=soXxgZMXoWrbx2_eJtGQR5iHncXtDO_dbWRX7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-16 17:08                   ` Jeff Layton
2010-12-10 15:44   ` Jeff Layton [this message]
     [not found]     ` <1291995877-2276-3-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-13 20:03       ` [PATCH 02/13] cifs: make wait_for_free_request take a TCP_Server_Info pointer Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 03/13] cifs: move mid result processing into common function Jeff Layton
     [not found]     ` <1291995877-2276-4-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-12 23:29       ` Shirish Pargaonkar
     [not found]         ` <AANLkTimGiESxGU4qnQ2fX+xTJw94BR5PspMp981VKKe--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-13  0:17           ` Jeff Layton
2010-12-14  7:34       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 04/13] cifs: wait indefinitely for responses Jeff Layton
     [not found]     ` <1291995877-2276-5-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-13 20:04       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 05/13] cifs: don't reconnect server when we don't get a response Jeff Layton
     [not found]     ` <1291995877-2276-6-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-13 20:06       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 06/13] cifs: clean up handle_mid_response Jeff Layton
     [not found]     ` <1291995877-2276-7-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-12 23:52       ` Shirish Pargaonkar
     [not found]         ` <AANLkTi=j8j=OxUxJcwn4h6EqvHSH2vrhQkzRxYjAerzi-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-13  0:21           ` Jeff Layton
     [not found]             ` <20101212192152.0c75c5ce-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-12-14  7:33               ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 07/13] cifs: allow for different handling of received response Jeff Layton
     [not found]     ` <1291995877-2276-8-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-13 20:21       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 08/13] cifs: handle cancelled requests better Jeff Layton
     [not found]     ` <1291995877-2276-9-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-14  7:24       ` Pavel Shilovsky
     [not found]         ` <AANLkTinU19tUL-6uwYN64dfE1Rsa+uSiC2fkeBHV+XOS-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14 11:59           ` Jeff Layton
     [not found]             ` <20101214065935.50a0bdf0-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-12-14 20:40               ` Pavel Shilovsky
     [not found]                 ` <AANLkTi=mFXsJd55CzebrKO24ALnwmduBnFLyYZCRVdP4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14 21:33                   ` Steve French
     [not found]                     ` <AANLkTinSC4WKa4ZBeEOWkSQmy6wBhU8=cO09EKy2Qda2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14 21:44                       ` Jeff Layton
     [not found]                         ` <20101214164407.377304e0-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-12-14 22:22                           ` Steve French
     [not found]                             ` <AANLkTimFQSeMk8ZCbAud+RdU5WQcGrDnKz+dAC_UFzNM-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14 23:18                               ` Jeff Layton
     [not found]                                 ` <20101214181829.0075c6c6-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-12-15  4:05                                   ` Steve French
2010-12-15 11:37                                     ` Jeff Layton
2010-12-10 15:44   ` [PATCH 09/13] cifs: add cifs_call_async Jeff Layton
     [not found]     ` <1291995877-2276-10-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-14  6:52       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 10/13] cifs: add ability to send an echo request Jeff Layton
     [not found]     ` <1291995877-2276-11-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-14  7:15       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 11/13] cifs: set up recurring workqueue job to do SMB echo requests Jeff Layton
     [not found]     ` <1291995877-2276-12-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-14  6:57       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 12/13] cifs: reconnect unresponsive servers Jeff Layton
     [not found]     ` <1291995877-2276-13-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-14  6:57       ` Pavel Shilovsky
2010-12-10 15:44   ` [PATCH 13/13] cifs: remove code for setting timeouts on requests Jeff Layton
     [not found]     ` <1291995877-2276-14-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-14  7:25       ` Pavel Shilovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291995877-2276-3-git-send-email-jlayton@redhat.com \
    --to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.