lkml.org 
[lkml]   [2004]   [Apr]   [26]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/11] sunrpc-multiple-programs
FromAndreas Gruenbacher <>
DateMon, 26 Apr 2004 12:28:47 +0200
Support multiple program numbers on one RPC transport

The NFS and NFSACL programs run on the same RPC transport. This patch
adds support for this by changing svc_program into a chained list of
programs instead of a single program (on the server side).

  Andreas Gruenbacher <agruen@suse.de>, SuSE Labs


Index: linux-2.6.6-rc2/fs/nfsd/nfsproc.c
===================================================================
--- linux-2.6.6-rc2.orig/fs/nfsd/nfsproc.c
+++ linux-2.6.6-rc2/fs/nfsd/nfsproc.c
@@ -588,6 +588,8 @@ nfserrno (int errno)
 		{ nfserr_jukebox, -ETIMEDOUT },
 		{ nfserr_dropit, -EAGAIN },
 		{ nfserr_dropit, -ENOMEM },
+		{ nfserr_notsupp, -ENOTSUPP },
+		{ nfserr_notsupp, -EOPNOTSUPP },
 		{ -1, -EIO }
 	};
 	int	i;
Index: linux-2.6.6-rc2/include/linux/sunrpc/svc.h
===================================================================
--- linux-2.6.6-rc2.orig/include/linux/sunrpc/svc.h
+++ linux-2.6.6-rc2/include/linux/sunrpc/svc.h
@@ -232,9 +232,10 @@ struct svc_deferred_req {
 };
 
 /*
- * RPC program
+ * List of RPC programs on the same transport endpoint
  */
 struct svc_program {
+	struct svc_program *	pg_next;	/* other programs (same xprt) */
 	u32			pg_prog;	/* program number */
 	unsigned int		pg_lovers;	/* lowest version */
 	unsigned int		pg_hivers;	/* lowest version */
Index: linux-2.6.6-rc2/net/sunrpc/svc.c
===================================================================
--- linux-2.6.6-rc2.orig/net/sunrpc/svc.c
+++ linux-2.6.6-rc2/net/sunrpc/svc.c
@@ -326,8 +326,10 @@ svc_process(struct svc_serv *serv, struc
 		goto sendit;
 	}
 		
-	progp = serv->sv_program;
-	if (prog != progp->pg_prog)
+	for (progp = serv->sv_program; progp; progp = progp->pg_next)
+		if (prog == progp->pg_prog)
+			break;
+	if (progp == NULL)
 		goto err_bad_prog;
 
 	if (vers >= progp->pg_nvers ||
@@ -440,7 +442,7 @@ err_bad_auth:
 
 err_bad_prog:
 #ifdef RPC_PARANOIA
-	if (prog != 100227 || progp->pg_prog != 100003)
+	if (prog != 100227 || serv->sv_program->pg_prog != 100003)
 		printk("svc: unknown program %d (me %d)\n", prog, progp->pg_prog);
 	/* else it is just a Solaris client seeing if ACLs are supported */
 #endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:02    [from the cache]
©2003-2008