[SSI] openssi/kernel/include/cluster/ssi/cfs cfs_fs.h, 1.18, 1.19 cfs_fs_i.h, 1.17, 1.18 cfs_fs_sb.h, 1.10, 1.11 cfs_page.h, 1.9, 1.10 cfs_xdr.h, 1.7, 1.8 cfsd.h, 1.9, 1.10 cfsfh.h, 1.9, 1.10 cfstok.h, 1.15, 1.16

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-serv16224/kernel/include/cluster/ssi/cfs

Modified Files:
      Tag: OPENSSI-FC
	cfs_fs.h cfs_fs_i.h cfs_fs_sb.h cfs_page.h cfs_xdr.h cfsd.h 
	cfsfh.h cfstok.h 
Log Message:
Bug fixes and enhancements. See ChangeLog.


Index: cfsfh.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfsfh.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cfsfh.h	24 Mar 2009 04:26:29 -0000	1.9
+++ cfsfh.h	27 Oct 2009 03:18:30 -0000	1.10
@@ -165,6 +165,8 @@
 #ifdef CFS_EXPORT_OPS
 /* ssidev,size,type,ino + size of PFS file handle */
 #define CFS_FH_LEN(__fhp) (sizeof(__u32) * (4 + ((__u32 *)(__fhp))[1]))
+#define COPY_CFS_FH(_dest_fhp, _src_fhp) \
+	(memcpy((_dest_fhp), (_src_fhp), CFS_FH_LEN(_src_fhp)))
 #endif
 
 #endif /* _LINUX_CFSD_FH_H */

Index: cfs_fs.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_fs.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cfs_fs.h	24 Mar 2009 04:26:29 -0000	1.18
+++ cfs_fs.h	27 Oct 2009 03:18:30 -0000	1.19
@@ -44,8 +44,12 @@
  * reasonable for CFS over UDP.
  */
 /* SSI_XXX: ICS_MAX_OOL_DATA_SIZE 0x10000 */
-#define CFS_MAX_FILE_IO_SIZE    (0x10000)
-//#define CFS_MAX_FILE_IO_SIZE    (1048576U)
+#ifdef ICS_OOL_STRUCT_PAGES
+/* Lower PAGE_SHIFT bits reserved for page base */
+#define CFS_MAX_FILE_IO_SIZE    (0xFF000)
+#else
+#define CFS_MAX_FILE_IO_SIZE    (1048576U)
+#endif
 #define CFS_DEF_FILE_IO_SIZE    (4096U)
 #define CFS_MIN_FILE_IO_SIZE    (1024U)
 #else
@@ -129,11 +133,13 @@
  */
 #define CFS_RPC_SWAPFLAGS		(RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
 
+#ifdef SSI_NOTUSED
 /* Flags in the RPC client structure */
 #define CFS_CLNTF_BUFSIZE	0x0001	/* readdir buffer in longwords */
 
 #define CFS_RW_SYNC		0x0001	/* O_SYNC handling */
 #define CFS_RW_SWAP		0x0002	/* This is a swap request */
+#endif
 
 /*
  * When flushing a cluster of dirty pages, there can be different
@@ -176,6 +182,9 @@
 };
 extern int cfs_find_actor(struct inode *, void *);
 
+#ifdef KERNEL2616_53
+extern int cfs_sync_mapping(struct address_space *);
+#endif
 extern void cfs_zap_caches(struct inode *);
 extern struct inode *cfs_fhget(struct super_block *, struct cfsdirok *);
 extern struct inode *__cfs_fhget(struct super_block *, struct cfsdirok *,
@@ -210,6 +219,7 @@
 extern struct address_space_operations cfs_file_aops;
 extern struct lock_manager_operations cfs_lockm_operations;
 
+#ifdef SSI_EXNFS
 static __inline__ struct rpc_cred *
 cfs_file_cred(struct file *file)
 {
@@ -220,6 +230,7 @@
 #endif
 	return cred;
 }
+#endif
 
 /*
  * linux/fs/cfs/dir.c
@@ -241,6 +252,9 @@
 /*
  * linux/fs/cfs/locks.c
  */
+#ifdef CFS_FLOCK
+extern int do_cfs_lock(struct file_lock *);
+#endif
 #ifdef SSI_NOTUSED
 extern int cfs_lock(struct file *, int, struct file_lock *);
 #endif
