BurstFS_Server/burstfs_cmd_handler.c
int open_log_file(app_config_t *app_config,\
		int app_id, int sock_id) {
	int client_side_id = app_config->client_ranks[sock_id];
	char path[GEN_STR_LEN] = {0};
	sprintf(path, "%s/spill_%d_%d.log",\
			app_config->external_spill_dir, app_id, client_side_id);
	app_config->spill_log_fds[client_side_id] = open(path, O_RDONLY, 0666);
/*	LOG(LOG_DBG, "openning log file %s, client_side_id:%d\n",\
			path, client_side_id);
*/
	strcpy(app_config->spill_log_name[client_side_id], path);
    if (app_config->spill_log_fds[client_side_id] < 0) {
    	printf("rank:%d, openning file %s failure\n", glb_rank, path);
    	fflush(stdout);
    	return ULFS_ERROR_FILE;
	}

    sprintf(path, "%s/spill_index_%d_%d.log",\
    		app_config->external_spill_dir, app_id, client_side_id);
	app_config->spill_index_log_fds[client_side_id] =\
			open(path, O_RDONLY, 0666);
/*
	LOG(LOG_DBG, "openning index log file %s, client_side_id:%d\n",\
			path, client_side_id);
*/
	strcpy(app_config->spill_index_log_name[client_side_id], path);
    if (app_config->spill_index_log_fds[client_side_id] < 0) {
    	printf("rank:%d, openning index file %s failure\n", glb_rank, path);
    	fflush(stdout);
    	return ULFS_ERROR_FILE;
	}

	return ULFS_SUCCESS;
}
/**
* open spilled log file, spilled log file
* is created once the client-side shared superblock
* overflows.
* @param app_config: application information
* @param app_id: the server-side application id
* @param sock_id: position in poll_set in burstfs_sock.h
* @return success/error code
*/
open spilled log file, spilled log file
is created once the client-side shared superblock
overflows.
open spilled log file spilled log file is created once the client - side shared superblock overflows .
int open_log_file(app_config_t *app_config,\
		int app_id, int sock_id) {
	int client_side_id = app_config->client_ranks[sock_id];
	char path[GEN_STR_LEN] = {0};
	sprintf(path, "%s/spill_%d_%d.log",\
			app_config->external_spill_dir, app_id, client_side_id);
	app_config->spill_log_fds[client_side_id] = open(path, O_RDONLY, 0666);
	strcpy(app_config->spill_log_name[client_side_id], path);
    if (app_config->spill_log_fds[client_side_id] < 0) {
    	printf("rank:%d, openning file %s failure\n", glb_rank, path);
    	fflush(stdout);
    	return ULFS_ERROR_FILE;
	}
    sprintf(path, "%s/spill_index_%d_%d.log",\
    		app_config->external_spill_dir, app_id, client_side_id);
	app_config->spill_index_log_fds[client_side_id] =\
			open(path, O_RDONLY, 0666);
	strcpy(app_config->spill_index_log_name[client_side_id], path);
    if (app_config->spill_index_log_fds[client_side_id] < 0) {
    	printf("rank:%d, openning index file %s failure\n", glb_rank, path);
    	fflush(stdout);
    	return ULFS_ERROR_FILE;
	}
	return ULFS_SUCCESS;
}
int open_log_file ( app_config_t * app_config , int app_id , int sock_id ) { int client_side_id = app_config -> client_ranks [ sock_id ] ; char path [ GEN_STR_LEN ] = { 0 } ; sprintf ( path , " " , app_config -> external_spill_dir , app_id , client_side_id ) ; app_config -> spill_log_fds [ client_side_id ] = open ( path , O_RDONLY , 0666 ) ; strcpy ( app_config -> spill_log_name [ client_side_id ] , path ) ; if ( app_config -> spill_log_fds [ client_side_id ] < 0 ) { printf ( " \n " , glb_rank , path ) ; fflush ( stdout ) ; return ULFS_ERROR_FILE ; } sprintf ( path , " " , app_config -> external_spill_dir , app_id , client_side_id ) ; app_config -> spill_index_log_fds [ client_side_id ] = open ( path , O_RDONLY , 0666 ) ; strcpy ( app_config -> spill_index_log_name [ client_side_id ] , path ) ; if ( app_config -> spill_index_log_fds [ client_side_id ] < 0 ) { printf ( " \n " , glb_rank , path ) ; fflush ( stdout ) ; return ULFS_ERROR_FILE ; } return ULFS_SUCCESS ; }
open spilled log file, spilled log file
is created once the client-side shared superblock
overflows.
open spilled log file spilled log file is created once the client - side shared superblock overflows .
/*	LOG(LOG_DBG, "openning log file %s, client_side_id:%d\n",\
			path, client_side_id);
*/ /*
	LOG(LOG_DBG, "openning index log file %s, client_side_id:%d\n",\
			path, client_side_id);
*/