[SSI] openssi/kernel/include/cluster/ssi/cfs cfs_clnt.h, 1.12, 1.13 cfs_fs_i.h, 1.15, 1.16 cfs_fs_sb.h, 1.8, 1.9 cfsd.h, 1.8, 1.9 cfstok.h, 1.12, 1.13

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

Modified Files:
      Tag: OPENSSI-FC
	cfs_clnt.h cfs_fs_i.h cfs_fs_sb.h cfsd.h cfstok.h 
Log Message:
Bug fixes and enhancements. (see ChangeLog)


Index: cfs_fs_sb.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_fs_sb.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cfs_fs_sb.h	10 Oct 2008 08:10:33 -0000	1.8
+++ cfs_fs_sb.h	3 Feb 2009 06:18:13 -0000	1.9
@@ -64,7 +64,9 @@
 #ifdef SSI_CFS_BCACHE
 	bcinfo_t	*mi_bcinfop;	/* backup cache information */
 #endif
+#ifdef SSI_CFS_SKIP
 	ATOMIC_INT_T	 mi_svrcfstoks; /* Number of server structures. */
+#endif
 
 #ifdef SSI_CFS_FROMNFS
 	struct rpc_clnt *	client;		/* RPC client handle */

Index: cfsd.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfsd.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cfsd.h	10 Oct 2008 08:10:33 -0000	1.8
+++ cfsd.h	3 Feb 2009 06:18:13 -0000	1.9
@@ -56,16 +56,29 @@
 int		cfsd_setattr(struct svrcfstok *, struct iattr *);
 int		cfsd_create(struct svrcfstok *, struct qstr *,
 				int, int, dev_t, int, struct svrcfstok **);
+#ifdef CFSD_OPEN
+int		cfsd_open(struct svrcfstok *, int, int, struct file **);
+#else
 int		cfsd_open(struct svrcfstok *, int, int, struct file *);
+#endif
 void		cfsd_close(struct file *);
 #ifdef CFS_PAGEVEC
+#ifdef CFS_PAGEVEC_BUFFER_READ
+int		cfsd_read(struct svrcfstok *, loff_t, struct kvec *, int, char *, unsigned long *);
+#else
 int		cfsd_read(struct svrcfstok *, loff_t, struct kvec *, int, unsigned long *);
+#endif
 #else
 int		cfsd_read(struct svrcfstok *, loff_t, char *, unsigned long *);
 #endif
 #ifdef CFS_PAGEVEC
+#ifdef CFS_PAGEVEC_BUFFER_WRITE
+int		cfsd_write(struct svrcfstok *, loff_t, struct kvec *, int,
+				char *, unsigned long, int);
+#else
 int		cfsd_write(struct svrcfstok *, loff_t, struct kvec *, int, unsigned long,
 				int);
+#endif
 #else
 int		cfsd_write(struct svrcfstok *,
 				loff_t, char *, unsigned long, int);

Index: cfs_fs_i.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_fs_i.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cfs_fs_i.h	10 Oct 2008 08:10:33 -0000	1.15
+++ cfs_fs_i.h	3 Feb 2009 06:18:13 -0000	1.16
@@ -144,7 +144,7 @@
 #ifdef SSI_RANGE_TOKENS
         range_tcb_t	c_rtokens[CFSTOK_NRANGE];
 #endif
-        struct ctokhold *c_hlist[CFSTOK_NTOKS];/* array of hold list ptr's */
+        hold_list_t	c_hlist[CFSTOK_NTOKS];/* array of hold list ptr's */
 	int		c_vn;		/* Dir version number */
 #ifdef SSI_CFS_POLICY
 	int		c_toktime;	/* Time of last activity */

Index: cfs_clnt.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_clnt.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cfs_clnt.h	21 Nov 2007 01:53:43 -0000	1.12
+++ cfs_clnt.h	3 Feb 2009 06:18:13 -0000	1.13
@@ -170,9 +170,6 @@
 	(((_mip)->mi_flags & (MI_CHARD)) != 0)
 
 /* Tune for performance */
-/* Base UIO allows up to ssize_t bytes per call.
- * CFS sends PAGE_SIZE iovec's	-Roger
- */
 #define CFS_MAX_IOVEC	UIO_FASTIOV
 
 #define	CFS_WRITE_MAXIOV	(8U)

