public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Kill PROC macro from NLM
@ 2009-07-16  9:27 Bian Naimeng
  2009-07-16  9:29 ` [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures Bian Naimeng
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Bian Naimeng @ 2009-07-16  9:27 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

In NFSv4 and rpcb_clnt, the PROC macro was killed.
I think maybe we should kill it from NLM too.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
   NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures.
   NLM: Kill PROC macro from NLMv4 server procedures.
   NLM: Kill PROC macro from NLMv1 and NLMv3 client procedures.
   NLM: Kill PROC macro from NLMv4 client procedures.

Best Regard.
 Bian Naimeng


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures
  2009-07-16  9:27 [PATCH 0/4] Kill PROC macro from NLM Bian Naimeng
@ 2009-07-16  9:29 ` Bian Naimeng
  2009-07-16 21:27   ` Trond Myklebust
  2009-07-16  9:30 ` [PATCH 2/4]Kill PROC macro from NLMv4 " Bian Naimeng
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Bian Naimeng @ 2009-07-16  9:29 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

In order to make the code more clear, PROC macro from NLMv1 and NLMv3
server procedures.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 fs/lockd/svcproc.c |  236 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 202 insertions(+), 34 deletions(-)

diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index e1d28dd..f9596a5 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -499,15 +499,16 @@ nlmsvc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res  *argp,
 
 struct nlm_void			{ int dummy; };
 
-#define PROC(name, xargt, xrest, argt, rest, respsize)	\
- { .pc_func	= (svc_procfunc) nlmsvc_proc_##name,	\
-   .pc_decode	= (kxdrproc_t) nlmsvc_decode_##xargt,	\
-   .pc_encode	= (kxdrproc_t) nlmsvc_encode_##xrest,	\
-   .pc_release	= NULL,					\
-   .pc_argsize	= sizeof(struct nlm_##argt),		\
-   .pc_ressize	= sizeof(struct nlm_##rest),		\
-   .pc_xdrressize = respsize,				\
- }
+#define NLMSVC_NONE_PROC \
+{								\
+	.pc_func	= (svc_procfunc) nlmsvc_proc_none,	\
+	.pc_decode	= (kxdrproc_t) nlmsvc_decode_void,	\
+	.pc_encode	= (kxdrproc_t) nlmsvc_encode_void,	\
+	.pc_release	= NULL,					\
+	.pc_argsize	= sizeof(struct nlm_void),		\
+	.pc_ressize	= sizeof(struct nlm_void),		\
+	.pc_xdrressize	= 1,					\
+}
 
 #define	Ck	(1+XDR_QUADLEN(NLM_MAXCOOKIELEN))	/* cookie */
 #define	St	1				/* status */
@@ -515,30 +516,197 @@ struct nlm_void			{ int dummy; };
 #define	Rg	2				/* range - offset + size */
 
 struct svc_procedure		nlmsvc_procedures[] = {
-  PROC(null,		void,		void,		void,	void, 1),
-  PROC(test,		testargs,	testres,	args,	res, Ck+St+2+No+Rg),
-  PROC(lock,		lockargs,	res,		args,	res, Ck+St),
-  PROC(cancel,		cancargs,	res,		args,	res, Ck+St),
-  PROC(unlock,		unlockargs,	res,		args,	res, Ck+St),
-  PROC(granted,		testargs,	res,		args,	res, Ck+St),
-  PROC(test_msg,	testargs,	norep,		args,	void, 1),
-  PROC(lock_msg,	lockargs,	norep,		args,	void, 1),
-  PROC(cancel_msg,	cancargs,	norep,		args,	void, 1),
-  PROC(unlock_msg,	unlockargs,	norep,		args,	void, 1),
-  PROC(granted_msg,	testargs,	norep,		args,	void, 1),
-  PROC(test_res,	testres,	norep,		res,	void, 1),
-  PROC(lock_res,	lockres,	norep,		res,	void, 1),
-  PROC(cancel_res,	cancelres,	norep,		res,	void, 1),
-  PROC(unlock_res,	unlockres,	norep,		res,	void, 1),
-  PROC(granted_res,	res,		norep,		res,	void, 1),
+	[NLMPROC_NULL] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_null,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_void,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_void,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_void),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_TEST] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_test,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_testres,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St+2+No+Rg,
+	},
+	[NLMPROC_LOCK] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_lock,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_lockargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_CANCEL] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_cancel,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_cancargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_UNLOCK] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_unlock,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_unlockargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_GRANTED] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_granted,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_TEST_MSG] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_test_msg,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_LOCK_MSG] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_lock_msg,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_lockargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_CANCEL_MSG] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_cancel_msg,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_cancargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_UNLOCK_MSG] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_unlock_msg,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_unlockargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_GRANTED_MSG] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_granted_msg,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_TEST_RES] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_test_res,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_testres,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_LOCK_RES] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_lock_res,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_lockres,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_CANCEL_RES] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_cancel_res,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_cancelres,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_UNLOCK_RES] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_unlock_res,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_unlockres,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_GRANTED_RES] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_granted_res,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_res,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
   /* statd callback */
-  PROC(sm_notify,	reboot,		void,		reboot,	void, 1),
-  PROC(none,		void,		void,		void,	void, 1),
-  PROC(none,		void,		void,		void,	void, 1),
-  PROC(none,		void,		void,		void,	void, 1),
-  PROC(share,		shareargs,	shareres,	args,	res, Ck+St+1),
-  PROC(unshare,		shareargs,	shareres,	args,	res, Ck+St+1),
-  PROC(nm_lock,		lockargs,	res,		args,	res, Ck+St),
-  PROC(free_all,	notify,		void,		args,	void, 0),
-
+	[NLMPROC_NSM_NOTIFY] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_sm_notify,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_reboot,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_void,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_reboot),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	NLMSVC_NONE_PROC,
+	NLMSVC_NONE_PROC,
+	NLMSVC_NONE_PROC,
+	[NLMPROC_SHARE] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_share,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_shareargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_shareres,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St+1,
+	},
+	[NLMPROC_UNSHARE] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_unshare,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_shareargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_shareres,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St+1,
+	},
+	[NLMPROC_NM_LOCK] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_nm_lock,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_lockargs,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_FREE_ALL] = {
+		.pc_func	= (svc_procfunc) nlmsvc_proc_free_all,
+		.pc_decode	= (kxdrproc_t) nlmsvc_decode_notify,
+		.pc_encode	= (kxdrproc_t) nlmsvc_encode_void,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 0,
+	},
 };
-- 
1.6.0.3




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4]Kill PROC macro from NLMv4 server procedures
  2009-07-16  9:27 [PATCH 0/4] Kill PROC macro from NLM Bian Naimeng
  2009-07-16  9:29 ` [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures Bian Naimeng
@ 2009-07-16  9:30 ` Bian Naimeng
  2009-07-16  9:31 ` [PATCH 3/4] NLM: Kill PROC macro from NLMv1 and NLMv3 client procedures Bian Naimeng
  2009-07-16  9:32 ` [PATCH 4/4]NLM: Kill PROC macro from NLMv4 " Bian Naimeng
  3 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2009-07-16  9:30 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

In order to make the code more clear, kill PROC macro from NLMv4 server
procedures.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 fs/lockd/svc4proc.c |  237 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 203 insertions(+), 34 deletions(-)

diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index bd173a6..5c31626 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -468,44 +468,213 @@ nlm4svc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res  *argp,
 
 struct nlm_void			{ int dummy; };
 
