File onode.c

onode.c -------
Code for manipulating FCFS O-Nodes and their forks. Maybe the Fork stuff should be in a seperate file, you're welcome to patch :)
$Id: onode.c,v 1.15 2003/10/20 07:18:11 stewart Exp $
(C)2003 Stewart Smith Distributed under the GNU Public License
Debugged with Beer(TM)


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


Global Function onode1_fork_getblock()

fprintf(stderr,"\n\n\t\t\tGETTING blocknr %llu from leaf.nr %d\n\n",blocknr,onode->forks.leaf.fork[forknr].data.space.leaf.nr);

struct fcfs_disk_block* onode1_fork_getblock ( struct fcfs_disk* disk, struct fcfs_onode1* onode, int forknr, u64 blocknr )
fprintf(stderr,"GOT BLOCK #%llu\n",block->blocknr);

Prototyped in: onode.h
Calls: disk_getblock()disk_testkit.c
  abort(), fprintf()
Called by: onode1_fork_read()onode.c
  onode1_fork_write()onode.c


Global Function onode1_fork_grow()

printf("onode_fork_grow\n");

int onode1_fork_grow ( struct fcfs_disk* disk, struct fcfs_block_run* onode_br, int forknr, u64 blocksnr )
onode->forks.leaf.fork[forknr].data.space.leaf.br[leafnr-1].len-1,
node_br->start,
isk_writeblock(blockz); // we don't write, as we're about
to anyway (after return)

Prototyped in: onode.h
Calls: disk_getblock()disk_testkit.c
  disk_newblock()disk_testkit.c
  abort(), ag_allocate_block(), disk_freeblock(), disk_writeblock(), fprintf(), free(), test_bit()
Called by: onode1_fork_new()onode.c
  onode1_fork_write()onode.c


Global Function onode1_fork_length()

u64 onode1_fork_length ( struct fcfs_onode1* onode, int forknr )
Prototyped in: onode.h
Called by: onode1_fork_write_versioned()onode.c

Global Function onode1_fork_new()

FIXME: the allow_internal is nasty hack, should be removed and made elegant

int onode1_fork_new ( struct fcfs_disk* disk, struct fcfs_block_run* onode_br, u64 fork_type, u64 content_length, void* content, int allow_internal )
Prototyped in: onode.h
Calls: disk_getblock()disk_testkit.c
  onode1_fork_grow()onode.c
  disk_freeblock(), disk_writeblock(), fprintf(), memcpy(), memset()
Called by: main()mkfs.c


Global Function onode1_fork_read()

u64 onode1_fork_read ( struct fcfs_disk* disk, struct fcfs_onode1* onode, int forknr, u64 pos, u64 content_length, void* content )
Prototyped in: onode.h
Calls: onode1_fork_getblock()onode.c
  abort(), disk_freeblock(), fprintf(), memcpy()
Called by: main()fcfs_readobj.c
  onode1_fork_write_versioned()onode.c

Global Function onode1_fork_write()

fprintf(stderr,"DEBUG---- content %llu done %llu\n",content_length,done_length);

int onode1_fork_write ( struct fcfs_disk* disk, struct fcfs_block_run* onode_br, int forknr, u64 pos, u64 content_length, void* content )
printf(stderr,"\n\n\t\t1\n\n");
printf(stderr,"\n\n\t\t2\n\n");
printf(stderr,"\n\n\t\t3\n\n");
fprintf(stderr,"^^^^^^^^^^^GETTING BLOCK = %llu\n",done_length/disk->bsize);
fprintf(stderr,"!!!!!!!!!!!!!!LOOPING WITH %llu, %llu\n",content_length,done_length);
fprintf(stderr,"\n\nDONE WRITE()\n\n");

Prototyped in: onode.h
Calls: disk_getblock()disk_testkit.c
  onode1_fork_getblock()onode.c
  onode1_fork_grow()onode.c
  abort(), disk_freeblock(), disk_writeblock(), fprintf(), memcpy()
Called by: main()mkfs.c
  onode1_fork_write_versioned()onode.c


Global Function onode1_fork_write_versioned()

int onode1_fork_write_versioned ( struct fcfs_disk* disk, struct fcfs_onode1* onode, struct fcfs_block_run* onode_br, int forknr, u64 pos, u64 content_length, void* content )
Prototyped in: onode.h
Calls: onode1_fork_length()onode.c
  onode1_fork_read()onode.c
  onode1_fork_write()onode.c
  abort(), fprintf(), malloc(), memset(), time()
Called by: main()fcfs_updateobj.c

Global Function onode1_free()

struct fcfs_onode1* onode1_free ( struct fcfs_onode1* onode )
Prototyped in: onode.h
Calls: free()

Global Function onode1_new()

struct fcfs_onode1* onode1_new ( struct fcfs_disk* disk )
Prototyped in: onode.h
Calls: abort(), fprintf(), malloc(), set_bit()
Called by: main()mkfs.c