From: Trond Myklebust <trond.myklebust@fys.uio.no>

RPCSEC_GSS: Move the gss sequence number history from the task structure to
the request structure, where it makes more sense.  In particular, when we
start storing more sequence number history (necessary to process responses to
resent requests correctly), this will make it easier to initialize the
necessary data structure in the right place (in xprt_request_iniit)


---

 include/linux/sunrpc/sched.h   |    2 --
 include/linux/sunrpc/xprt.h    |    1 +
 net/sunrpc/auth_gss/auth_gss.c |   10 +++++-----
 3 files changed, 6 insertions(+), 7 deletions(-)

diff -puN include/linux/sunrpc/sched.h~nfs-14-clnt_seqno_to_req include/linux/sunrpc/sched.h
--- 25/include/linux/sunrpc/sched.h~nfs-14-clnt_seqno_to_req	2004-01-09 22:16:16.000000000 -0800
+++ 25-akpm/include/linux/sunrpc/sched.h	2004-01-09 22:16:16.000000000 -0800
@@ -48,8 +48,6 @@ struct rpc_task {
 	__u8			tk_garb_retry,
 				tk_cred_retry,
 				tk_suid_retry;
-	u32			tk_gss_seqno;	/* rpcsec_gss sequence number
-						   used on this request */
 
 	/*
 	 * timeout_fn   to be executed by timer bottom half
diff -puN include/linux/sunrpc/xprt.h~nfs-14-clnt_seqno_to_req include/linux/sunrpc/xprt.h
--- 25/include/linux/sunrpc/xprt.h~nfs-14-clnt_seqno_to_req	2004-01-09 22:16:16.000000000 -0800
+++ 25-akpm/include/linux/sunrpc/xprt.h	2004-01-09 22:16:16.000000000 -0800
@@ -95,6 +95,7 @@ struct rpc_rqst {
 	struct rpc_rqst *	rq_next;	/* free list */
 	int			rq_cong;	/* has incremented xprt->cong */
 	int			rq_received;	/* receive completed */
+	u32			rq_seqno;	/* gss seq no. used on req. */
 
 	struct list_head	rq_list;
 
diff -puN net/sunrpc/auth_gss/auth_gss.c~nfs-14-clnt_seqno_to_req net/sunrpc/auth_gss/auth_gss.c
--- 25/net/sunrpc/auth_gss/auth_gss.c~nfs-14-clnt_seqno_to_req	2004-01-09 22:16:16.000000000 -0800
+++ 25-akpm/net/sunrpc/auth_gss/auth_gss.c	2004-01-09 22:16:16.000000000 -0800
@@ -690,12 +690,12 @@ gss_marshal(struct rpc_task *task, u32 *
 		goto out_put_ctx;
 	}
 	spin_lock(&ctx->gc_seq_lock);
-	task->tk_gss_seqno = ctx->gc_seq++;
+	req->rq_seqno = ctx->gc_seq++;
 	spin_unlock(&ctx->gc_seq_lock);
 
 	*p++ = htonl((u32) RPC_GSS_VERSION);
 	*p++ = htonl((u32) ctx->gc_proc);
-	*p++ = htonl((u32) task->tk_gss_seqno);
+	*p++ = htonl((u32) req->rq_seqno);
 	*p++ = htonl((u32) service);
 	p = xdr_encode_netobj(p, &ctx->gc_wire_ctx);
 	*cred_len = htonl((p - (cred_len + 1)) << 2);
@@ -766,7 +766,7 @@ gss_validate(struct rpc_task *task, u32 
                 goto out_bad;
 	if (flav != RPC_AUTH_GSS)
 		goto out_bad;
-	seq = htonl(task->tk_gss_seqno);
+	seq = htonl(task->tk_rqstp->rq_seqno);
 	iov.iov_base = &seq;
 	iov.iov_len = sizeof(seq);
 	xdr_buf_from_iov(&iov, &verf_buf);
@@ -832,7 +832,7 @@ gss_wrap_req(struct rpc_task *task,
 
 			integ_len = p++;
 			offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base;
-			*p++ = htonl(task->tk_gss_seqno);
+			*p++ = htonl(req->rq_seqno);
 
 			status = encode(rqstp, p, obj);
 			if (status)
@@ -909,7 +909,7 @@ gss_unwrap_resp(struct rpc_task *task,
 			mic_offset = integ_len + data_offset;
 			if (mic_offset > rcv_buf->len)
 				goto out;
-			if (ntohl(*p++) != task->tk_gss_seqno)
+			if (ntohl(*p++) != req->rq_seqno)
 				goto out;
 
 			if (xdr_buf_subsegment(rcv_buf, &integ_buf, data_offset,

_