-#define PROC(name, xargt, xrest, argt, rest, respsize)	\
- { .pc_func	= (svc_procfunc) nlm4svc_proc_##name,	\
-   .pc_decode	= (kxdrproc_t) nlm4svc_decode_##xargt,	\
-   .pc_encode	= (kxdrproc_t) nlm4svc_encode_##xrest,	\
-   .pc_release	= NULL,					\
-   .pc_argsize	= sizeof(struct nlm_##argt),		\
-   .pc_ressize	= sizeof(struct nlm_##rest),		\
-   .pc_xdrressize = respsize,				\
- }
+#define NLM4SVC_NONE_PROC \
+{								\
+	.pc_func	= (svc_procfunc) nlm4svc_proc_none,	\
+	.pc_decode	= (kxdrproc_t) nlm4svc_decode_void,	\
+	.pc_encode	= (kxdrproc_t) nlm4svc_encode_void,	\
+	.pc_release	= NULL,					\
+	.pc_argsize	= sizeof(struct nlm_void),		\
+	.pc_ressize	= sizeof(struct nlm_void),		\
+	.pc_xdrressize	= 0,					\
+}
+
 #define	Ck	(1+XDR_QUADLEN(NLM_MAXCOOKIELEN))	/* cookie */
 #define	No	(1+1024/4)				/* netobj */
 #define	St	1					/* status */
 #define	Rg	4					/* range (offset + length) */
 struct svc_procedure		nlmsvc_procedures4[] = {
-  PROC(null,		void,		void,		void,	void, 1),
-  PROC(test,		testargs,	testres,	args,	res, Ck+St+2+No+Rg),
-  PROC(lock,		lockargs,	res,		args,	res, Ck+St),
-  PROC(cancel,		cancargs,	res,		args,	res, Ck+St),
-  PROC(unlock,		unlockargs,	res,		args,	res, Ck+St),
-  PROC(granted,		testargs,	res,		args,	res, Ck+St),
-  PROC(test_msg,	testargs,	norep,		args,	void, 1),
-  PROC(lock_msg,	lockargs,	norep,		args,	void, 1),
-  PROC(cancel_msg,	cancargs,	norep,		args,	void, 1),
-  PROC(unlock_msg,	unlockargs,	norep,		args,	void, 1),
-  PROC(granted_msg,	testargs,	norep,		args,	void, 1),
-  PROC(test_res,	testres,	norep,		res,	void, 1),
-  PROC(lock_res,	lockres,	norep,		res,	void, 1),
-  PROC(cancel_res,	cancelres,	norep,		res,	void, 1),
-  PROC(unlock_res,	unlockres,	norep,		res,	void, 1),
-  PROC(granted_res,	res,		norep,		res,	void, 1),
+	[NLMPROC_NULL] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_null,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_void,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_void,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_void),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_TEST] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_test,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_testres,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St+2+No+Rg,
+	},
+	[NLMPROC_LOCK] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_lock,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_lockargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_CANCEL] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_cancel,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_cancargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_UNLOCK] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_unlock,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_unlockargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_GRANTED] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_granted,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_TEST_MSG] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_test_msg,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_LOCK_MSG] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_lock_msg,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_lockargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_CANCEL_MSG] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_cancel_msg,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_cancargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_UNLOCK_MSG] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_unlock_msg,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_unlockargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_GRANTED_MSG] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_granted_msg,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_testargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_TEST_RES] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_test_res,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_testres,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_LOCK_RES] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_lock_res,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_lockres,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_CANCEL_RES] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_cancel_res,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_cancelres,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_UNLOCK_RES] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_unlock_res,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_unlockres,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	[NLMPROC_GRANTED_RES] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_granted_res,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_res,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_norep,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_res),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
   /* statd callback */
-  PROC(sm_notify,	reboot,		void,		reboot,	void, 1),
-  PROC(none,		void,		void,		void,	void, 0),
-  PROC(none,		void,		void,		void,	void, 0),
-  PROC(none,		void,		void,		void,	void, 0),
-  PROC(share,		shareargs,	shareres,	args,	res, Ck+St+1),
-  PROC(unshare,		shareargs,	shareres,	args,	res, Ck+St+1),
-  PROC(nm_lock,		lockargs,	res,		args,	res, Ck+St),
-  PROC(free_all,	notify,		void,		args,	void, 1),
-
+	[NLMPROC_NSM_NOTIFY] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_sm_notify,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_reboot,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_void,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_reboot),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
+	NLM4SVC_NONE_PROC,
+	NLM4SVC_NONE_PROC,
+	NLM4SVC_NONE_PROC,
+	[NLMPROC_SHARE] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_share,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_shareargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_shareres,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St+1,
+	},
+	[NLMPROC_UNSHARE] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_unshare,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_shareargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_shareres,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St+1,
+	},
+	[NLMPROC_NM_LOCK] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_nm_lock,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_lockargs,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_res,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_res),
+		.pc_xdrressize	= Ck+St,
+	},
+	[NLMPROC_FREE_ALL] = {
+		.pc_func	= (svc_procfunc) nlm4svc_proc_free_all,
+		.pc_decode	= (kxdrproc_t) nlm4svc_decode_notify,
+		.pc_encode	= (kxdrproc_t) nlm4svc_encode_void,
+		.pc_release	= NULL,
+		.pc_argsize	= sizeof(struct nlm_args),
+		.pc_ressize	= sizeof(struct nlm_void),
+		.pc_xdrressize	= 1,
+	},
 };
-- 
1.6.0.3




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] NLM: Kill PROC macro from NLMv1 and NLMv3 client procedures
  2009-07-16  9:27 [PATCH 0/4] Kill PROC macro from NLM Bian Naimeng
  2009-07-16  9:29 ` [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures Bian Naimeng
  2009-07-16  9:30 ` [PATCH 2/4]Kill PROC macro from NLMv4 " Bian Naimeng
@ 2009-07-16  9:31 ` Bian Naimeng
  2009-07-16  9:32 ` [PATCH 4/4]NLM: Kill PROC macro from NLMv4 " Bian Naimeng
  3 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2009-07-16  9:31 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

In order to make the code more clear, kill PROC macro from NLMv1 and NLMv3
client procedures.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 fs/lockd/xdr.c |  201 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 171 insertions(+), 30 deletions(-)

diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index 0336f2b..1b36274 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -536,38 +536,179 @@ nlmclt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
  */
 #define nlmclt_decode_norep	NULL
 
-#define PROC(proc, argtype, restype)	\
-[NLMPROC_##proc] = {							\
-	.p_proc      = NLMPROC_##proc,					\
-	.p_encode    = (kxdrproc_t) nlmclt_encode_##argtype,		\
-	.p_decode    = (kxdrproc_t) nlmclt_decode_##restype,		\
-	.p_arglen    = NLM_##argtype##_sz,				\
-	.p_replen    = NLM_##restype##_sz,				\
-	.p_statidx   = NLMPROC_##proc,					\
-	.p_name      = #proc,						\
-	}
-
 static struct rpc_procinfo	nlm_procedures[] = {
-    PROC(TEST,		testargs,	testres),
-    PROC(LOCK,		lockargs,	res),
-    PROC(CANCEL,	cancargs,	res),
-    PROC(UNLOCK,	unlockargs,	res),
-    PROC(GRANTED,	testargs,	res),
-    PROC(TEST_MSG,	testargs,	norep),
-    PROC(LOCK_MSG,	lockargs,	norep),
-    PROC(CANCEL_MSG,	cancargs,	norep),
-    PROC(UNLOCK_MSG,	unlockargs,	norep),
-    PROC(GRANTED_MSG,	testargs,	norep),
-    PROC(TEST_RES,	testres,	norep),
-    PROC(LOCK_RES,	res,		norep),
-    PROC(CANCEL_RES,	res,		norep),
-    PROC(UNLOCK_RES,	res,		norep),
-    PROC(GRANTED_RES,	res,		norep),
+	[NLMPROC_TEST] = {
+		.p_proc		= NLMPROC_TEST,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_testres,
+		.p_arglen	= NLM_testargs_sz,
+		.p_replen	= NLM_testres_sz,
+		.p_statidx	= NLMPROC_TEST,
+		.p_name		= "TEST",
+	},
+	[NLMPROC_LOCK] = {
+		.p_proc		= NLMPROC_LOCK,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_lockargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_res,
+		.p_arglen	= NLM_lockargs_sz,
+		.p_replen	= NLM_res_sz,
+		.p_statidx	= NLMPROC_LOCK,
+		.p_name		= "LOCK",
+	},
+	[NLMPROC_CANCEL] = {
+		.p_proc		= NLMPROC_CANCEL,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_cancargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_res,
+		.p_arglen	= NLM_cancargs_sz,
+		.p_replen	= NLM_res_sz,
+		.p_statidx	= NLMPROC_CANCEL,
+		.p_name		= "CANCEL",
+	},
+	[NLMPROC_UNLOCK] = {
+		.p_proc		= NLMPROC_UNLOCK,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_unlockargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_res,
+		.p_arglen	= NLM_unlockargs_sz,
+		.p_replen	= NLM_res_sz,
+		.p_statidx	= NLMPROC_UNLOCK,
+		.p_name		= "UNLOCK",
+	},
+	[NLMPROC_GRANTED] = {
+		.p_proc		= NLMPROC_GRANTED,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_res,
+		.p_arglen	= NLM_testargs_sz,
+		.p_replen	= NLM_res_sz,
+		.p_statidx	= NLMPROC_GRANTED,
+		.p_name		= "GRANTED",
+	},
+	[NLMPROC_TEST_MSG] = {
+		.p_proc		= NLMPROC_TEST_MSG,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_testargs_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_TEST_MSG,
+		.p_name		= "TEST_MSG",
+	},
+	[NLMPROC_LOCK_MSG] = {
+		.p_proc		= NLMPROC_LOCK_MSG,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_lockargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_lockargs_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_LOCK_MSG,
+		.p_name		= "LOCK_MSG",
+	},
+	[NLMPROC_CANCEL_MSG] = {
+		.p_proc		= NLMPROC_CANCEL_MSG,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_cancargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_cancargs_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_CANCEL_MSG,
+		.p_name		= "CANCEL_MSG",
+	},
+	[NLMPROC_UNLOCK_MSG] = {
+		.p_proc		= NLMPROC_UNLOCK_MSG,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_unlockargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_unlockargs_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_UNLOCK_MSG,
+		.p_name		= "UNLOCK_MSG",
+	},
+	[NLMPROC_GRANTED_MSG] = {
+		.p_proc		= NLMPROC_GRANTED_MSG,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_testargs_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_GRANTED_MSG,
+		.p_name		= "GRANTED_MSG",
+	},
+	[NLMPROC_TEST_RES] = {
+		.p_proc		= NLMPROC_TEST_RES,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_testres,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_testres_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_TEST_RES,
+		.p_name		= "TEST_RES",
+	},
+	[NLMPROC_LOCK_RES] = {
+		.p_proc		= NLMPROC_LOCK_RES,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_res,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_res_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_LOCK_RES,
+		.p_name		= "LOCK_RES",
+	},
+	[NLMPROC_CANCEL_RES] = {
+		.p_proc		= NLMPROC_CANCEL_RES,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_res,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_res_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_CANCEL_RES,
+		.p_name		= "CANCEL_RES",
+	},
+	[NLMPROC_UNLOCK_RES] = {
+		.p_proc		= NLMPROC_UNLOCK_RES,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_res,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_res_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_UNLOCK_RES,
+		.p_name		= "UNLOCK_RES",
+	},
+	[NLMPROC_GRANTED_RES] = {
+		.p_proc		= NLMPROC_GRANTED_RES,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_res,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_norep,
+		.p_arglen	= NLM_res_sz,
+		.p_replen	= NLM_norep_sz,
+		.p_statidx	= NLMPROC_GRANTED_RES,
+		.p_name		= "GRANTED_RES",
+	},
 #ifdef NLMCLNT_SUPPORT_SHARES
-    PROC(SHARE,		shareargs,	shareres),
-    PROC(UNSHARE,	shareargs,	shareres),
-    PROC(NM_LOCK,	lockargs,	res),
-    PROC(FREE_ALL,	notify,		void),
+	[NLMPROC_SHARE] = {
+		.p_proc		= NLMPROC_SHARE,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_shareargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_shareres,
+		.p_arglen	= NLM_shareargs_sz,
+		.p_replen	= NLM_shareres_sz,
+		.p_statidx	= NLMPROC_SHARE,
+		.p_name		= "SHARE",
+	},
+	[NLMPROC_UNSHARE] = {
+		.p_proc		= NLMPROC_UNSHARE,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_shareargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_shareres,
+		.p_arglen	= NLM_shareargs_sz,
+		.p_replen	= NLM_shareres_sz,
+		.p_statidx	= NLMPROC_UNSHARE,
+		.p_name		= "UNSHARE",
+	},
+	[NLMPROC_NM_LOCK] = {
+		.p_proc		= NLMPROC_NM_LOCK,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_lockargs,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_res,
+		.p_arglen	= NLM_lockargs_sz,
+		.p_replen	= NLM_res_sz,
+		.p_statidx	= NLMPROC_NM_LOCK,
+		.p_name		= "NM_LOCK",
+	},
+	[NLMPROC_FREE_ALL] = {
+		.p_proc		= NLMPROC_FREE_ALL,
+		.p_encode	= (kxdrproc_t) nlmclt_encode_notify,
+		.p_decode	= (kxdrproc_t) nlmclt_decode_void,
+		.p_arglen	= NLM_notify_sz,
+		.p_replen	= NLM_void_sz,
+		.p_statidx	= NLMPROC_FREE_ALL,
+		.p_name		= "FREE_ALL",
+	},
 #endif
 };
 
