Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82469
b: refs/heads/master
c: a50fea2
h: refs/heads/master
i:
  82467: bb8e125
v: v3
  • Loading branch information
Tom Tucker authored and J. Bruce Fields committed Feb 1, 2008
1 parent 031dfd0 commit fbb4a3f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6150c3cab6e788afacb07470be3c6b4a722f1ed
refs/heads/master: a50fea26b9d2aa7b66fdd6d9579de10827ec086a
1 change: 1 addition & 0 deletions trunk/include/linux/sunrpc/svc_xprt.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct svc_xprt {
struct svc_pool *xpt_pool; /* current pool iff queued */
struct svc_serv *xpt_server; /* service for transport */
atomic_t xpt_reserved; /* space on outq that is rsvd */
struct mutex xpt_mutex; /* to serialize sending data */
};

int svc_reg_xprt_class(struct svc_xprt_class *);
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/sunrpc/svcsock.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct svc_sock {
* sk_info_authunix */
struct list_head sk_deferred; /* deferred requests that need to
* be revisted */
struct mutex sk_mutex; /* to serialize sending data */

/* We keep the old state_change and data_ready CB's here */
void (*sk_ostate)(struct sock *);
Expand Down
1 change: 1 addition & 0 deletions trunk/net/sunrpc/svc_xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void svc_xprt_init(struct svc_xprt_class *xcl, struct svc_xprt *xprt,
xprt->xpt_server = serv;
INIT_LIST_HEAD(&xprt->xpt_list);
INIT_LIST_HEAD(&xprt->xpt_ready);
mutex_init(&xprt->xpt_mutex);
}
EXPORT_SYMBOL_GPL(svc_xprt_init);

Expand Down
19 changes: 8 additions & 11 deletions trunk/net/sunrpc/svcsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,15 +1632,13 @@ svc_drop(struct svc_rqst *rqstp)
int
svc_send(struct svc_rqst *rqstp)
{
struct svc_sock *svsk;
struct svc_xprt *xprt;
int len;
struct xdr_buf *xb;

if ((svsk = rqstp->rq_sock) == NULL) {
printk(KERN_WARNING "NULL socket pointer in %s:%d\n",
__FILE__, __LINE__);
xprt = rqstp->rq_xprt;
if (!xprt)
return -EFAULT;
}

/* release the receive skb before sending the reply */
rqstp->rq_xprt->xpt_ops->xpo_release_rqst(rqstp);
Expand All @@ -1651,13 +1649,13 @@ svc_send(struct svc_rqst *rqstp)
xb->page_len +
xb->tail[0].iov_len;

/* Grab svsk->sk_mutex to serialize outgoing data. */
mutex_lock(&svsk->sk_mutex);
if (test_bit(XPT_DEAD, &svsk->sk_xprt.xpt_flags))
/* Grab mutex to serialize outgoing data. */
mutex_lock(&xprt->xpt_mutex);
if (test_bit(XPT_DEAD, &xprt->xpt_flags))
len = -ENOTCONN;
else
len = svsk->sk_xprt.xpt_ops->xpo_sendto(rqstp);
mutex_unlock(&svsk->sk_mutex);
len = xprt->xpt_ops->xpo_sendto(rqstp);
mutex_unlock(&xprt->xpt_mutex);
svc_sock_release(rqstp);

if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN)
Expand Down Expand Up @@ -1759,7 +1757,6 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,
svsk->sk_lastrecv = get_seconds();
spin_lock_init(&svsk->sk_lock);
INIT_LIST_HEAD(&svsk->sk_deferred);
mutex_init(&svsk->sk_mutex);

/* Initialize the socket */
if (sock->type == SOCK_DGRAM)
Expand Down

0 comments on commit fbb4a3f

Please sign in to comment.