Skip to contentSkip to conversation

NFSv4 cleanups [1/many]

PATCH New Trond Myklebust 1 participant 1 message Dec 12, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSv4 cleanups [1/many]

- Move the encoding/decoding of the actual COMPOUND XDR header out of encode_compound()/decode_compound().

- Make each NFSv4 operation 'decode_' routine also take care of decoding its own header, and checking it for correctness. Also allows us to get rid of the 'nfserr' parameter...

Cheers,
Trond

fs/nfs/nfs4proc.c +6 -6
diff -u --recursive --new-file linux-2.5.49-00-nfsv4_xdr1/fs/nfs/nfs4proc.c linux-2.5.49-01-nfsv4_xdr2/fs/nfs/nfs4proc.c
@@ -648,7 +648,7 @@
 {
 	int status;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
 		.rpc_argp = cp,
 		.rpc_resp = cp,
 		.rpc_cred = cred,
@@ -1112,7 +1112,7 @@
 	nfs4_setup_remove(cp, name, &up->cinfo);
 	nfs4_setup_getattr(cp, &up->attrs, bmres);
 	
-	msg->rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND];
+	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND];
 	msg->rpc_argp = cp;
 	msg->rpc_resp = cp;
 	return 0;
@@ -1373,7 +1373,7 @@
 	struct rpc_task	*task = &data->task;
 	struct nfs4_compound *cp = &data->u.v4.compound;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
 		.rpc_argp = cp,
 		.rpc_resp = cp,
 		.rpc_cred = data->cred,
@@ -1417,7 +1417,7 @@
 	struct rpc_task	*task = &data->task;
 	struct nfs4_compound *cp = &data->u.v4.compound;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
 		.rpc_argp = cp,
 		.rpc_resp = cp,
 		.rpc_cred = data->cred,
@@ -1468,7 +1468,7 @@
 	struct rpc_task	*task = &data->task;
 	struct nfs4_compound *cp = &data->u.v4.compound;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_COMPOUND],
+		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
 		.rpc_argp = cp,
 		.rpc_resp = cp,
 		.rpc_cred = data->cred,
@@ -1523,7 +1523,7 @@
 	struct rpc_task *task;
 	struct nfs4_compound *cp;
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_COMPOUND],
+		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_COMPOUND],
 	};
 
 	rp = (struct renew_desc *) kmalloc(sizeof(*rp), GFP_KERNEL);
fs/nfs/nfs4xdr.c +424 -279

995 lines not on this page · raw message

include/linux/nfs4.h +10 -0
diff -u --recursive --new-file linux-2.5.49-00-nfsv4_xdr1/include/linux/nfs4.h linux-2.5.49-01-nfsv4_xdr2/include/linux/nfs4.h
@@ -196,6 +196,16 @@
 #define NFS4_MINOR_VERSION 0
 #define NFS4_DEBUG 1
 
+#ifdef __KERNEL__
+
+/* Index of predefined Linux client operations */
+
+enum {
+	NFSPROC4_CLNT_NULL = 0,		/* Unused */
+	NFSPROC4_CLNT_COMPOUND,		/* Soon to be unused */
+};
+
+#endif
 #endif
 
 /*
include/linux/nfs_xdr.h +0 -1
diff -u --recursive --new-file linux-2.5.49-00-nfsv4_xdr1/include/linux/nfs_xdr.h linux-2.5.49-01-nfsv4_xdr2/include/linux/nfs_xdr.h
@@ -488,7 +488,6 @@
 
 struct nfs4_op {
 	u32				opnum;
-	u32				nfserr;
 	union {
 		struct nfs4_access	access;
 		struct nfs4_close	close;

-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs