[SSI] openssi/kernel/include/cluster/ssi/token comtok.h, 1.6, 1.7 nscrtok.h, 1.5, 1.6 svrtok.h, 1.4, 1.5 token.h, 1.4, 1.5 token_proto.h, 1.4, 1.5

Roger Tsang <[email protected]>
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/token
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8553/include/cluster/ssi/token

Modified Files:
      Tag: OPENSSI-FC
	comtok.h nscrtok.h svrtok.h token.h token_proto.h 
Log Message:
Bug fixes and enhancements. (see ChangeLog)


Index: svrtok.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/token/svrtok.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svrtok.h	20 Oct 2004 03:23:36 -0000	1.4
+++ svrtok.h	3 Feb 2009 06:18:13 -0000	1.5
@@ -34,19 +34,30 @@
 #include "comtok.h"
 #endif /* ~__KERNEL__ */
 
-struct nrsvrfifo {
+#ifdef NRSVRFIFO_LINUX_LIST
+typedef struct list_head nrsvrfifo_t;
+
+#define	tok_wantptr(_tcbp)	(list_entry((&(_tcbp)->tok_reqfifo)->next, struct nrwant, wan_list))
+#define	_tok_wantptr(_tcbp)	(!list_empty(&(_tcbp)->tok_reqfifo))
+#else
+typedef struct nrsvrfifo {
 	struct nrwant *fifo_req_begin;	/* First fifo element */
 	struct nrwant *fifo_req_end;	/* Last fifo element */
-};
+} nrsvrfifo_t;
 
 #define	tok_wantptr	tok_reqfifo.fifo_req_begin
+#endif
 
 struct nrwant {
 	agent_t wan_agent;		/* Agent wanting range */
 	int wan_oldmode;		/* Original mode requested */
 	int wan_newmode;		/* Mode requested */
 	int wan_flags;			/* Type of request */
+#ifdef NRSVRFIFO_LINUX_LIST
+	struct list_head wan_list;
+#else
 	struct nrwant *wan_next;	/* for request chaining */
+#endif
 	struct nrsvrtcb *wan_tcbp;
 #ifdef	__KERNEL__
 	EVENT_T wan_done;
@@ -63,13 +74,17 @@
 	short nd_mode;
 	short nd_flags;
 	struct node_ent *nd_next;
-	struct nrsvrfifo nd_givefifo;	/* Pending givebacks */
+	nrsvrfifo_t nd_givefifo;	/* Pending givebacks */
 };
 
+#ifdef NRSVRFIFO_LINUX_LIST
+#define	_nd_giveback(_ptr)	(!list_empty(&(_ptr)->nd_givefifo))
+#else
 #define	nd_giveback	nd_givefifo.fifo_req_begin
+#endif
 
 typedef struct nrsvrtcb {
-	struct nrsvrfifo tok_reqfifo;	/* Pending requests */
+	nrsvrfifo_t tok_reqfifo;	/* Pending requests */
 	int tok_ndcount;		/* Number of 'node_ent's on list */
 	struct node_ent *tok_ndlist;	/* Node(s) which have token */
 } nrsvrtcb_t;

Index: token_proto.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/token/token_proto.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- token_proto.h	20 Oct 2004 03:23:36 -0000	1.4
+++ token_proto.h	3 Feb 2009 06:18:13 -0000	1.5
@@ -88,10 +88,16 @@
  *
  * SMP: Unlike other token entry points no locks are held on entry
  */
+#ifdef CFSTOK_INTR
+int
+tok_wait(
+	void *cookie);
+#else
 void
 tok_wait(
 	nrtcb_t *tcbp,
 	void *cookie);
