4 #include <linux/a.out.h>
6 #include <asm/semaphore.h>
8 #define AFFS_CACHE_SIZE PAGE_SIZE
9 //#define AFFS_CACHE_SIZE (4*4)
11 #define AFFS_MAX_PREALLOC 32
12 #define AFFS_LC_SIZE (AFFS_CACHE_SIZE/sizeof(u32)/2)
13 #define AFFS_AC_SIZE (AFFS_CACHE_SIZE/sizeof(struct affs_ext_key)/2)
14 #define AFFS_AC_MASK (AFFS_AC_SIZE-1)
17 u32 ext
; /* idx of the extended block */
18 u32 key
; /* block number */
22 * affs fs inode data in memory
24 struct affs_inode_info
{
26 struct semaphore i_link_lock
; /* Protects internal inode access. */
27 struct semaphore i_ext_lock
; /* Protects internal inode access. */
28 #define i_hash_lock i_ext_lock
29 u32 i_blkcnt
; /* block count */
30 u32 i_extcnt
; /* extended block count */
31 u32
*i_lc
; /* linear cache of extended blocks */
35 struct affs_ext_key
*i_ac
; /* associative cache of extended blocks */
36 u32 i_ext_last
; /* last accessed extended block */
37 struct buffer_head
*i_ext_bh
; /* bh of last extended block */
39 u32 i_protect
; /* unused attribute bits */
40 u32 i_lastalloc
; /* last allocated block */
41 int i_pa_cnt
; /* number of preallocated blocks */
43 s32 i_original
; /* if != 0, this is the key of the original */
44 u32 i_data
[AFFS_MAX_PREALLOC
]; /* preallocated blocks */
45 int i_cache_users
; /* Cache cannot be freed while > 0 */
46 unsigned char i_hlink
; /* This is a fake */
48 s32 i_parent
; /* parent ino */
50 struct inode vfs_inode
;
53 /* short cut to get to the affs specific inode data */
54 static inline struct affs_inode_info
*AFFS_I(struct inode
*inode
)
56 return list_entry(inode
, struct affs_inode_info
, vfs_inode
);