File onode_index.c

onode_index.c ------------- A casually demented B+Tree designed to stay balanced and be optimized for access from disk (and in-core cache)
$Id: onode_index.c,v 1.15 2003/10/20 07:18:11 stewart Exp $
(C)2003 Stewart Smith Distributed under the GNU Public License


Included Files


Preprocessor definitions

#define __GXX_ABI_VERSION 102

#define __SIZE_TYPE__

#define __PTRDIFF_TYPE__ int

#define __WCHAR_TYPE__

#define __WINT_TYPE__

#define __SCHAR_MAX__ 127

#define __SHRT_MAX__ 32767

#define __INT_MAX__ 2147483647

#define __LONG_MAX__ 2147483647L

#define __LONG_LONG_MAX__ 9223372036854775807LL

#define __WCHAR_MAX__ 2147483647

#define __CHAR_BIT__ 8

#define __FLT_EVAL_METHOD__ 0

#define __FLT_RADIX__ 2

#define __FLT_MANT_DIG__ 24

#define __FLT_DIG__ 6

#define __FLT_MIN_EXP__ -125

#define __FLT_MIN_10_EXP__ -37

#define __FLT_MAX_EXP__ 128

#define __FLT_MAX_10_EXP__ 38

#define __FLT_MAX__ 3.40282347e+38F

#define __FLT_MIN__ 1.17549435e-38F

#define __FLT_EPSILON__ 1.19209290e-7F

#define __FLT_DENORM_MIN__ 1.40129846e-45F

#define __DBL_MANT_DIG__ 53

#define __DBL_DIG__ 15

#define __DBL_MIN_EXP__ -1021

#define __DBL_MIN_10_EXP__ -307

#define __DBL_MAX_EXP__ 1024

#define __DBL_MAX_10_EXP__ 308

#define __DBL_MAX__ 1.7976931348623157e+308

#define __DBL_MIN__ 2.2250738585072014e-308

#define __DBL_EPSILON__ 2.2204460492503131e-16

#define __DBL_DENORM_MIN__ 4.9406564584124654e-324

#define __LDBL_MANT_DIG__ 53

#define __LDBL_DIG__ 15

#define __LDBL_MIN_EXP__ -1021

#define __LDBL_MIN_10_EXP__ -307

#define __LDBL_MAX_EXP__ 1024

#define __LDBL_MAX_10_EXP__ 308

#define __DECIMAL_DIG__ 17

#define __LDBL_MAX__ 1.7976931348623157e+308L

#define __LDBL_MIN__ 2.2250738585072014e-308L

#define __LDBL_EPSILON__ 2.2204460492503131e-16L

#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L

#define __REGISTER_PREFIX__

#define __USER_LABEL_PREFIX__

#define __VERSION__ "3.3.2 (Debian)"

#define __STDC_HOSTED__ 1

#define __NO_INLINE__ 1

#define __FINITE_MATH_ONLY__ 0

#define __CHAR_UNSIGNED__ 1

#define _ARCH_PPC 1

#define __BIG_ENDIAN__ 1

#define _BIG_ENDIAN 1

#define _CALL_SYSV 1

#define __PPC 1

#define __PPC__ 1

#define PPC 1

#define __ELF__ 1

#define __powerpc 1

#define __powerpc__ 1

#define powerpc 1

#define __GNUC__ 3

#define __GNUC_MINOR__ 3

#define __GNUC_PATCHLEVEL__ 2

#define __unix__ 1

#define __gnu_linux__ 1

#define __linux__ 1

#define unix 1

#define __unix 1

#define linux 1

#define __linux 1


External Variables

next_free
extern u64 next_free

Global Function onode_index_delete()

struct fcfs_onode_index* onode_index_delete ( struct fcfs_onode_index* index )
Prototyped in: onode_index.h
Calls: disk_freeblock(), free()

Global Function onode_index_free_node()

int onode_index_free_node ( struct fcfs_onode_index* index, struct fcfs_onode_index_node* node )
Prototyped in: onode_index.h
Calls: disk_getblock()disk_testkit.c
  disk_freeblock(), free()

Global Function onode_index_insert()

Insert an onode into an index

struct fcfs_block_run* onode_index_insert ( struct fcfs_onode_index* index, struct fcfs_onode1* onode )
onode->onode_num = ((~0ULL)/index->disk->sb->onindex_node_size) * (i+1);
ndex->disk->sb->onindex_next_id++;
printf("onode_index_insert\n");
memset(block->data,0,index->disk->bsize);
node = ;

