int rozofs_storcli_repair2_get_position_of_first_byte2write() { sp_write_repair2_arg_no_bins_t *request; sp_write_repair2_arg_no_bins_t repair2_prj_args; int position; if (storcli_write_repair2_bin_first_byte == 0) { request = &repair2_prj_args; memset(request,0,sizeof(sp_write_repair2_arg_no_bins_t)); position = rozofs_storcli_fake_encode((xdrproc_t) xdr_sp_write_repair2_arg_no_bins_t, (caddr_t) request); if (position < 0) { fatal("Cannot get the size of the rpc header for repair2"); return 0; } storcli_write_repair2_bin_first_byte = position; } return storcli_write_repair2_bin_first_byte; }
/** * That service is intended to be called by the write service * The goal is to provide the position of the first byte to write on disk @param none @retval position of the first byte */ int storage_get_position_of_first_byte2write_from_write_req() { sp_write_arg_no_bins_t *request; sp_write_arg_no_bins_t write_prj_args; int position; if (storage_bin_write_first_bin_to_read == 0) { request = &write_prj_args; memset(request,0,sizeof(sp_write_arg_no_bins_t)); position = rozofs_storcli_fake_encode((xdrproc_t) xdr_sp_write_arg_no_bins_t, (caddr_t) request); if (position < 0) { fatal("Cannot get the size of the rpc header for writing"); return 0; } storage_bin_write_first_bin_to_read = position; } return storage_bin_write_first_bin_to_read; }