patch-2.4.4 linux/include/linux/affs_fs_i.h

Next file: linux/include/linux/affs_fs_sb.h
Previous file: linux/include/linux/affs_fs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/include/linux/affs_fs_i.h linux/include/linux/affs_fs_i.h
@@ -2,47 +2,56 @@
 #define _AFFS_FS_I
 
 #include <linux/a.out.h>
-#include <linux/time.h>
 
-#define AFFS_MAX_PREALLOC	16	/* MUST be a power of 2 */
-#define AFFS_KCSIZE		73	/* Allows for 1 extension block at 512 byte-blocks */
+// move this to linux/coda.h!!!
+#include <linux/time.h>
 
-struct key_cache {
-	struct timeval	 kc_lru_time;	/* Last time this cache was used */
-	s32	 kc_first;		/* First cached key */
-	s32	 kc_last;		/* Last cached key */
-	s32	 kc_this_key;		/* Key of extension block this data block keys are from */
-	int	 kc_this_seq;		/* Sequence number of this extension block */
-	s32	 kc_next_key;		/* Key of next extension block */
-	s32	 kc_keys[AFFS_KCSIZE];	/* Key cache */
-};
+#define AFFS_CACHE_SIZE		PAGE_SIZE
+//#define AFFS_CACHE_SIZE		(4*4)
 
-#define EC_SIZE	(PAGE_SIZE - 4 * sizeof(struct key_cache) - 4) / 4
+#define AFFS_MAX_PREALLOC	32
+#define AFFS_LC_SIZE		(AFFS_CACHE_SIZE/sizeof(u32)/2)
+#define AFFS_AC_SIZE		(AFFS_CACHE_SIZE/sizeof(struct affs_ext_key)/2)
+#define AFFS_AC_MASK		(AFFS_AC_SIZE-1)
 
-struct ext_cache {
-	struct key_cache  kc[4];	/* The 4 key caches */
-	s32	 ec[EC_SIZE];		/* Keys of assorted extension blocks */
-	int	 max_ext;		/* Index of last known extension block */
+struct affs_ext_key {
+	u32	ext;				/* idx of the extended block */
+	u32	key;				/* block number */
 };
 
 /*
  * affs fs inode data in memory
  */
 struct affs_inode_info {
+	u32	 i_opencnt;
+	struct semaphore i_link_lock;		/* Protects internal inode access. */
+	struct semaphore i_ext_lock;		/* Protects internal inode access. */
+#define i_hash_lock i_ext_lock
+	u32	 i_blkcnt;			/* block count */
+	u32	 i_extcnt;			/* extended block count */
+	u32	*i_lc;				/* linear cache of extended blocks */
+	u32	 i_lc_size;
+	u32	 i_lc_shift;
+	u32	 i_lc_mask;
+	struct affs_ext_key *i_ac;		/* associative cache of extended blocks */
+	u32	 i_ext_last;			/* last accessed extended block */
+	struct buffer_head *i_ext_bh;		/* bh of last extended block */
 	unsigned long mmu_private;
 	u32	 i_protect;			/* unused attribute bits */
-	s32	 i_parent;			/* parent ino */
+	u32	 i_lastalloc;			/* last allocated block */
+	int	 i_pa_cnt;			/* number of preallocated blocks */
+#if 0
 	s32	 i_original;			/* if != 0, this is the key of the original */
-	s32	 i_data[AFFS_MAX_PREALLOC];	/* preallocated blocks */
-	struct ext_cache *i_ec;			/* Cache gets allocated dynamically */
+	u32	 i_data[AFFS_MAX_PREALLOC];	/* preallocated blocks */
 	int	 i_cache_users;			/* Cache cannot be freed while > 0 */
-	int	 i_lastblock;			/* last allocated block */
-	short	 i_pa_cnt;			/* number of preallocated blocks */
-	short	 i_pa_next;			/* Index of next block in i_data[] */
-	short	 i_pa_last;			/* Index of next free slot in i_data[] */
-	short	 i_zone;			/* write zone */
 	unsigned char i_hlink;			/* This is a fake */
 	unsigned char i_pad;
+	s32	 i_parent;			/* parent ino */
+#endif
 };
+
+/* short cut to get to the affs specific inode data */
+#define AFFS_INODE	(&inode->u.affs_i)
+#define AFFS_DIR	(&dir->u.affs_i)
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)