@@ -342,8 +356,12 @@
 		mi_sb_state_t );
 extern int cfs_sb_tok_waitcount(struct super_block *);
 extern void cfs_rebuild_attach_cnodes(struct super_block *);
+#ifdef CFS_CLIST_LLIST
+extern int cfs_get_cnode_idx(dev_t);
+#else
 extern int cfs_get_cnode_idx(void);
 extern void cfs_free_cnode_idx(int);
+#endif
 #ifdef CFS_FH_TO_DENTRY_ANON
 extern struct dentry *__cfs_get_dentry(struct super_block *, cfhandle_t *);
 extern struct svrcfstok *cfs_fhtohp(cfhandle_t *);
@@ -384,12 +402,12 @@
  * cluster/ssi/cfs/pagelist.c
  */
 struct cfs_page;
-void cfs_clear_request(struct cfs_page *);
+extern void cfs_clear_request(struct cfs_page *);
 
 /*
  * cluster/ssi/cfs/svrcfs.c
  */
-void cfs_recheck_locks(struct super_block *);
+extern void cfs_rechecklocks_thread(void *);
 
 /*
  * cluster/ssi/cfs/cfs_ipcshm.c

Index: cfstok.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfstok.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cfstok.h	24 Mar 2009 04:26:29 -0000	1.15
+++ cfstok.h	27 Oct 2009 03:18:30 -0000	1.16
@@ -84,15 +84,20 @@
 #define	CFSTOK_INVAL_MODE	-1	/* Invalid Mode */
 
 
-#define	CFSTOK_NTOKS		1	/* Number of CFS tokens */
-/* Maximum tokens that can be sent via messages */
-#define	CFS_MSG_NTOKS		(CFSTOK_NTOKS + 1)
 #ifdef SSI_RANGE_TOKENS
 #define	CFSTOK_NRANGE		2	/* Number of CFS range tokens */
 #else
 #define	CFSTOK_NRANGE		0	/* Number of CFS range tokens */
 #endif
 
+#ifndef SSI_FULL_CFS_TOKENS
+#define	CFSTOK_NTOKS		1	/* Number of CFS tokens */
+#else
+#define	CFSTOK_NTOKS		(5 + CFSTOK_NRANGE)	/* Number of CFS tokens */
+#endif
+/* Maximum tokens that can be sent via messages */
+#define	CFS_MSG_NTOKS		(CFSTOK_NTOKS + 1)
+
 /*
  * CFS Token Classes
  */
@@ -133,7 +138,6 @@
 /*
  * CFS Non Range Tokens
  */
-#define CFSTOK_NORANGE		 ( CFSTOK_ATTR_MASK )
 #ifdef SSI_FULL_CFS_TOKENS
 #define CFSTOK_NORANGE		 ( CFSTOK_ATTR_MASK | \
 				 CFSTOK_MTIME_MASK | \
@@ -144,6 +148,8 @@
  * CFS Range Tokens (if this is defined then range token code is enabled)
  */
 #define CFSTOK_RANGE		(CFSTOK_ATOM_MASK | CFSTOK_DATA_MASK)
+#else
+#define CFSTOK_NORANGE		 ( CFSTOK_ATTR_MASK )
 #endif
 
 #ifdef SSI_CFS_FASTPATH
@@ -194,7 +200,10 @@
  */
 typedef enum cfstok_res {
 	CFSTOK_WOULDBLOCK,
-	CFSTOK_HELD
+	CFSTOK_HELD,
+#ifdef CFSTOK_INTR
+	CFSTOK_INTERRUPTED,
+#endif
 } cfstok_res_t;
 
 /*
@@ -346,10 +355,8 @@
 #ifdef RCU_CFSTOK_TABLE
 	struct hlist_node sct_hlist;
 	atomic_t sct_refcnt;
-#ifdef DEBUG
 	u_long sct_magic;
 #define CFSTOK_MAGIC	0xBB55699A
-#endif
 #else
 	struct svrcfstok *sct_next, *sct_prev;
 	unsigned int sct_refcnt;
@@ -439,19 +446,21 @@
 #define HASH_HOLD(_hp)		atomic_inc(&(_hp)->sct_refcnt)
 /*
  * Macros below are only for remotely held tokens.
- * Note: caller must hold sct_tcblock lock.
+ * Note: called with sct_tcblock locked.
  */
