1#ifndef _AFFS_FS_I
2#define _AFFS_FS_I
3
4#include <linux/a.out.h>
5
6// move this to linux/coda.h!!!
7#include <linux/time.h>
8
9#define AFFS_CACHE_SIZE		PAGE_SIZE
10//#define AFFS_CACHE_SIZE		(4*4)
11
12#define AFFS_MAX_PREALLOC	32
13#define AFFS_LC_SIZE		(AFFS_CACHE_SIZE/sizeof(u32)/2)
14#define AFFS_AC_SIZE		(AFFS_CACHE_SIZE/sizeof(struct affs_ext_key)/2)
15#define AFFS_AC_MASK		(AFFS_AC_SIZE-1)
16
17struct affs_ext_key {
18	u32	ext;				/* idx of the extended block */
19	u32	key;				/* block number */
20};
21
22/*
23 * affs fs inode data in memory
24 */
25struct affs_inode_info {
26	u32	 i_opencnt;
27	struct semaphore i_link_lock;		/* Protects internal inode access. */
28	struct semaphore i_ext_lock;		/* Protects internal inode access. */
29#define i_hash_lock i_ext_lock
30	u32	 i_blkcnt;			/* block count */
31	u32	 i_extcnt;			/* extended block count */
32	u32	*i_lc;				/* linear cache of extended blocks */
33	u32	 i_lc_size;
34	u32	 i_lc_shift;
35	u32	 i_lc_mask;
36	struct affs_ext_key *i_ac;		/* associative cache of extended blocks */
37	u32	 i_ext_last;			/* last accessed extended block */
38	struct buffer_head *i_ext_bh;		/* bh of last extended block */
39	unsigned long mmu_private;
40	u32	 i_protect;			/* unused attribute bits */
41	u32	 i_lastalloc;			/* last allocated block */
42	int	 i_pa_cnt;			/* number of preallocated blocks */
43};
44
45/* short cut to get to the affs specific inode data */
46#define AFFS_INODE	(&inode->u.affs_i)
47#define AFFS_DIR	(&dir->u.affs_i)
48
49#endif
50