Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd79bc57 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: Don't take transport->lock unnecessarily when taking XPRT_LOCK

parent adfa7144
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -298,6 +298,8 @@ static inline int xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
{
	int retval;

	if (test_bit(XPRT_LOCKED, &xprt->state) && xprt->snd_task == task)
		return 1;
	spin_lock_bh(&xprt->transport_lock);
	retval = xprt->ops->reserve_xprt(xprt, task);
	spin_unlock_bh(&xprt->transport_lock);
@@ -375,6 +377,8 @@ EXPORT_SYMBOL_GPL(xprt_release_xprt_cong);

static inline void xprt_release_write(struct rpc_xprt *xprt, struct rpc_task *task)
{
	if (xprt->snd_task != task)
		return;
	spin_lock_bh(&xprt->transport_lock);
	xprt->ops->release_xprt(xprt, task);
	spin_unlock_bh(&xprt->transport_lock);
@@ -1645,7 +1649,6 @@ void xprt_release(struct rpc_task *task)
	if (req == NULL) {
		if (task->tk_client) {
			xprt = task->tk_xprt;
			if (xprt->snd_task == task)
			xprt_release_write(xprt, task);
		}
		return;