public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
To: trond.myklebust@netapp.com
Cc: bhalevy@panasas.com, pnfs@linux-nfs.org,
	linux-nfs@vger.kernel.org,
	Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Subject: [PATCH 3/3] SQUASHME: nfs41: Backchannel: Be more obvious about the return value
Date: Tue, 16 Jun 2009 11:26:40 -0700	[thread overview]
Message-ID: <1245176800-10595-3-git-send-email-Ricardo.Labiaga@netapp.com> (raw)
In-Reply-To: <1245176800-10595-2-git-send-email-Ricardo.Labiaga@netapp.com>

validate_seqid() returns the error value that will be encoded into the XDR
result. Change validate_seqid() to return be32 so that it's obvious that this
error is meant to be XDR encoded.

[squash with: nfs41: Backchannel: CB_SEQUENCE validation]

Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
---
 fs/nfs/callback_proc.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index c85d66f..95e9022 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -127,7 +127,7 @@ validate_seqid(struct nfs4_slot_table *tbl, u32 slotid, u32 seqid)
 		__func__, slotid, seqid);
 
 	if (slotid > NFS41_BC_MAX_CALLBACKS)
-		return NFS4ERR_BADSLOT;
+		return htonl(NFS4ERR_BADSLOT);
 
 	slot = tbl->slots + slotid;
 	dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr);
@@ -135,24 +135,24 @@ validate_seqid(struct nfs4_slot_table *tbl, u32 slotid, u32 seqid)
 	/* Normal */
 	if (likely(seqid == slot->seq_nr + 1)) {
 		slot->seq_nr++;
-		return NFS4_OK;
+		return htonl(NFS4_OK);
 	}
 
 	/* Replay */
 	if (seqid == slot->seq_nr) {
 		dprintk("%s seqid %d is a replay - no DRC available\n",
 			__func__, seqid);
-		return NFS4_OK;
+		return htonl(NFS4_OK);
 	}
 
 	/* Wraparound */
 	if (seqid == 1 && (slot->seq_nr + 1) == 0) {
 		slot->seq_nr = 1;
-		return NFS4_OK;
+		return htonl(NFS4_OK);
 	}
 
 	/* Misordered request */
-	return NFS4ERR_SEQ_MISORDERED;
+	return htonl(NFS4ERR_SEQ_MISORDERED);
 }
 
 /*
@@ -202,7 +202,7 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
 		kfree(args->csa_rclists[i].rcl_refcalls);
 	kfree(args->csa_rclists);
 
-	status = NFS4ERR_BADSESSION;
+	status = htonl(NFS4ERR_BADSESSION);
 	clp = find_client_with_session(args->csa_addr, 4, &args->csa_sessionid);
 	if (clp == NULL)
 		goto out;
@@ -223,7 +223,7 @@ out_putclient:
 	nfs_put_client(clp);
 out:
 	dprintk("%s: exit with status = %d\n", __func__, status);
-	res->csr_status = htonl(status);
+	res->csr_status = status;
 	return res->csr_status;
 }
 
-- 
1.5.4.3


      reply	other threads:[~2009-06-16 18:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 18:26 [PATCH 1/3] nfs41: SQUASHME: Update to removal of ugly #ifdefs Ricardo Labiaga
2009-06-16 18:26 ` [PATCH 2/3] SQUASHME: nfs41: Backchannel: Remove FIXME comment Ricardo Labiaga
2009-06-16 18:26   ` Ricardo Labiaga [this message]

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=1245176800-10595-3-git-send-email-Ricardo.Labiaga@netapp.com \
    --to=ricardo.labiaga@netapp.com \
    --cc=bhalevy@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pnfs@linux-nfs.org \
    --cc=trond.myklebust@netapp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox