ソースを参照

[PATCH] RPC: Rename xprt_lock

 Clean-up: Replace the xprt_lock with something more aptly named.  This lock
 single-threads the XID and request slot reservation process.

 Test-plan:
 Compile kernel with CONFIG_NFS enabled.

 Version: Thu, 11 Aug 2005 16:05:26 -0400

 Signed-off-by: Chuck Lever <cel@netapp.com>
 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Chuck Lever 20 年 前
コミット
5dc07727f8
2 ファイル変更6 行追加6 行削除
  1. 1 1
      include/linux/sunrpc/xprt.h
  2. 5 5
      net/sunrpc/xprt.c

+ 1 - 1
include/linux/sunrpc/xprt.h

@@ -199,7 +199,7 @@ struct rpc_xprt {
 	 * Send stuff
 	 * Send stuff
 	 */
 	 */
 	spinlock_t		transport_lock;	/* lock transport info */
 	spinlock_t		transport_lock;	/* lock transport info */
-	spinlock_t		xprt_lock;	/* lock xprt info */
+	spinlock_t		reserve_lock;	/* lock slot table */
 	struct rpc_task *	snd_task;	/* Task blocked in send */
 	struct rpc_task *	snd_task;	/* Task blocked in send */
 
 
 	struct list_head	recv;
 	struct list_head	recv;

+ 5 - 5
net/sunrpc/xprt.c

@@ -643,9 +643,9 @@ void xprt_reserve(struct rpc_task *task)
 
 
 	task->tk_status = -EIO;
 	task->tk_status = -EIO;
 	if (!xprt->shutdown) {
 	if (!xprt->shutdown) {
-		spin_lock(&xprt->xprt_lock);
+		spin_lock(&xprt->reserve_lock);
 		do_xprt_reserve(task);
 		do_xprt_reserve(task);
-		spin_unlock(&xprt->xprt_lock);
+		spin_unlock(&xprt->reserve_lock);
 	}
 	}
 }
 }
 
 
@@ -698,10 +698,10 @@ void xprt_release(struct rpc_task *task)
 
 
 	dprintk("RPC: %4d release request %p\n", task->tk_pid, req);
 	dprintk("RPC: %4d release request %p\n", task->tk_pid, req);
 
 
-	spin_lock(&xprt->xprt_lock);
+	spin_lock(&xprt->reserve_lock);
 	list_add(&req->rq_list, &xprt->free);
 	list_add(&req->rq_list, &xprt->free);
 	xprt_clear_backlog(xprt);
 	xprt_clear_backlog(xprt);
-	spin_unlock(&xprt->xprt_lock);
+	spin_unlock(&xprt->reserve_lock);
 }
 }
 
 
 /**
 /**
@@ -751,7 +751,7 @@ static struct rpc_xprt *xprt_setup(int proto, struct sockaddr_in *ap, struct rpc
 	}
 	}
 
 
 	spin_lock_init(&xprt->transport_lock);
 	spin_lock_init(&xprt->transport_lock);
-	spin_lock_init(&xprt->xprt_lock);
+	spin_lock_init(&xprt->reserve_lock);
 	init_waitqueue_head(&xprt->cong_wait);
 	init_waitqueue_head(&xprt->cong_wait);
 
 
 	INIT_LIST_HEAD(&xprt->free);
 	INIT_LIST_HEAD(&xprt->free);