@@ -390,12 +390,12 @@ PDC_Server_register_obj_region_by_pointer(data_server_region_t **new_obj_reg_ptr
390390 if (new_obj_reg == NULL ) {
391391 ret_value = FAIL ;
392392 }
393- new_obj_reg -> obj_id = obj_id ;
394- new_obj_reg -> region_lock_head = NULL ;
395- new_obj_reg -> region_buf_map_head = NULL ;
396- new_obj_reg -> region_lock_request_head = NULL ;
397- new_obj_reg -> region_storage_head = NULL ;
398- new_obj_reg -> close_flag = close_flag ;
393+ new_obj_reg -> obj_id = obj_id ;
394+ new_obj_reg -> region_lock_head = NULL ;
395+ new_obj_reg -> region_buf_map_head = NULL ;
396+ new_obj_reg -> region_lock_request_head = NULL ;
397+ new_obj_reg -> region_storage_head = NULL ;
398+ new_obj_reg -> close_flag = close_flag ;
399399 new_obj_reg -> storage_location [region_index ] = (char * )calloc (ADDR_MAX , sizeof (char ));
400400 new_obj_reg -> region_size_elements = UNITIALIZED_DATA_SERVER_REGION_SIZE_ELEMENTS ;
401401 new_obj_reg -> fd =
@@ -409,17 +409,18 @@ PDC_Server_register_obj_region_by_pointer(data_server_region_t **new_obj_reg_ptr
409409 }
410410 else {
411411 LOG_JUST_PRINT ("3\n" );
412- if (new_obj_reg -> storage_location [region_index ] == NULL ) {
412+ if (new_obj_reg -> storage_location [region_index ] == NULL ) {
413413 new_obj_reg -> storage_location [region_index ] = (char * )calloc (ADDR_MAX , sizeof (char ));
414414 }
415- if (new_obj_reg -> storage_location [region_index ][0 ] == 0 ) {
415+ if (new_obj_reg -> storage_location [region_index ][0 ] == 0 ) {
416416 fill_storage_path (new_obj_reg -> storage_location [region_index ], obj_id , region_index );
417417 }
418418
419419 if (new_obj_reg -> fd < 0 ) {
420420 LOG_JUST_PRINT ("4\n" );
421421 new_obj_reg -> close_flag = close_flag ;
422- new_obj_reg -> fd = server_open_storage (new_obj_reg -> storage_location [region_index ], obj_id , region_index );
422+ new_obj_reg -> fd =
423+ server_open_storage (new_obj_reg -> storage_location [region_index ], obj_id , region_index );
423424
424425 if (new_obj_reg -> fd < 0 ) {
425426 LOG_ERROR ("Failed to open file %s\n" , new_obj_reg -> storage_location [region_index ]);
@@ -4514,7 +4515,9 @@ typedef enum {
45144515 REGION_PER_FILE_IO_TYPE_WRITE ,
45154516} REGION_PER_FILE_IO_TYPE ;
45164517
4517- static int is_fd_valid (int fd ) {
4518+ static int
4519+ is_fd_valid (int fd )
4520+ {
45184521 return fcntl (fd , F_GETFD ) != -1 || errno != EBADF ;
45194522}
45204523
@@ -4591,7 +4594,7 @@ PDC_Server_data_io_from_region_per_file(uint64_t obj_id, struct pdc_region_info
45914594 // Register the initial region
45924595 PDC_Server_register_obj_region_by_pointer (& region , obj_id , 0 , region_index );
45934596
4594- if (region == NULL ) {
4597+ if (region == NULL ) {
45954598 PGOTO_ERROR (FAIL , "Failed to register obj_region by pointer" );
45964599 }
45974600
@@ -4606,7 +4609,7 @@ PDC_Server_data_io_from_region_per_file(uint64_t obj_id, struct pdc_region_info
46064609 }
46074610
46084611 for (uint64_t count = 0 ; count < num_elements ; count ++ ) {
4609- //printf("\tcur count: %d\n", count);
4612+ // printf("\tcur count: %d\n", count);
46104613 // Compute flat index
46114614 uint64_t flat_index = 0 ;
46124615 uint64_t temp_stride = 1 ;
@@ -4629,7 +4632,7 @@ PDC_Server_data_io_from_region_per_file(uint64_t obj_id, struct pdc_region_info
46294632 region_index = new_region_index ;
46304633 PDC_Server_register_obj_region_by_pointer (& region , obj_id , 0 , region_index );
46314634
4632- if (region == NULL ) {
4635+ if (region == NULL ) {
46334636 PGOTO_ERROR (FAIL , "Failed to register obj_region by pointer" );
46344637 }
46354638
@@ -4654,9 +4657,10 @@ PDC_Server_data_io_from_region_per_file(uint64_t obj_id, struct pdc_region_info
46544657 }
46554658
46564659 if (res != (ssize_t )unit ) {
4657- if (is_fd_valid (region -> fd )) {
4660+ if (is_fd_valid (region -> fd )) {
46584661 LOG_JUST_PRINT ("region->fd was valid\n" );
4659- } else {
4662+ }
4663+ else {
46604664 LOG_JUST_PRINT ("region->fd %d was invalid\n" , region -> fd );
46614665 }
46624666 LOG_JUST_PRINT ("expected io size %d: actual io size %d\n" , unit , res );
@@ -4666,7 +4670,7 @@ PDC_Server_data_io_from_region_per_file(uint64_t obj_id, struct pdc_region_info
46664670 PGOTO_ERROR (FAIL , "I/O operation failed\n" );
46674671 }
46684672 else {
4669- //LOG_JUST_PRINT("\tio storage location: %s\n", region->storage_location[region_index]);
4673+ // LOG_JUST_PRINT("\tio storage location: %s\n", region->storage_location[region_index]);
46704674 }
46714675
46724676 // Advance indices
0 commit comments