Prototyped in: onode_index.h
Calls: disk_getblock()disk_testkit.c
  disk_newblock()disk_testkit.c
  onode_index_leaf_insert()onode_index.c
  onode_index_leaf_new()onode_index.c
  onode_index_new_root()onode_index.c
  onode_index_write_leaf()onode_index.c
  onode_index_write_node()onode_index.c
  onode_index_write_root()onode_index.c
  abort(), ag_allocate_block(), disk_freeblock(), disk_writeblock(), fcfs_write_sb(), fprintf(), memcpy(), random()
Called by: main()mkfs.c


Global Function onode_index_leaf_insert()

int onode_index_leaf_insert ( struct fcfs_disk* disk, struct fcfs_onode_index_leaf* leaf, u64 key, u64 value )
Prototyped in: onode_index.h
Calls: abort(), fprintf()
Called by: onode_index_insert()onode_index.c

Global Function onode_index_leaf_new()

printf("onode_index_leaf_new\n");

struct fcfs_onode_index_leaf* onode_index_leaf_new ( struct fcfs_onode_index* index, struct fcfs_onode_index_node* parent, int position )
Prototyped in: onode_index.h
Calls: disk_newblock()disk_testkit.c
  onode_index_write_leaf()onode_index.c
  onode_index_write_node()onode_index.c
  ag_allocate_block(), free()
Called by: onode_index_insert()onode_index.c


Global Function onode_index_lookup()

node = ;

struct fcfs_disk_block* onode_index_lookup ( struct fcfs_onode_index* index, struct fcfs_block_run* onode_br, u64 id )
Prototyped in: onode_index.h
Calls: disk_getblock()disk_testkit.c
  abort(), disk_freeblock(), fprintf()
Called by: main()fcfs_updateobj.c


Global Function onode_index_new()

struct fcfs_onode_index* onode_index_new ( struct fcfs_disk* disk )
Prototyped in: onode_index.h
Calls: abort(), fprintf(), malloc()
Called by: main()mkfs.c

Global Function onode_index_new_id()

u64 onode_index_new_id ( struct fcfs_onode_index* index )
Prototyped in: onode_index.h

Global Function onode_index_new_node()

The ever belated onode_index_new_node

struct fcfs_disk_block* onode_index_new_node ( struct fcfs_onode_index* index )
Prototyped in: onode_index.h
Calls: disk_newblock()disk_testkit.c
  abort(), ag_allocate_block(), fprintf()
Called by: onode_index_new_root()onode_index.c


Global Function onode_index_new_root()

Creates a new root node for an onode_index

int onode_index_new_root ( struct fcfs_onode_index* index )
Prototyped in: onode_index.h
Calls: onode_index_new_node()onode_index.c
  onode_index_write_root()onode_index.c
  fcfs_write_sb(), fprintf()
Called by: main()mkfs.c
  onode_index_insert()onode_index.c


Global Function onode_index_read()

struct fcfs_onode_index* onode_index_read ( struct fcfs_disk* disk )
Prototyped in: onode_index.h
Calls: disk_getblock()disk_testkit.c
  abort(), fprintf(), malloc()
Called by: main()fcfs_updateobj.c

Global Function onode_index_read_node()

struct fcfs_onode_index_node* onode_index_read_node ( struct fcfs_onode_index* index, u64 blocknr )
Prototyped in: onode_index.h
Calls: disk_getblock()disk_testkit.c

Global Function onode_index_write_leaf()

int onode_index_write_leaf ( struct fcfs_onode_index* index, struct fcfs_onode_index_leaf* leaf )
Prototyped in: onode_index.h
Calls: disk_getblock()disk_testkit.c
  disk_freeblock(), disk_writeblock()
Called by: onode_index_insert()onode_index.c
  onode_index_leaf_new()onode_index.c

Global Function onode_index_write_node()

int onode_index_write_node ( struct fcfs_onode_index* index, struct fcfs_onode_index_node* node )
Prototyped in: onode_index.h
Calls: disk_getblock()disk_testkit.c
  disk_freeblock(), disk_writeblock()
Called by: onode_index_insert()onode_index.c
  onode_index_leaf_new()onode_index.c
  onode_index_write_root()onode_index.c

Local Function onode_index_write_root()

Writes root back to disk

static inline int onode_index_write_root ( struct fcfs_onode_index* index )
Calls: onode_index_write_node()onode_index.c
Called by: onode_index_insert()onode_index.c
  onode_index_new_root()onode_index.c