BurstFS_Server/burstfs_metadata.c
int meta_init_indices() {

	int i;

	/*init index metadata*/
	burstfs_keys = (burstfs_key_t **)malloc(MAX_META_PER_SEND\
			* sizeof(burstfs_key_t *));

	burstfs_vals = (burstfs_val_t **)malloc(MAX_META_PER_SEND\
				* sizeof(burstfs_val_t *));

	for (i = 0; i < MAX_META_PER_SEND; i++) {
		burstfs_keys[i] = (burstfs_key_t *)malloc(sizeof(burstfs_key_t));

		if (!burstfs_keys[i])
			return ULFS_ERROR_NOMEM;
		memset(burstfs_keys[i], 0, sizeof(burstfs_key_t));
	}

	for (i = 0; i < MAX_META_PER_SEND; i++) {
		burstfs_vals[i] = (burstfs_val_t *)malloc(sizeof(burstfs_val_t));
		if (!burstfs_vals[i])
			return ULFS_ERROR_NOMEM;;
		memset(burstfs_vals[i], 0, sizeof(burstfs_val_t));
	}

	/*init attribute metadata*/
	fattr_keys = (fattr_key_t **)malloc(MAX_FILE_CNT_PER_NODE \
			* sizeof(fattr_key_t *));

	fattr_vals = (fattr_val_t **)malloc(MAX_FILE_CNT_PER_NODE \
				* sizeof(fattr_val_t *));

	for (i = 0; i < MAX_FILE_CNT_PER_NODE; i++) {
		fattr_keys[i] = (fattr_key_t *)malloc(sizeof(fattr_key_t));

		if (!fattr_keys[i])
			return ULFS_ERROR_NOMEM;
		memset(fattr_keys[i], 0, sizeof(fattr_key_t));
	}

	for (i = 0; i < MAX_FILE_CNT_PER_NODE; i++) {
		fattr_vals[i] = (fattr_val_t *)malloc(sizeof(fattr_val_t));
		if (!fattr_vals[i])
			return ULFS_ERROR_NOMEM;;
		memset(fattr_vals[i], 0, sizeof(fattr_val_t));
	}

	return 0;

}
/**
* initialize the key and value list used to
* put/get key-value pairs
* ToDo: split once the number of metadata exceeds MAX_META_PER_SEND
*/
initialize the key and value list used to
put/get key-value pairs
ToDo: split once the number of metadata exceeds MAX_META_PER_SEND
initialize the key and value list used to put / get key - value pairs ToDo : split once the number of metadata exceeds MAX_META_PER_SEND
int meta_init_indices() {
	int i;
	burstfs_keys = (burstfs_key_t **)malloc(MAX_META_PER_SEND\
			* sizeof(burstfs_key_t *));
	burstfs_vals = (burstfs_val_t **)malloc(MAX_META_PER_SEND\
				* sizeof(burstfs_val_t *));
	for (i = 0; i < MAX_META_PER_SEND; i++) {
		burstfs_keys[i] = (burstfs_key_t *)malloc(sizeof(burstfs_key_t));
		if (!burstfs_keys[i])
			return ULFS_ERROR_NOMEM;
		memset(burstfs_keys[i], 0, sizeof(burstfs_key_t));
	}
	for (i = 0; i < MAX_META_PER_SEND; i++) {
		burstfs_vals[i] = (burstfs_val_t *)malloc(sizeof(burstfs_val_t));
		if (!burstfs_vals[i])
			return ULFS_ERROR_NOMEM;;
		memset(burstfs_vals[i], 0, sizeof(burstfs_val_t));
	}
	fattr_keys = (fattr_key_t **)malloc(MAX_FILE_CNT_PER_NODE \
			* sizeof(fattr_key_t *));
	fattr_vals = (fattr_val_t **)malloc(MAX_FILE_CNT_PER_NODE \
				* sizeof(fattr_val_t *));
	for (i = 0; i < MAX_FILE_CNT_PER_NODE; i++) {
		fattr_keys[i] = (fattr_key_t *)malloc(sizeof(fattr_key_t));
		if (!fattr_keys[i])
			return ULFS_ERROR_NOMEM;
		memset(fattr_keys[i], 0, sizeof(fattr_key_t));
	}
	for (i = 0; i < MAX_FILE_CNT_PER_NODE; i++) {
		fattr_vals[i] = (fattr_val_t *)malloc(sizeof(fattr_val_t));
		if (!fattr_vals[i])
			return ULFS_ERROR_NOMEM;;
		memset(fattr_vals[i], 0, sizeof(fattr_val_t));
	}
	return 0;
}
int meta_init_indices ( ) { int i ; burstfs_keys = ( burstfs_key_t * * ) malloc ( MAX_META_PER_SEND * sizeof ( burstfs_key_t * ) ) ; burstfs_vals = ( burstfs_val_t * * ) malloc ( MAX_META_PER_SEND * sizeof ( burstfs_val_t * ) ) ; for ( i = 0 ; i < MAX_META_PER_SEND ; i ++ ) { burstfs_keys [ i ] = ( burstfs_key_t * ) malloc ( sizeof ( burstfs_key_t ) ) ; if ( ! burstfs_keys [ i ] ) return ULFS_ERROR_NOMEM ; memset ( burstfs_keys [ i ] , 0 , sizeof ( burstfs_key_t ) ) ; } for ( i = 0 ; i < MAX_META_PER_SEND ; i ++ ) { burstfs_vals [ i ] = ( burstfs_val_t * ) malloc ( sizeof ( burstfs_val_t ) ) ; if ( ! burstfs_vals [ i ] ) return ULFS_ERROR_NOMEM ; ; memset ( burstfs_vals [ i ] , 0 , sizeof ( burstfs_val_t ) ) ; } fattr_keys = ( fattr_key_t * * ) malloc ( MAX_FILE_CNT_PER_NODE * sizeof ( fattr_key_t * ) ) ; fattr_vals = ( fattr_val_t * * ) malloc ( MAX_FILE_CNT_PER_NODE * sizeof ( fattr_val_t * ) ) ; for ( i = 0 ; i < MAX_FILE_CNT_PER_NODE ; i ++ ) { fattr_keys [ i ] = ( fattr_key_t * ) malloc ( sizeof ( fattr_key_t ) ) ; if ( ! fattr_keys [ i ] ) return ULFS_ERROR_NOMEM ; memset ( fattr_keys [ i ] , 0 , sizeof ( fattr_key_t ) ) ; } for ( i = 0 ; i < MAX_FILE_CNT_PER_NODE ; i ++ ) { fattr_vals [ i ] = ( fattr_val_t * ) malloc ( sizeof ( fattr_val_t ) ) ; if ( ! fattr_vals [ i ] ) return ULFS_ERROR_NOMEM ; ; memset ( fattr_vals [ i ] , 0 , sizeof ( fattr_val_t ) ) ; } return 0 ; }
initialize the key and value list used to
put/get key-value pairs
ToDo: split once the number of metadata exceeds MAX_META_PER_SEND
initialize the key and value list used to put / get key - value pairs ToDo : split once the number of metadata exceeds MAX_META_PER_SEND
/*init index metadata*/ /*init attribute metadata*/