-- 
1.6.0.3




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4]NLM: Kill PROC macro from NLMv4 client procedures
  2009-07-16  9:27 [PATCH 0/4] Kill PROC macro from NLM Bian Naimeng
                   ` (2 preceding siblings ...)
  2009-07-16  9:31 ` [PATCH 3/4] NLM: Kill PROC macro from NLMv1 and NLMv3 client procedures Bian Naimeng
@ 2009-07-16  9:32 ` Bian Naimeng
  3 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2009-07-16  9:32 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

In order to make the code more clear, kill PROC macro from NLMv4 client
procedures.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 fs/lockd/xdr4.c |  190 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 171 insertions(+), 19 deletions(-)

diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c
index e1d5286..76ba526 100644
--- a/fs/lockd/xdr4.c
+++ b/fs/lockd/xdr4.c
@@ -560,26 +560,178 @@ nlm4clt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
 	}
 
 static struct rpc_procinfo	nlm4_procedures[] = {
-    PROC(TEST,		testargs,	testres),
-    PROC(LOCK,		lockargs,	res),
-    PROC(CANCEL,	cancargs,	res),
-    PROC(UNLOCK,	unlockargs,	res),
-    PROC(GRANTED,	testargs,	res),
-    PROC(TEST_MSG,	testargs,	norep),
-    PROC(LOCK_MSG,	lockargs,	norep),
-    PROC(CANCEL_MSG,	cancargs,	norep),
-    PROC(UNLOCK_MSG,	unlockargs,	norep),
-    PROC(GRANTED_MSG,	testargs,	norep),
-    PROC(TEST_RES,	testres,	norep),
-    PROC(LOCK_RES,	res,		norep),
-    PROC(CANCEL_RES,	res,		norep),
-    PROC(UNLOCK_RES,	res,		norep),
-    PROC(GRANTED_RES,	res,		norep),
+	[NLMPROC_TEST] = {
+		.p_proc		= NLMPROC_TEST,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_testres,
+		.p_arglen	= NLM4_testargs_sz,
+		.p_replen	= NLM4_testres_sz,
+		.p_statidx	= NLMPROC_TEST,
+		.p_name		= "TEST",
+	},
+	[NLMPROC_LOCK] = {
+		.p_proc		= NLMPROC_LOCK,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_lockargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_res,
+		.p_arglen	= NLM4_lockargs_sz,
+		.p_replen	= NLM4_res_sz,
+		.p_statidx	= NLMPROC_LOCK,
+		.p_name		= "LOCK",
+	},
+	[NLMPROC_CANCEL] = {
+		.p_proc		= NLMPROC_CANCEL,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_cancargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_res,
+		.p_arglen	= NLM4_cancargs_sz,
+		.p_replen	= NLM4_res_sz,
+		.p_statidx	= NLMPROC_CANCEL,
+		.p_name		= "CANCEL",
+	},
+	[NLMPROC_UNLOCK] = {
+		.p_proc		= NLMPROC_UNLOCK,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_unlockargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_res,
+		.p_arglen	= NLM4_unlockargs_sz,
+		.p_replen	= NLM4_res_sz,
+		.p_statidx	= NLMPROC_UNLOCK,
+		.p_name		= "UNLOCK",
+	},
+	[NLMPROC_GRANTED] = {
+		.p_proc		= NLMPROC_GRANTED,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_res,
+		.p_arglen	= NLM4_testargs_sz,
+		.p_replen	= NLM4_res_sz,
+		.p_statidx	= NLMPROC_GRANTED,
+		.p_name		= "GRANTED",
+	},
+	[NLMPROC_TEST_MSG] = {
+		.p_proc		= NLMPROC_TEST_MSG,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_testargs_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_TEST_MSG,
+		.p_name		= "TEST_MSG",
+	},
+	[NLMPROC_LOCK_MSG] = {
+		.p_proc		= NLMPROC_LOCK_MSG,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_lockargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_lockargs_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_LOCK_MSG,
+		.p_name		= "LOCK_MSG",
+	},
+	[NLMPROC_CANCEL_MSG] = {
+		.p_proc		= NLMPROC_CANCEL_MSG,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_cancargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_cancargs_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_CANCEL_MSG,
+		.p_name		= "CANCEL_MSG",
+	},
+	[NLMPROC_UNLOCK_MSG] = {
+		.p_proc		= NLMPROC_UNLOCK_MSG,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_unlockargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_unlockargs_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_UNLOCK_MSG,
+		.p_name		= "UNLOCK_MSG",
+	},
+	[NLMPROC_GRANTED_MSG] = {
+		.p_proc		= NLMPROC_GRANTED_MSG,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_testargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_testargs_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_GRANTED_MSG,
+		.p_name		= "GRANTED_MSG",
+	},
+	[NLMPROC_TEST_RES] = {
+		.p_proc		= NLMPROC_TEST_RES,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_testres,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_testres_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_TEST_RES,
+		.p_name		= "TEST_RES",
+	},
+	[NLMPROC_LOCK_RES] = {
+		.p_proc		= NLMPROC_LOCK_RES,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_res,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_res_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_LOCK_RES,
+		.p_name		= "LOCK_RES",
+	},
+	[NLMPROC_CANCEL_RES] = {
+		.p_proc		= NLMPROC_CANCEL_RES,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_res,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_res_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_CANCEL_RES,
+		.p_name		= "CANCEL_RES",
+	},
+	[NLMPROC_UNLOCK_RES] = {
+		.p_proc		= NLMPROC_UNLOCK_RES,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_res,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_res_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_UNLOCK_RES,
+		.p_name		= "UNLOCK_RES",
+	},
+	[NLMPROC_GRANTED_RES] = {
+		.p_proc		= NLMPROC_GRANTED_RES,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_res,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_norep,
+		.p_arglen	= NLM4_res_sz,
+		.p_replen	= NLM4_norep_sz,
+		.p_statidx	= NLMPROC_GRANTED_RES,
+		.p_name		= "GRANTED_RES",
+	},
 #ifdef NLMCLNT_SUPPORT_SHARES
-    PROC(SHARE,		shareargs,	shareres),
-    PROC(UNSHARE,	shareargs,	shareres),
-    PROC(NM_LOCK,	lockargs,	res),
-    PROC(FREE_ALL,	notify,		void),
+	[NLMPROC_SHARE] = {
+		.p_proc		= NLMPROC_SHARE,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_shareargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_shareres,
+		.p_arglen	= NLM4_shareargs_sz,
+		.p_replen	= NLM4_shareres_sz,
+		.p_statidx	= NLMPROC_SHARE,
+		.p_name		= "SHARE",
+	},
+	[NLMPROC_UNSHARE] = {
+		.p_proc		= NLMPROC_UNSHARE,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_shareargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_shareres,
+		.p_arglen	= NLM4_shareargs_sz,
+		.p_replen	= NLM4_shareres_sz,
+		.p_statidx	= NLMPROC_UNSHARE,
+		.p_name		= "UNSHARE",
+	},
+	[NLMPROC_NM_LOCK] = {
+		.p_proc		= NLMPROC_NM_LOCK,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_lockargs,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_res,
+		.p_arglen	= NLM4_lockargs_sz,
+		.p_replen	= NLM4_res_sz,
+		.p_statidx	= NLMPROC_NM_LOCK,
+		.p_name		= "NM_LOCK",
+	},
+	[NLMPROC_FREE_ALL] = {
+		.p_proc		= NLMPROC_FREE_ALL,
+		.p_encode	= (kxdrproc_t) nlm4clt_encode_notify,
+		.p_decode	= (kxdrproc_t) nlm4clt_decode_void,
+		.p_arglen	= NLM4_notify_sz,
+		.p_replen	= NLM4_void_sz,
+		.p_statidx	= NLMPROC_FREE_ALL,
+		.p_name		= "FREE_ALL",
+	},
 #endif
 };
 
-- 
1.6.0.3





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures
  2009-07-16  9:29 ` [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures Bian Naimeng
@ 2009-07-16 21:27   ` Trond Myklebust
       [not found]     ` <1247779647.12292.164.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Trond Myklebust @ 2009-07-16 21:27 UTC (permalink / raw)
  To: Bian Naimeng; +Cc: linux-nfs

On Thu, 2009-07-16 at 17:29 +0800, Bian Naimeng wrote:

> +	[NLMPROC_NSM_NOTIFY] = {
> +		.pc_func	= (svc_procfunc) nlmsvc_proc_sm_notify,
> +		.pc_decode	= (kxdrproc_t) nlmsvc_decode_reboot,
> +		.pc_encode	= (kxdrproc_t) nlmsvc_encode_void,
> +		.pc_release	= NULL,
> +		.pc_argsize	= sizeof(struct nlm_reboot),
> +		.pc_ressize	= sizeof(struct nlm_void),
> +		.pc_xdrressize	= 1,
> +	},
> +	NLMSVC_NONE_PROC,
> +	NLMSVC_NONE_PROC,
> +	NLMSVC_NONE_PROC,

Hmm... Does the C standard really allow you to mix C99 initialisers and
K&R initialisers in this manner?

Cheers
  Trond


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures
       [not found]     ` <1247779647.12292.164.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-07-17  3:33       ` Bian Naimeng
  0 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2009-07-17  3:33 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

> On Thu, 2009-07-16 at 17:29 +0800, Bian Naimeng wrote:
> 
>> +	[NLMPROC_NSM_NOTIFY] = {
>> +		.pc_func	= (svc_procfunc) nlmsvc_proc_sm_notify,
>> +		.pc_decode	= (kxdrproc_t) nlmsvc_decode_reboot,
>> +		.pc_encode	= (kxdrproc_t) nlmsvc_encode_void,
>> +		.pc_release	= NULL,
>> +		.pc_argsize	= sizeof(struct nlm_reboot),
>> +		.pc_ressize	= sizeof(struct nlm_void),
>> +		.pc_xdrressize	= 1,
>> +	},
>> +	NLMSVC_NONE_PROC,
>> +	NLMSVC_NONE_PROC,
>> +	NLMSVC_NONE_PROC,
> 
> Hmm... Does the C standard really allow you to mix C99 initialisers and
> K&R initialisers in this manner?
> 

  In this point, i think C99 is compatible with K&R. If it just support K&R
  but not C99, maybe " [subscript] = {}" should not work too.

  And i have tested with gcc, it can work with -std=c99 or -ansi option.

  And may i ask other questions.  

  Q: why we must initial these three procedures, is it in order to reply ok 
      to client?  

      But i have not finded that client will send these request.

      In RFC1813, we defined NLMPROC_NSM_NOTIFY = 16 and NLMPROC_SHARE = 20,
      but why not NLMPROC_SHARE = 17? 

      I try to find the reason, but failed. Would you answer my question or
      give me some suggestions. Thanks very much.
     
Best Regard
  Bian

> Cheers
>   Trond


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-07-17  3:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16  9:27 [PATCH 0/4] Kill PROC macro from NLM Bian Naimeng
2009-07-16  9:29 ` [PATCH 1/4] NLM: Kill PROC macro from NLMv1 and NLMv3 server procedures Bian Naimeng
2009-07-16 21:27   ` Trond Myklebust
     [not found]     ` <1247779647.12292.164.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-07-17  3:33       ` Bian Naimeng
2009-07-16  9:30 ` [PATCH 2/4]Kill PROC macro from NLMv4 " Bian Naimeng
2009-07-16  9:31 ` [PATCH 3/4] NLM: Kill PROC macro from NLMv1 and NLMv3 client procedures Bian Naimeng
2009-07-16  9:32 ` [PATCH 4/4]NLM: Kill PROC macro from NLMv4 " Bian Naimeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox