Coda Distributed File System
Classes | Macros | Enumerations | Functions | Variables
rvmlib.h File Reference
#include "coda_string.h"
#include <rvm/rvm.h>
#include <unistd.h>
#include <stdlib.h>
#include <setjmp.h>
#include <lwp/lwp.h>
#include <rvm/rds.h>
#include <util.h>
#include <coda_tsa.h>
Include dependency graph for rvmlib.h:

Go to the source code of this file.

Classes

struct  rvm_perthread_t
 

Macros

#define rvmlib_begin_transaction(restore_mode)    _rvmlib_begin_transaction(restore_mode, __FILE__, __LINE__);
 
#define CODA_STACK_LENGTH   0x20000 /* 128 K */
 
#define LOGTHRESHOLD   50
 
#define RVMLIB_ASSERT(errmsg)
 
#define rvmlib_rec_malloc(size)   rvmlib_malloc(size, __FILE__, __LINE__)
 
#define rvmlib_rec_free(addr)   rvmlib_free(addr, __FILE__, __LINE__)
 
#define rvmlib_rec_strdup(size)   rvmlib_strdup(size, __FILE__, __LINE__)
 
#define RVMLIB_REC_OBJECT(object)   rvmlib_set_range(&(object), sizeof(object))
 
#define rvmlib_intrans()   rvmlib_check_trans(__FUNCTION__, __FILE__)
 
#define RVMLIB_MODIFY(object, newValue)
 

Enumerations

enum  rvm_type_t { UNSET = 0 , RAWIO = 1 , UFS = 2 , VM = 3 }
 

Functions

int rvmlib_in_transaction (void)
 
void rvmlib_abort (int) ENDS_TRANSACTION
 
void rvmlib_set_range (void *base, unsigned long size) REQUIRES_TRANSACTION
 
void rvmlib_modify_bytes (void *dest, const void *newval, int len) REQUIRES_TRANSACTION
 
char * rvmlib_strdup (const char *src, const char *file, int line) REQUIRES_TRANSACTION
 
void * rvmlib_malloc (unsigned long size, const char *file, int line) REQUIRES_TRANSACTION
 
void rvmlib_free (void *p, const char *file, int line) REQUIRES_TRANSACTION
 
void rvmlib_init_threaddata (rvm_perthread_t *rvmptt)
 
void rvmlib_set_thread_data (void *)
 
rvm_perthread_trvmlib_thread_data (void)
 
void _rvmlib_begin_transaction (int restore_mode, const char file[], int line) BEGINS_TRANSACTION
 
void rvmlib_end_transaction (int flush_mode, rvm_return_t *statusp) ENDS_TRANSACTION
 
void rvmlib_check_trans (char *where, char *file)
 

Variables

rvm_type_t RvmType
 
long rvm_no_yield
 
int optimizationson
 

Macro Definition Documentation

◆ CODA_STACK_LENGTH

#define CODA_STACK_LENGTH   0x20000 /* 128 K */

◆ LOGTHRESHOLD

#define LOGTHRESHOLD   50

◆ RVMLIB_ASSERT

#define RVMLIB_ASSERT (   errmsg)
Value:
do { \
fprintf(stderr, "RVMLIB_ASSERT: %s\n", errmsg); \
fflush(stderr); \
coda_assert("0", __FILE__, __LINE__); \
} while (0)
stderr
Definition: gensrvstats.py:48
#define __FILE__
Definition: odytypes.h:64
#define __LINE__
Definition: odytypes.h:68

◆ rvmlib_begin_transaction

#define rvmlib_begin_transaction (   restore_mode)     _rvmlib_begin_transaction(restore_mode, __FILE__, __LINE__);

◆ rvmlib_intrans

#define rvmlib_intrans ( )    rvmlib_check_trans(__FUNCTION__, __FILE__)

◆ RVMLIB_MODIFY

#define RVMLIB_MODIFY (   object,
  newValue 
)
Value:
do { \
rvm_perthread_t *_rvm_data = rvmlib_thread_data(); \
if (RvmType == VM) \
(object) = (newValue); \
else if (RvmType == RAWIO || \
RvmType == UFS) { /* is object a pointer? */ \
rvm_return_t ret = rvm_set_range(_rvm_data->tid, (char *)&object, \
sizeof(object)); \
if (ret != RVM_SUCCESS) \
printf("Modify Bytes error %s\n", rvm_return(ret)); \
CODA_ASSERT(ret == RVM_SUCCESS); \
(object) = (newValue); \
} else { \
CODA_ASSERT(0); \
} \
} while (0)
#define RVM_SUCCESS
Definition: rvm.h:95
char * rvm_return(rvm_return_t code)
Definition: rvm_utils.c:1084
rvm_return_t rvm_set_range(rvm_tid_t *tid, void *dest, rvm_length_t length)
Definition: rvm_trans.c:426
@ UFS
Definition: rvmlib.h:55
@ RAWIO
Definition: rvmlib.h:54
@ VM
Definition: rvmlib.h:56
rvm_perthread_t * rvmlib_thread_data(void)
Definition: rvmlib.c:48
rvm_type_t RvmType
Definition: rvmlib.c:34

◆ rvmlib_rec_free

#define rvmlib_rec_free (   addr)    rvmlib_free(addr, __FILE__, __LINE__)

◆ rvmlib_rec_malloc

#define rvmlib_rec_malloc (   size)    rvmlib_malloc(size, __FILE__, __LINE__)

◆ RVMLIB_REC_OBJECT

#define RVMLIB_REC_OBJECT (   object)    rvmlib_set_range(&(object), sizeof(object))

◆ rvmlib_rec_strdup

#define rvmlib_rec_strdup (   size)    rvmlib_strdup(size, __FILE__, __LINE__)

Enumeration Type Documentation

◆ rvm_type_t

enum rvm_type_t
Enumerator
UNSET 
RAWIO 
UFS 
VM 

Function Documentation

◆ _rvmlib_begin_transaction()

void _rvmlib_begin_transaction ( int  restore_mode,
const char  file[],
int  line 
)

◆ rvmlib_abort()

void rvmlib_abort ( int  status)

◆ rvmlib_check_trans()

void rvmlib_check_trans ( char *  where,
char *  file 
)

◆ rvmlib_end_transaction()

void rvmlib_end_transaction ( int  flush_mode,
rvm_return_t statusp 
)

◆ rvmlib_free()

void rvmlib_free ( void *  p,
const char *  file,
int  line 
)
inline

◆ rvmlib_in_transaction()

int rvmlib_in_transaction ( void  )

◆ rvmlib_init_threaddata()

void rvmlib_init_threaddata ( rvm_perthread_t rvmptt)

◆ rvmlib_malloc()

void * rvmlib_malloc ( unsigned long  size,
const char *  file,
int  line 
)

◆ rvmlib_modify_bytes()

void rvmlib_modify_bytes ( void *  dest,
const void *  newval,
int  len 
)

◆ rvmlib_set_range()

void rvmlib_set_range ( void *  base,
unsigned long  size 
)

◆ rvmlib_set_thread_data()

void rvmlib_set_thread_data ( void *  p)

◆ rvmlib_strdup()

char * rvmlib_strdup ( const char *  src,
const char *  file,
int  line 
)

◆ rvmlib_thread_data()

rvm_perthread_t * rvmlib_thread_data ( void  )

Variable Documentation

◆ optimizationson

int optimizationson
extern

◆ rvm_no_yield

long rvm_no_yield
extern

◆ RvmType

rvm_type_t RvmType
extern