#ifndef USERLAND_FS_BEOS_FS_CACHE_PRIV_H
#define USERLAND_FS_BEOS_FS_CACHE_PRIV_H
#include "lock.h"
#ifndef _IMPEXP_KERNEL
#define _IMPEXP_KERNEL
#endif
typedef struct hash_ent {
int dev;
off_t bnum;
off_t hash_val;
void *data;
struct hash_ent *next;
} hash_ent;
typedef struct hash_table {
hash_ent **table;
int max;
int mask;
int num_elements;
} hash_table;
#define HT_DEFAULT_MAX 128
typedef struct cache_ent {
int dev;
off_t block_num;
int bsize;
volatile int flags;
void *data;
void *clone;
int lock;
void (*func)(off_t bnum, size_t num_blocks, void *arg);
off_t logged_bnum;
void *arg;
struct cache_ent *next,
*prev;
} cache_ent;
#define CE_NORMAL 0x0000
#define CE_DIRTY 0x0002
#define CE_BUSY 0x0004
typedef struct cache_ent_list {
cache_ent *lru;
cache_ent *mru;
} cache_ent_list;
typedef struct block_cache {
struct beos_lock lock;
int flags;
int cur_blocks;
int max_blocks;
hash_table ht;
cache_ent_list normal,
locked;
} block_cache;
#if 0
#define DC_WRITE_THROUGH 0x0001
#endif
#define ALLOW_WRITES 1
#define NO_WRITES 0
#endif