Changeset 8556
- Timestamp:
- 10/11/10 17:35:16 (3 years ago)
- Location:
- branches/windows-client
- Files:
-
- 6 added
- 11 modified
-
include/pvfs2-types.h (modified) (1 diff)
-
projects/OrangeFS/OrangeFS.sln (modified) (2 diffs)
-
projects/OrangeFS/bmi (added)
-
projects/OrangeFS/bmi/bmi.vcxproj (added)
-
projects/OrangeFS/bmi_wintcp/bmi_wintcp.vcxproj (modified) (1 diff)
-
projects/OrangeFS/test-bmi-client (added)
-
projects/OrangeFS/test-bmi-client/test-bmi-client.vcxproj (added)
-
projects/OrangeFS/test-bmi-server (added)
-
projects/OrangeFS/test-bmi-server/test-bmi-server.vcxproj (added)
-
src/common/quicklist/quicklist.h (modified) (1 diff)
-
src/common/windows/wincommon.h (modified) (1 diff)
-
src/io/bmi/bmi.c (modified) (11 diffs)
-
src/io/bmi/bmi_wintcp/bmi-wintcp.c (modified) (1 diff)
-
src/io/bmi/bmi_wintcp/socket-collection.c (modified) (1 diff)
-
src/io/bmi/reference-list.h (modified) (1 diff)
-
test/io/bmi/test-bmi-client.c (modified) (3 diffs)
-
test/io/bmi/test-bmi-server.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/windows-client/include/pvfs2-types.h
r8540 r8556 21 21 #ifdef WIN32 22 22 #include "wincommon.h" 23 /* define struct timeval */24 struct timeval25 {26 long tv_sec;27 long tv_usec;28 };29 23 #else 30 24 #include <sys/time.h> -
branches/windows-client/projects/OrangeFS/OrangeFS.sln
r8546 r8556 21 21 EndProject 22 22 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "id-generator", "id-generator\id-generator.vcxproj", "{0CBAD436-373C-4F35-A620-2D46C12D8FE0}" 23 EndProject 24 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bmi", "bmi\bmi.vcxproj", "{B7F1BEBC-F833-448A-829A-3505019C8169}" 25 EndProject 26 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-bmi-client", "test-bmi-client\test-bmi-client.vcxproj", "{490C6444-6931-4D69-9EC0-B104920591ED}" 27 ProjectSection(ProjectDependencies) = postProject 28 {9C95DF0D-5B60-4E94-94ED-000861C651B4} = {9C95DF0D-5B60-4E94-94ED-000861C651B4} 29 {0CBAD436-373C-4F35-A620-2D46C12D8FE0} = {0CBAD436-373C-4F35-A620-2D46C12D8FE0} 30 {62A89A5C-1B78-40B7-BB6A-6E5A06DB06E1} = {62A89A5C-1B78-40B7-BB6A-6E5A06DB06E1} 31 {A7C0F968-DACA-4BFE-B36F-46FDAEB8EF1D} = {A7C0F968-DACA-4BFE-B36F-46FDAEB8EF1D} 32 {B7F1BEBC-F833-448A-829A-3505019C8169} = {B7F1BEBC-F833-448A-829A-3505019C8169} 33 {9138ABF9-041F-4A55-9E87-0F433719F4FC} = {9138ABF9-041F-4A55-9E87-0F433719F4FC} 34 EndProjectSection 35 EndProject 36 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-bmi-server", "test-bmi-server\test-bmi-server.vcxproj", "{AC842F24-4342-42D1-928D-19176B22917C}" 37 ProjectSection(ProjectDependencies) = postProject 38 {9C95DF0D-5B60-4E94-94ED-000861C651B4} = {9C95DF0D-5B60-4E94-94ED-000861C651B4} 39 {0CBAD436-373C-4F35-A620-2D46C12D8FE0} = {0CBAD436-373C-4F35-A620-2D46C12D8FE0} 40 {62A89A5C-1B78-40B7-BB6A-6E5A06DB06E1} = {62A89A5C-1B78-40B7-BB6A-6E5A06DB06E1} 41 {A7C0F968-DACA-4BFE-B36F-46FDAEB8EF1D} = {A7C0F968-DACA-4BFE-B36F-46FDAEB8EF1D} 42 {B7F1BEBC-F833-448A-829A-3505019C8169} = {B7F1BEBC-F833-448A-829A-3505019C8169} 43 {9138ABF9-041F-4A55-9E87-0F433719F4FC} = {9138ABF9-041F-4A55-9E87-0F433719F4FC} 44 EndProjectSection 23 45 EndProject 24 46 Global … … 50 72 {0CBAD436-373C-4F35-A620-2D46C12D8FE0}.Release|Win32.ActiveCfg = Release|Win32 51 73 {0CBAD436-373C-4F35-A620-2D46C12D8FE0}.Release|Win32.Build.0 = Release|Win32 74 {B7F1BEBC-F833-448A-829A-3505019C8169}.Debug|Win32.ActiveCfg = Debug|Win32 75 {B7F1BEBC-F833-448A-829A-3505019C8169}.Debug|Win32.Build.0 = Debug|Win32 76 {B7F1BEBC-F833-448A-829A-3505019C8169}.Release|Win32.ActiveCfg = Release|Win32 77 {B7F1BEBC-F833-448A-829A-3505019C8169}.Release|Win32.Build.0 = Release|Win32 78 {490C6444-6931-4D69-9EC0-B104920591ED}.Debug|Win32.ActiveCfg = Debug|Win32 79 {490C6444-6931-4D69-9EC0-B104920591ED}.Debug|Win32.Build.0 = Debug|Win32 80 {490C6444-6931-4D69-9EC0-B104920591ED}.Release|Win32.ActiveCfg = Release|Win32 81 {490C6444-6931-4D69-9EC0-B104920591ED}.Release|Win32.Build.0 = Release|Win32 82 {AC842F24-4342-42D1-928D-19176B22917C}.Debug|Win32.ActiveCfg = Debug|Win32 83 {AC842F24-4342-42D1-928D-19176B22917C}.Debug|Win32.Build.0 = Debug|Win32 84 {AC842F24-4342-42D1-928D-19176B22917C}.Release|Win32.ActiveCfg = Release|Win32 85 {AC842F24-4342-42D1-928D-19176B22917C}.Release|Win32.Build.0 = Release|Win32 52 86 EndGlobalSection 53 87 GlobalSection(SolutionProperties) = preSolution -
branches/windows-client/projects/OrangeFS/bmi_wintcp/bmi_wintcp.vcxproj
r8546 r8556 66 66 <ItemGroup> 67 67 <ClCompile Include="..\..\..\src\io\bmi\bmi_wintcp\bmi-wintcp.c" /> 68 <ClCompile Include="..\..\..\src\io\bmi\bmi_wintcp\socket-collection.c" /> 68 69 <ClCompile Include="..\..\..\src\io\bmi\bmi_wintcp\sockio.c" /> 69 70 </ItemGroup> -
branches/windows-client/src/common/quicklist/quicklist.h
r8540 r8556 196 196 * @member: the name of the list_struct within the struct. 197 197 */ 198 #define qlist_for_each_entry(pos, head, member) \ 198 #ifdef WIN32 199 #define qlist_for_each_entry(pos, head, member, type) \ 200 for (pos = qlist_entry((head)->next, type, member); \ 201 &pos->member != (head); \ 202 pos = qlist_entry(pos->member.next, type, member)) 203 #else 204 #define qlist_for_each_entry(pos, head, member) \ 199 205 for (pos = qlist_entry((head)->next, typeof(*pos), member); \ 200 &pos->member != (head); \201 pos = qlist_entry(pos->member.next, typeof(*pos), member)) \202 206 &pos->member != (head); \ 207 pos = qlist_entry(pos->member.next, typeof(*pos), member)) 208 #endif 203 209 /** 204 210 * qlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry -
branches/windows-client/src/common/windows/wincommon.h
r8550 r8556 31 31 if (ret == 0) 32 32 { 33 tv->tv_sec = timebuffer.time;33 tv->tv_sec = (long) timebuffer.time; 34 34 tv->tv_usec = timebuffer.millitm * 1000; 35 35 } -
branches/windows-client/src/io/bmi/bmi.c
r8317 r8556 15 15 #include <assert.h> 16 16 #include <time.h> 17 #ifndef WIN32 17 18 #include <sys/time.h> 19 #endif 18 20 #include <stdio.h> 19 21 … … 29 31 #include "pvfs2-internal.h" 30 32 #include "pvfs2-debug.h" 33 34 #ifdef WIN32 35 #include "wincommon.h" 36 37 #define EREMOTE 66 38 #define EHOSTDOWN 112 39 #endif 31 40 32 41 static int bmi_initialized_count = 0; … … 991 1000 int position = 0; 992 1001 int tmp_outcount = 0; 1002 #ifdef WIN32 1003 struct bmi_method_unexpected_info *sub_info = 1004 (struct bmi_method_unexpected_info *) 1005 malloc(sizeof(struct bmi_method_unexpected_info) * incount); 1006 #else 993 1007 struct bmi_method_unexpected_info sub_info[incount]; 1008 #endif 994 1009 ref_st_p tmp_ref = NULL; 995 1010 int tmp_active_method_count = 0; … … 1004 1019 1005 1020 if (max_idle_time_ms < 0) 1021 { 1022 #ifdef WIN32 1023 free(sub_info); 1024 #endif 1006 1025 return (bmi_errno_to_pvfs(-EINVAL)); 1026 } 1007 1027 1008 1028 *outcount = 0; … … 1020 1040 { 1021 1041 /* can't recover from this */ 1042 #ifdef WIN32 1043 free(sub_info); 1044 #endif 1022 1045 gossip_lerr("Error: critical BMI_testunexpected failure.\n"); 1023 1046 return (ret); … … 1044 1067 { 1045 1068 /* yeah, right */ 1069 #ifdef WIN32 1070 free(sub_info); 1071 #endif 1046 1072 gossip_lerr("Error: critical BMI_testunexpected failure.\n"); 1047 1073 gen_mutex_unlock(&ref_mutex); … … 1055 1081 info_array[i].addr = tmp_ref->bmi_addr; 1056 1082 } 1083 #ifdef WIN32 1084 free(sub_info); 1085 #endif 1057 1086 /* return 1 if anything completed */ 1058 1087 if (ret == 0 && *outcount > 0) … … 1083 1112 int tmp_outcount = 0; 1084 1113 int tmp_active_method_count = 0; 1114 #ifndef WIN32 1085 1115 struct timespec ts; 1116 #endif 1086 1117 1087 1118 gen_mutex_lock(&active_method_count_mutex); … … 1099 1130 if(max_idle_time_ms > 0) 1100 1131 { 1101 ts.tv_sec = 0; 1132 #ifdef WIN32 1133 Sleep(2); 1134 #else 1135 ts.tv_sec = 0; 1102 1136 ts.tv_nsec = 2000; 1103 1137 nanosleep(&ts, NULL); 1138 #endif 1104 1139 } 1105 1140 return(0); … … 2277 2312 { 2278 2313 struct method_drop_addr_query query; 2314 int ret = 0; 2279 2315 query.response = 0; 2280 2316 query.addr = tmp_ref->method_addr; 2281 int ret = 0;2282 2317 2283 2318 /* reference count is zero; ask module if it wants us to discard … … 2340 2375 gen_mutex_unlock(&bmi_addr_force_drop_list_mutex); 2341 2376 gen_mutex_lock(&ref_mutex); 2377 #ifdef WIN32 2378 qlist_for_each_entry(ref_item, cur_ref_list, list_link, ref_st) 2379 #else 2342 2380 qlist_for_each_entry(ref_item, cur_ref_list, list_link) 2381 #endif 2343 2382 { 2344 2383 if ((ref_item->ref_count == 0) && -
branches/windows-client/src/io/bmi/bmi_wintcp/bmi-wintcp.c
r8554 r8556 2390 2390 2391 2391 tcp_op_data = (struct tcp_op *) new_method_op->method_data; 2392 tcp_op_data->tcp_op_state = ( bmi_tcp_state) tcp_op_state;2392 tcp_op_data->tcp_op_state = (enum bmi_tcp_state) tcp_op_state; 2393 2393 tcp_op_data->env = header; 2394 2394 -
branches/windows-client/src/io/bmi/bmi_wintcp/socket-collection.c
r8516 r8556 16 16 */ 17 17 #include <stdio.h> 18 #include <sys/poll.h>19 18 #include <string.h> 20 #include <unistd.h>21 19 #include <errno.h> 22 20 -
branches/windows-client/src/io/bmi/reference-list.h
r7466 r8556 19 19 #include "quicklist.h" 20 20 #include "quickhash.h" 21 22 #ifdef WIN32 23 /* interface is a macro on Windows */ 24 #undef interface 25 #define interface _interface 26 #endif 21 27 22 28 typedef struct qlist_head *ref_list_p; -
branches/windows-client/test/io/bmi/test-bmi-client.c
r7500 r8556 15 15 #include <stdio.h> 16 16 #include <errno.h> 17 #ifndef WIN32 17 18 #include <unistd.h> 19 #endif 18 20 #include <stdlib.h> 19 21 #include <string.h> … … 298 300 } 299 301 300 302 #ifdef WIN32 303 static struct options *parse_args( 304 int argc, 305 char *argv[]) 306 { 307 int argi = 1, len, ret; 308 struct options *tmp_opts = malloc(sizeof(struct options)); 309 if (!tmp_opts) 310 { 311 goto parse_args_error; 312 } 313 314 /* defaults */ 315 tmp_opts->hostid = NULL; 316 tmp_opts->message_size = 32000; 317 318 while (argi < argc) 319 { 320 if (strcmp(argv[argi], "-h") == 0) 321 { 322 len = strlen(argv[++argi]) + 1; 323 tmp_opts->hostid = (char *) malloc(len); 324 if (tmp_opts->hostid == NULL) 325 { 326 goto parse_args_error; 327 } 328 memcpy(tmp_opts->hostid, argv[argi], len); 329 argi++; 330 } 331 else if (strcmp(argv[argi], "-s") == 0) 332 { 333 ret = sscanf(argv[++argi], "%d", &tmp_opts->message_size); 334 if (ret < -1) 335 { 336 goto parse_args_error; 337 } 338 argi++; 339 } 340 else { 341 goto parse_args_error; 342 } 343 } 344 345 /* if we didn't get a host argument, fill in a default: */ 346 if (tmp_opts->hostid == NULL) { 347 len = (strlen(DEFAULT_HOSTID)) + 1; 348 if ((tmp_opts->hostid = malloc(len)) == NULL) 349 { 350 goto parse_args_error; 351 } 352 memcpy(tmp_opts->hostid, DEFAULT_HOSTID, len); 353 } 354 355 return (tmp_opts); 356 357 parse_args_error: 358 359 /* if an error occurs, just free everything and return NULL */ 360 if (tmp_opts) 361 { 362 if (tmp_opts->hostid) 363 { 364 free(tmp_opts->hostid); 365 } 366 free(tmp_opts); 367 } 368 return (NULL); 369 } 370 #else 301 371 static struct options *parse_args( 302 372 int argc, … … 371 441 return (NULL); 372 442 } 443 #endif /* WIN32 */ 373 444 374 445 /* -
branches/windows-client/test/io/bmi/test-bmi-server.c
r7500 r8556 15 15 #include <stdio.h> 16 16 #include <errno.h> 17 #ifndef WIN32 17 18 #include <unistd.h> 19 #endif 18 20 #include <stdlib.h> 19 21 #include <string.h> … … 240 242 241 243 244 #ifdef WIN32 245 static struct options *parse_args( 246 int argc, 247 char *argv[]) 248 { 249 int argi = 1, len; 250 struct options *tmp_opts = malloc(sizeof(struct options)); 251 if (!tmp_opts) 252 { 253 goto parse_args_error; 254 } 255 256 /* defaults */ 257 tmp_opts->hostid = NULL; 258 259 while (argi < argc) 260 { 261 if (strcmp(argv[argi], "-h") == 0) 262 { 263 len = strlen(argv[++argi]) + 1; 264 tmp_opts->hostid = (char *) malloc(len); 265 if (tmp_opts->hostid == NULL) 266 { 267 goto parse_args_error; 268 } 269 memcpy(tmp_opts->hostid, argv[argi], len); 270 argi++; 271 } 272 else { 273 goto parse_args_error; 274 } 275 } 276 277 /* if we didn't get a host argument, fill in a default: */ 278 if (tmp_opts->hostid == NULL) { 279 len = (strlen(DEFAULT_HOSTID)) + 1; 280 if ((tmp_opts->hostid = malloc(len)) == NULL) 281 { 282 goto parse_args_error; 283 } 284 memcpy(tmp_opts->hostid, DEFAULT_HOSTID, len); 285 } 286 287 return (tmp_opts); 288 289 parse_args_error: 290 291 /* if an error occurs, just free everything and return NULL */ 292 if (tmp_opts) 293 { 294 if (tmp_opts->hostid) 295 { 296 free(tmp_opts->hostid); 297 } 298 free(tmp_opts); 299 } 300 return (NULL); 301 } 302 #else 242 303 static struct options *parse_args( 243 304 int argc, … … 301 362 return (NULL); 302 363 } 364 #endif 303 365 304 366 /*
