cache.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted - a library for manipulating disk partitions
Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CACHE_H
#define _CACHE_H
#include "hfs.h"
/* CR => CACHE REF */
#define CR_NULL 0 /* reserved */
#define CR_PRIM_CAT 1
#define CR_PRIM_EXT 2
#define CR_PRIM_ATTR 3
#define CR_PRIM_ALLOC 4
#define CR_PRIM_START 5
#define CR_BTREE_CAT 6
#define CR_BTREE_ATTR 7
#define CR_BTREE_EXT_0 8
#define CR_BTREE_EXT_CAT 9
#define CR_BTREE_EXT_ATTR 11
#define CR_BTREE_EXT_ALLOC 12
/* 16 -> 31 || high order bit */ /* reserved */
/* tuning */
/* to get the index of the linked list */
file_number + CR_ADD_CST */
#define CR_ADD_CST 16
by this value to allocate next tables */
/* See DOC for an explaination of this structure */
/* Access read only from outside cache.c */
struct _HfsCPrivateExtent {
struct _HfsCPrivateExtent* next;
unsigned where : 5;
};
typedef struct _HfsCPrivateExtent HfsCPrivateExtent;
/* Internaly used by cache.c for custom memory managment only */
struct _HfsCPrivateCacheTable {
struct _HfsCPrivateCacheTable* next_cache;
unsigned int table_size;
unsigned int table_first_free;
/* first_elemt ? */
};
typedef struct _HfsCPrivateCacheTable HfsCPrivateCacheTable;
/* Internaly used by cache.c for custom memory managment
and cache handling only */
struct _HfsCPrivateCache {
unsigned int linked_ref_size;
unsigned int block_number;
unsigned int first_cachetable_size;
unsigned int needed_alloc_size;
};
typedef struct _HfsCPrivateCache HfsCPrivateCache;
void
static __inline__ unsigned int
{
return cache->needed_alloc_size;
}
#endif /* _CACHE_H */