Distributed Hash Table File System for Linux








magma_flare_t Struct Reference

#include <magma_flare_types.h>


Data Fields

pthread_mutex_t mutex
struct magma_flare * parent
struct magma_flare * left
struct magma_flare * right
int load
char * path
unsigned char * binhash
char * hash
char * xlated
char * parent_path
unsigned char * parent_binhash
char * parent_hash
char * parent_xlated
char * contents
char * metadata
int locked
int in_use
int destroyable
struct stat st
int is_cached
int is_upcasted
time_t timestamp
pthread_rwlock_t rwlock
union {
   magma_flare_dir_t *   dir
   magma_flare_file_t *   file
   magma_flare_blockdev_t *   blockdev
   magma_flare_chardev_t *   chardev
   magma_flare_symlink_t *   symlink
   magma_flare_fifo_t *   fifo
item

Detailed Description

magma_flare_t is the base type of all Flare Objects. Each flare is of this kind, and is later specialized (casted) to one of supported types to be fully usefull.

each flare share the same basic structure (magma_flare_t). that structure has an internal pointer, called "item", which is the way flare system uses to "cast" a generic flare into a specific one rappresenting a file or a directory or a symlink or a (char/block) device or a FIFO.

"item" field is implemented as a union of N different pointers (where N is the number of different flare types known by the flare system), to grant correctness of data type. so, if a flare is casted as a directory flare, it's flare->item.dir field will be allocated to hold a magma_flare_dir_t* structure.

after that casting operation succeeded, field "is_upcasted" will be placed to 1.


Field Documentation

pthread_mutex_t magma_flare_t::mutex

lock for this flare inside b-tree cache

struct magma_flare* magma_flare_t::parent [read]

parent flare inside the cache

struct magma_flare* magma_flare_t::left [read]

left child inside the cache

struct magma_flare* magma_flare_t::right [read]

right child inside the cache

load of this node (for b-tree reordering)

flare path

unsigned char* magma_flare_t::binhash

flare path hashed to binary rappresentation

flare path hashed

translated (relocated) path

flare parent directory path

flare parent directory path hashed to binary rappresentation

flare parent directory path hashed

parent directory translated (relocated) path

contents file path

metadata file path

file locking mechanism -- can be enhanced -- still totally unused!

usage counter

is destroyable? can be garbage collected?

struct stat magma_flare_t::st [read]

stat buffer

has been already cached

has been upcasted?

usage timestamp

pthread_rwlock_t magma_flare_t::rwlock

readwrite lock

holds a magma_flare_dir_t object if this flare is a directory

holds a magma_flare_file_t object if this flare is a regular file

holds a magma_flare_blockdev_t object if this flare is a block device

holds a magma_flare_chardev_t object if this flare is a character device

holds a magma_flare_symlink_t object if this flare is a symbolic link

holds a magma_flare_fifo_t object if this flare is a FIFO pipe

union { ... } magma_flare_t::item

additional informations for item hosted by this flare


The documentation for this struct was generated from the following file:
This file last modified Wednesday, 09-Jan-2008 20:02:39 CET