-#define SET_CFSTOK_MASK(_hp, _type) do {		\
-	if (!((_hp)->sct_tokmask & BITVAL(_type)))	\
+#define SET_CFSTOK_MASK(_hp, _type) do { \
+	if (!((_hp)->sct_tokmask & BITVAL(_type))) {	\
+		(_hp)->sct_tokmask |= BITVAL(_type);	\
 		HASH_HOLD(_hp);				\
-	(_hp)->sct_tokmask |= BITVAL(_type);		\
-} while (0)
+	} \
+} while(0)
 
-#define UNSET_CFSTOK_MASK(_hp, _type) do {		\
-	if ((_hp)->sct_tokmask & BITVAL(_type))		\
+#define UNSET_CFSTOK_MASK(_hp, _type) do { \
+	if ((_hp)->sct_tokmask & BITVAL(_type)) {	\
+		(_hp)->sct_tokmask &= ~(BITVAL(_type));	\
 		HASH_RELE(_hp);				\
-	(_hp)->sct_tokmask &= ~(BITVAL(_type));		\
-} while (0)
+	} \
+} while(0)
 
 #else
 /* SSI_XXX: Hold and release hash structure */
@@ -561,7 +570,7 @@
 		    agent_t agent, range_off_t start, range_off_t len);
 extern int svrcfstok_target( object_t *objp, agent_t agent);
 extern void svrcfstok_hold_obj(object_t *objp);
-nsc_nodelist_t svrcfstok_get_mholdlist(svrcfstok_t *hp);
+extern void svrcfstok_get_mholdlist(svrcfstok_t *hp, nsc_nodelist_t *nl);
 extern int svrcfstok_get_nodelist(svrcfstok_t *hp, int type, nsc_nodelist_t *nl,
 	int *modep);
 

Index: cfs_fs_i.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_fs_i.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cfs_fs_i.h	24 Mar 2009 04:26:29 -0000	1.17
+++ cfs_fs_i.h	27 Oct 2009 03:18:30 -0000	1.18
@@ -216,10 +216,8 @@
 /*
  * cnode flags (c_flags: 32 bits).
  */
-#ifdef CFS_UPDATE_ATTR_LOCKED
 #define	CLOCKED		0x00000001	/* cnode is in use */
 #define	CWANT		0x00000002	/* someone wants a wakeup */
-#endif
 #ifdef SSI_CFS_SKIP
 #define	CHIDDEN		0x00000004	/* Hidden due to node down */
 #define	CEOFDIR		0x00000008	/* EOF encountered on dir read */
@@ -267,7 +265,6 @@
 #define	ctofh(cnode)	(&((cnode)->c_fh))
 #define	itocfh(inode)	(ctofh(itoc(inode)))
 
-#ifdef CFS_UPDATE_ATTR_LOCKED
 /*
  * Lock and unlock cnodes.
  */
@@ -333,6 +330,5 @@
 		UNLOCK_COND_LOCK(&(cp)->c_statelock);\
 	NSC_SWAPUNLOCK(); \
 } while (0)
-#endif /* CFS_UPDATE_ATTR_LOCKED */
 
 #endif	/* !_SSI_CFS_CNODE_H */

Index: cfs_page.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_page.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cfs_page.h	24 Mar 2009 04:26:29 -0000	1.9
+++ cfs_page.h	27 Oct 2009 03:18:30 -0000	1.10
@@ -95,7 +95,9 @@
 extern	void cfs_clear_page_writeback(struct cfs_page *);
 #endif
 
+#ifndef CFS_CHARD_RACE_FIX
 extern	spinlock_t cfs_wreq_lock;