+#endif
 
 int
 tok_waitcount(

Index: nscrtok.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/token/nscrtok.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- nscrtok.h	21 Oct 2004 23:40:51 -0000	1.5
+++ nscrtok.h	3 Feb 2009 06:18:13 -0000	1.6
@@ -157,7 +157,7 @@
  */
 
 #ifndef STATIC
-#define	STATIC	/**/
+#define	STATIC	static
 #endif
 
 #ifndef NULL

Index: token.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/token/token.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- token.h	20 Oct 2004 03:23:36 -0000	1.4
+++ token.h	3 Feb 2009 06:18:13 -0000	1.5
@@ -34,13 +34,17 @@
 #include <cluster/synch.h>
 #endif
 
-struct fifo {
+#ifdef TOKEN_FIFO_LINUX_LIST
+typedef struct list_head fifo_t;
+#else
+typedef struct fifo {
 	struct nrreq *fifo_req_begin;	/* First fifo element */
 	struct nrreq *fifo_req_end;	/* Last fifo element */
-};
+} fifo_t;
+#endif
 
 typedef struct nrtcb {
-	struct fifo tok_reqfifo;	/* Request list */
+	fifo_t tok_reqfifo;	/* Request list */
 	struct nrrevoke *tok_revptr;	/* Revoke structure */
 #define	HLD_COUNT_MAX	USHRT_MAX
 	unsigned short tok_hld_count;		/* Hold count */
@@ -52,10 +56,15 @@
 } mhtcb_t;
 
 /* Head of request list (this is the mode requested from server */
+#ifdef TOKEN_FIFO_LINUX_LIST
+#define	tok_request(_tcbp)	(list_entry((&(_tcbp)->tok_reqfifo)->next, struct nrreq, req_list))
+#define	_tok_request(_tcbp)	(!list_empty(&(_tcbp)->tok_reqfifo))
+#else
 #define	tok_request	tok_reqfifo.fifo_req_begin
+#endif
 
 struct nrrevoke {
-	struct fifo rev_reqfifo;	/* Pending holds */
+	fifo_t rev_reqfifo;	/* Pending holds */
 	int rev_oldmode;
 	int rev_newmode;
 	agent_t rev_agent;
@@ -63,17 +72,28 @@
 };
 
 struct nrreq {
+#ifdef TOKEN_FIFO_LINUX_LIST
+	struct list_head req_list;
+#else
 	struct nrreq *req_next;	/* Next structure */
+#endif
 	int req_mode;
 	agent_t req_agent;
 #ifdef	__KERNEL__
+#ifdef CFSTOK_INTR
+	INTR_EVENT_T req_done;
+#else
 	EVENT_T req_done;
+#endif
 #elif	SIMUL
 #define	req_done	req_thread	/*Grrr...*/
 	int	req_thread;
 #endif	/* SIMUL */
 	nrtcb_t *req_tcbp;	/* tcb which this request refers */
 	object_t *req_objp;	/* objp passed in for this request */
+#ifdef CFSTOK_INTR
+	long req_release;	/* whether to release token */
+#endif
 };
 
 /* Process calls into token code */
@@ -108,7 +128,9 @@
 extern int svrtok_nd_free_memory(int, unsigned int);
 extern int svrtok_wt_free_memory(int, unsigned int);
 extern int mhsvrtok_free_memory(int, unsigned int);
+#ifndef RCU_MSGSUP
 extern int msgsup_msg_free_memory(int, unsigned int);
 extern int msgsup_id_free_memory(int, unsigned int);
+#endif
 
 #endif /* !_SSI_TOKEN_TOKEN_H */

Index: comtok.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/token/comtok.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- comtok.h	10 Oct 2008 08:10:33 -0000	1.6
+++ comtok.h	3 Feb 2009 06:18:13 -0000	1.7
@@ -47,7 +47,7 @@
 
 #ifdef __linux__
 #ifndef STATIC
-#define	STATIC
+#define	STATIC	static
 #endif
 #endif /* __linux__ */
 
@@ -196,6 +196,23 @@
 #define	CLISTAT_NOTREVOKED	0x10
 #define	CLISTAT_REQPEND		0x20
 
+#ifdef TOKEN_FIFO_LINUX_LIST
+#define TOK_STAT(objp, tcbp, retp) do {\
+	if ((tcbp)->tok_revptr || _tok_request(tcbp)) {\
+		tok_stat((objp), (tcbp), (retp));\
+	} else {\
+		if ((tcbp)->tok_mode == TOK_NOMODE)\
+			(retp)->flags = CLISTAT_NOTPRESENT;\
+		else\
+			(retp)->flags = CLISTAT_PRESENT;\
+		(retp)->eff_mode = (tcbp)->tok_mode;\
+		(retp)->flags |= CLISTAT_NOTREVOKED;\
+		(retp)->mode = (tcbp)->tok_mode;\
+		(retp)->hold_count = (tcbp)->tok_hld_count;\
+		(retp)->uc_mode = (tcbp)->tok_mode;\
+	}\
+} while(0)
+#else
 #define TOK_STAT(objp, tcbp, retp) do {\
 	if ((tcbp)->tok_revptr || (tcbp)->tok_request) {\
 		tok_stat((objp), (tcbp), (retp));\
@@ -211,6 +228,7 @@
 		(retp)->uc_mode = (tcbp)->tok_mode;\
 	}\
 } while(0)
+#endif /* !TOKEN_FIFO_LINUX_LIST */
 
 #define TOK_STAT_RANGE(objp, tcbp, retp, s, l) do {\
 	if ((tcbp)->rtcb_first_chunk)\


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.