Index: cfstok.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfstok.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cfstok.h	10 Oct 2008 08:10:33 -0000	1.12
+++ cfstok.h	3 Feb 2009 06:18:13 -0000	1.13
@@ -135,6 +135,7 @@
  */
 #define CFSTOK_NORANGE		 ( CFSTOK_ATTR_MASK )
 #ifdef SSI_FULL_CFS_TOKENS
+#define CFSTOK_NORANGE		 ( CFSTOK_ATTR_MASK | \
 				 CFSTOK_MTIME_MASK | \
 				 CFSTOK_ATIME_MASK | CFSTOK_SIZE_MASK  | \
 			 	 CFSTOK_MAP_MASK)
@@ -222,12 +223,20 @@
  * to detect dead lock during hold requests.
  */
 struct ctokhold {
+#ifdef CFSTOKHOLD_LINUX_LIST
+	struct list_head ctok_list;
+	struct cfstok ctok;	/* tokeninfo on type, start, and end */
+#else
+	struct	ctokhold *next, *prev;
 	struct	cfstok ctok;	/* tokeninfo on type, start, and end */
-	struct	ctokhold *prev;
-	struct	ctokhold *next;
+#endif
 };
 typedef struct	ctokhold	ctokhold_t;
+#ifdef CFSTOKHOLD_LINUX_LIST
+typedef struct list_head	hold_list_t;
+#else
 typedef struct  ctokhold 	*hold_list_t;
+#endif
 
 
 /*
@@ -251,8 +260,12 @@
 /*
  * initialize a hold list
  */
+#ifdef CFSTOKHOLD_LINUX_LIST
+#define	cfstok_hl_init(ptr)	INIT_LIST_HEAD(ptr)
+#else
 #define	cfstok_hl_init(phlist)\
-	do { *(phlist) = (struct ctokhold *)NULL; } while(FALSE)
+	do { *(phlist) = (hold_list_t)NULL; } while(FALSE)
+#endif
 
 /*
  * CFS Token Function Prototypes
@@ -262,20 +275,24 @@
 
 extern void cfstok_init(struct inode *ip);
 
+#ifdef SSI_NOTUSED
 enum cfstok_res cfstok_req_set(struct inode *, int, int, int,
 	range_off_t, range_off_t, struct ctokhold **);
+#endif
 
 enum cfstok_res cfstok_req(struct inode *, cfstokid_t which_tok,
 	int mode, int flags, range_off_t start, range_off_t len,
 	hold_list_t *phlist);
 
-extern int cfstok_req_m(int num_lock, cfs_lockop_t * ops, struct ctokhold **phlist);
+extern int cfstok_req_m(int num_lock, cfs_lockop_t * ops, hold_list_t *phlist);
 
 extern void cfstok_relse(struct inode *, int, int, range_off_t, range_off_t);
-extern void cfstok_relse_list(struct ctokhold **usrlist);
+extern void cfstok_relse_list(hold_list_t *usrlist);
 
 extern void cfstok_relsex(struct inode *, int, int, range_off_t, range_off_t, int, int);
+#ifdef SSI_NOTUSED
 extern void cfstok_relse_listx(struct ctokhold **usrlist, int, int);
+#endif
 
 /* Flags for cfstok_relsex() and cfstok_relse_listx() */
 #define	CFSTOK_DELAY	0x1
@@ -333,7 +350,16 @@
 #ifdef SSI_RANGE_TOKENS
 	range_tcb_t sct_rtcb[CFSTOK_NRANGE];
 #endif
+#ifdef RCU_CFSTOK_TABLE
+	struct rcu_head sct_rcu;
+	atomic_t sct_refcnt;
+#ifdef DEBUG
+	u_long sct_magic;
+#define CFSTOK_MAGIC	0xBB55699A
+#endif
+#else
 	unsigned int sct_refcnt;
+#endif
 	struct inode *sct_ip;		/* physical file system inode */
 	struct dentry *sct_dp;		/* Physcial dentry for ISDIR only */
 	struct file *sct_fp;		/* optional struct file for locking */
@@ -357,7 +383,11 @@
 #ifdef SKIP_NOTYET
 	struct contention *sct_cdata;
 #endif
+#ifdef RCU_CFSTOK_TABLE
+	struct hlist_node sct_hlist;
+#else
 	struct svrcfstok *sct_next, *sct_prev;
+#endif
 #ifdef SKIP_NOTYET
 	struct svrcfstok *sct_dinext, *sct_diprev;
 #endif
@@ -366,15 +396,18 @@
 	LOCK_T sct_tcblock;
 	RW_LOCK_T sct_objlock;		/* lock for this file or directory */
 	struct file_ra_state	sct_ra;
+#if !defined(CFSTOK_TABLE_LOCK_LOCK) || defined(RCU_CFSTOK_TABLE)
 	struct list_head sct_prlist;
+#endif
 };
 typedef struct svrcfstok svrcfstok_t;
 
-/* Flags bits for sct_flags */
 #ifdef SVRCFSTOK_SCT_FLAGS_NOLOCK
+/* Bits in sct_flags */
 #define CFS_NOTOKENCACHE	0
 #define CFS_DELAYUNLNK		1	/* file has been renamed */
 #else
+/* Bit values for sct_flags */
 #define	CFS_NOTOKENCACHE	0x1
 #define	CFS_VCOVERED		0x2
 #define	CFS_NOTREADY		0x4
@@ -389,7 +422,7 @@
 #define CFS_DSYNCING		0x200	/* DI: syncing pfs data */
 #define CFS_DSYNCWAITERS	0x400	/* DI: someone waiting for sync */
 #define CFS_DSYNCREADD		0x800	/* DI: override dequeue */
-#endif
+#endif /* !SVRCFSTOK_SCT_FLAGS_NOLOCK */
 
 #ifdef SSI_EXNFS
 /* Flags bits for sct_purgecache */
@@ -399,12 +432,30 @@
 #define CFS_PURGETYPE		0x8
 #endif
 
+#ifdef RCU_CFSTOK_TABLE
+#define HASH_HOLD(_hp)		atomic_inc(&(_hp)->sct_refcnt)
+/*
+ * Macros below are only for remotely held tokens.
+ * Note: caller must hold sct_tcblock lock.
+ */
+#define SET_CFSTOK_MASK(_hp, _type) do {		\
+	if (!((_hp)->sct_tokmask & BITVAL(_type)))	\
+		atomic_inc(&(_hp)->sct_refcnt);		\
+	(_hp)->sct_tokmask |= BITVAL(_type);		\
+} while (0)
+#define UNSET_CFSTOK_MASK(_hp, _type) do {		\
+	if ((_hp)->sct_tokmask & BITVAL(_type))		\
+		atomic_dec(&(_hp)->sct_refcnt);		\
+	(_hp)->sct_tokmask &= ~(BITVAL(_type));		\
+} while (0)
+#else
 /* SSI_XXX: Hold and release hash structure */
 #define	HASH_HOLD(hp) {\
 	LOCK_COND_LOCK(&(hp)->sct_statelock);\
 	(hp)->sct_refcnt++;\
 	UNLOCK_COND_LOCK(&(hp)->sct_statelock);\
 	}
+#endif /* !RCU_CFSTOK_TABLE */
 
 void svrtok_relse(struct svrcfstok *hp);
 
@@ -429,13 +480,21 @@
 
 /* CFS SERVER type defines */
 
+#ifdef SVRHOLD_LIST_LINUX_LIST
+typedef struct list_head svrhold_list_t;
+#else
 typedef struct {
 	struct hlist *head_front;
 	int head_count;
 } svrhold_list_t;
+#endif
 
 typedef struct hlist {
+#ifdef SVRHOLD_LIST_LINUX_LIST
+	struct list_head hl_list;
+#else
 	struct hlist *hl_next;
+#endif
 	struct cfs_nettok hl_tok;
 } hlist_t;
 
@@ -448,8 +507,10 @@
 #define	hl_seq	hl_tok.cntk_seq
 
 extern void hlist_init(svrhold_list_t *hlp);
+#ifndef SVRHOLD_LIST_LINUX_LIST
 extern hlist_t *hlist_extract( svrhold_list_t *hlp);
 extern u_int hlist_count(svrhold_list_t *hlp);
+#endif
 extern void hlist_free(hlist_t *item);
 
 extern struct inode *clifhtoip(cfhandle_t *fhp);


------------------------------------------------------------------------------
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.