+#endif
 
 /*
  * Lock the page of an asynchronous request without incrementing the wb_count

Index: cfsd.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfsd.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cfsd.h	3 Feb 2009 06:18:13 -0000	1.9
+++ cfsd.h	27 Oct 2009 03:18:30 -0000	1.10
@@ -54,8 +54,13 @@
 int		cfsd_lookup(struct svrcfstok *, struct qstr *,
 			     struct svrcfstok **);
 int		cfsd_setattr(struct svrcfstok *, struct iattr *);
+#ifdef CFS_UMASK_FIX
+int		cfsd_create(struct svrcfstok *, struct qstr *, int,
+				int, int, dev_t, int, struct svrcfstok **);
+#else
 int		cfsd_create(struct svrcfstok *, struct qstr *,
 				int, int, dev_t, int, struct svrcfstok **);
+#endif
 #ifdef CFSD_OPEN
 int		cfsd_open(struct svrcfstok *, int, int, struct file **);
 #else
@@ -63,26 +68,15 @@
 #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_read(struct svrcfstok *, loff_t, struct kvec *, int,
+				unsigned long *);
 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
+				unsigned long, int);
 #else
+int		cfsd_read(struct svrcfstok *, loff_t, char *, unsigned long *);
 int		cfsd_write(struct svrcfstok *,
 				loff_t, char *, unsigned long, int);
-#endif
+#endif /* !CFS_PAGEVEC */
 int		cfsd_readlink(struct svrcfstok *, char *, int *);
 int		cfsd_symlink(struct svrcfstok *, struct qstr *, const char *,
 				 struct svrcfstok **);
@@ -98,12 +92,12 @@
 				loff_t, encode_dent_fn,
 				u32 *buffer, int *countp);
 int		cfsd_statfs(struct super_block *, struct kstatfs *);
-
 #ifdef NOTNEEDED
 int		cfsd_permission(struct svc_export *, struct dentry *, int);
 #endif
 void		cfsd_sync(struct svrcfstok *, loff_t, unsigned int);
 
+
 /* Check for dir entries '.' and '..' */
 #define isdotent(n, l)	(l < 3 && n[0] == '.' && (l == 1 || n[1] == '.'))
 

Index: cfs_xdr.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_xdr.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cfs_xdr.h	10 Oct 2008 08:10:33 -0000	1.7
+++ cfs_xdr.h	27 Oct 2009 03:18:30 -0000	1.8
@@ -5,29 +5,47 @@
 struct cfs_fh;
 
 #ifdef CFS_PAGEVEC
+#include <cluster/gen/cfs.h>
+
+#define CFS_PAGEVEC_SIZE        (8U)
+
 struct cfs_read_data {
+	struct inode *		inode;		/* Must be first */
 	int			flags;
-	struct inode *		inode;
 	struct list_head	pages;	/* Coalesced read requests */
+	struct page		**pagevec;
 	__u32			count;
 	loff_t			offset;
 	unsigned int		pgbase;
-	struct page *		page;
 	__u32			res_count;
+	struct cfsreadargs	args;
+/*
+	struct cfsrdresults 	res;
+*/
+	struct page             *page_array[CFS_PAGEVEC_SIZE];
 };
 
 struct cfs_write_data {
+	struct inode *		inode;		/* Must be first */
 	int			flags;
-	struct inode *		inode;
 	int			stable;
 	struct list_head	pages;		/* Coalesced requests we wish to flush */
+	struct page		**pagevec;
 	__u32			count;
 	loff_t			offset;		/* __u64 */
 	unsigned int		pgbase;
-	struct page *		page;
+#ifdef CFS_ASYNC_QUEUE
+	unsigned char		priority;
+#else
 	char			ics_prio;	/* FLUSH_HIGHPRI */
-};
 #endif
+	struct cfswriteargs	args;
+/*
+	struct cfswriteres 	res;
+*/
+	struct page             *page_array[CFS_PAGEVEC_SIZE];
+};
+#endif /* CFS_PAGEVEC */
 
 /*
  * Argument struct for decode_entry function
@@ -84,6 +102,9 @@
 #else
 	int	(*commit) (struct inode *, loff_t , unsigned int , int);
 #endif
+#ifdef CFS_IOCTL
+	int	(*ioctl) (struct file *, unsigned int, unsigned long);
+#endif
 };
 
 /*

Index: cfs_fs_sb.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfs_fs_sb.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cfs_fs_sb.h	24 Mar 2009 04:26:29 -0000	1.10
+++ cfs_fs_sb.h	27 Oct 2009 03:18:30 -0000	1.11
@@ -93,6 +93,9 @@
 	char *			hostname;	/* remote hostname */
 #endif
 	struct list_head	dirty_down,
+#ifdef CFS_COMMIT_DOWN
+				commit_down,
+#endif
 				read_down;
 #ifdef SSI_NOTUSED
 	struct list_head	lru_read,


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
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.