Changeset 9020
- Timestamp:
- 08/22/11 12:16:24 (22 months ago)
- Location:
- branches/Orange-Branch
- Files:
-
- 5 added
- 15 modified
-
include/pvfs2-mgmt.h (modified) (2 diffs)
-
src/apps/admin/module.mk.in (modified) (1 diff)
-
src/apps/admin/pvfs2-get-uid.c (added)
-
src/client/sysint/client-state-machine.c (modified) (2 diffs)
-
src/client/sysint/client-state-machine.h (modified) (5 diffs)
-
src/client/sysint/mgmt-get-uid-list.sm (added)
-
src/client/sysint/module.mk.in (modified) (1 diff)
-
src/common/misc/module.mk.in (modified) (2 diffs)
-
src/common/misc/pint-uid-mgmt.c (added)
-
src/common/misc/pint-uid-mgmt.h (added)
-
src/common/misc/pint-util.c (modified) (1 diff)
-
src/common/misc/pint-util.h (modified) (1 diff)
-
src/proto/PINT-le-bytefield.c (modified) (7 diffs)
-
src/proto/pvfs2-req-proto.h (modified) (6 diffs)
-
src/server/mgmt-get-uid.sm (added)
-
src/server/module.mk.in (modified) (1 diff)
-
src/server/prelude.sm (modified) (1 diff)
-
src/server/pvfs2-server-req.c (modified) (2 diffs)
-
src/server/pvfs2-server.c (modified) (3 diffs)
-
src/server/pvfs2-server.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/Orange-Branch/include/pvfs2-mgmt.h
r8899 r9020 26 26 #include "pvfs2-sysint.h" 27 27 #include "pvfs2-types.h" 28 #include "pint-uid-mgmt.h" 28 29 29 30 /* non-blocking mgmt operation handle */ … … 414 415 PVFS_BMI_addr_t *addr); 415 416 417 PVFS_error PVFS_imgmt_get_uid_list( 418 PVFS_fs_id fs_id, 419 PVFS_credentials *credentials, 420 int server_count, 421 PVFS_BMI_addr_t *addr_array, 422 uint32_t history, 423 PVFS_uid_info_s **uid_info_array, 424 uint32_t *uid_count, 425 PVFS_mgmt_op_id *op_id, 426 PVFS_hint hints, 427 void *user_ptr); 428 429 PVFS_error PVFS_mgmt_get_uid_list( 430 PVFS_fs_id fs_id, 431 PVFS_credentials *credentials, 432 int server_count, 433 PVFS_BMI_addr_t *addr_array, 434 uint32_t history, 435 PVFS_uid_info_s **uid_info_array, 436 uint32_t *uid_count, 437 PVFS_hint hints, 438 void *user_ptr); 439 440 416 441 #endif /* __PVFS2_MGMT_H */ 417 442 -
branches/Orange-Branch/src/apps/admin/module.mk.in
r8900 r9020 28 28 $(DIR)/pvfs2-perror.c \ 29 29 $(DIR)/pvfs2-check-server.c \ 30 $(DIR)/pvfs2-drop-caches.c 30 $(DIR)/pvfs2-drop-caches.c \ 31 $(DIR)/pvfs2-get-uid.c 31 32 32 33 ADMINSRC_SERVER := \ -
branches/Orange-Branch/src/client/sysint/client-state-machine.c
r8941 r9020 269 269 {&pvfs2_client_mgmt_remove_dirent_sm}, 270 270 {&pvfs2_client_mgmt_create_dirent_sm}, 271 {&pvfs2_client_mgmt_get_dirdata_handle_sm} 271 {&pvfs2_client_mgmt_get_dirdata_handle_sm}, 272 {&pvfs2_client_mgmt_get_uid_list_sm} 272 273 }; 273 274 … … 992 993 { PVFS_MGMT_GET_DIRDATA_HANDLE, 993 994 "PVFS_MGMT_GET_DIRDATA_HANDLE" }, 995 { PVFS_MGMT_GET_UID_LIST, "PVFS_MGMT_GET_UID_LIST" }, 994 996 { PVFS_SYS_GETEATTR, "PVFS_SYS_GETEATTR" }, 995 997 { PVFS_SYS_SETEATTR, "PVFS_SYS_SETEATTR" }, -
branches/Orange-Branch/src/client/sysint/client-state-machine.h
r8957 r9020 553 553 { 554 554 struct PINT_dev_unexp_info *info; 555 }; 556 557 /* scratch area used for the UID management state machine */ 558 struct PINT_client_mgmt_get_uid_list_sm 559 { 560 PVFS_fs_id fs_id; 561 uint32_t history; 562 int server_count; 563 PVFS_id_gen_t *addr_array; /* in */ 564 PVFS_uid_info_s **uid_statistics; /* out */ 565 uint32_t *uid_count; /* out */ 555 566 }; 556 567 … … 632 643 struct PINT_sysdev_unexp_sm sysdev_unexp; 633 644 struct PINT_client_job_timer_sm job_timer; 645 struct PINT_client_mgmt_get_uid_list_sm get_uid_list; 634 646 } u; 635 647 } PINT_client_sm; … … 720 732 PVFS_MGMT_CREATE_DIRENT = 79, 721 733 PVFS_MGMT_GET_DIRDATA_HANDLE = 80, 734 PVFS_MGMT_GET_UID_LIST = 81, 722 735 PVFS_SERVER_GET_CONFIG = 200, 723 736 PVFS_CLIENT_JOB_TIMER = 300, … … 728 741 #define PVFS_OP_SYS_MAXVALID 21 729 742 #define PVFS_OP_SYS_MAXVAL 69 730 #define PVFS_OP_MGMT_MAXVALID 8 1743 #define PVFS_OP_MGMT_MAXVALID 82 731 744 #define PVFS_OP_MGMT_MAXVAL 199 732 745 … … 831 844 extern struct PINT_state_machine_s pvfs2_client_statfs_sm; 832 845 extern struct PINT_state_machine_s pvfs2_fs_add_sm; 846 extern struct PINT_state_machine_s pvfs2_client_mgmt_get_uid_list_sm; 833 847 834 848 /* nested state machines (helpers) */ -
branches/Orange-Branch/src/client/sysint/module.mk.in
r6524 r9020 50 50 $(DIR)/mgmt-remove-dirent.c \ 51 51 $(DIR)/mgmt-create-dirent.c \ 52 $(DIR)/mgmt-get-dirdata-handle.c 52 $(DIR)/mgmt-get-dirdata-handle.c \ 53 $(DIR)/mgmt-get-uid-list.c 53 54 54 55 # track generated .c files that need to be removed during dist clean, etc. -
branches/Orange-Branch/src/common/misc/module.mk.in
r7574 r9020 22 22 $(DIR)/pint-eattr.c \ 23 23 $(DIR)/pint-hint.c \ 24 $(DIR)/pint-mem.c 24 $(DIR)/pint-mem.c \ 25 $(DIR)/pint-uid-mgmt.c 25 26 SERVERSRC += $(DIR)/server-config.c \ 26 27 $(DIR)/server-config-mgr.c \ … … 41 42 $(DIR)/pint-eattr.c \ 42 43 $(DIR)/pint-mem.c \ 43 $(DIR)/pint-hint.c 44 $(DIR)/pint-hint.c \ 45 $(DIR)/pint-uid-mgmt.c 44 46 45 47 LIBBMISRC += $(DIR)/str-utils.c \ -
branches/Orange-Branch/src/common/misc/pint-util.c
r8941 r9020 473 473 } 474 474 475 /* parses a struct timeval into a readable timestamp string*/ 476 /* assumes sufficient memory has been allocated for str, no checking */ 477 /* to be safe, make str a 64 character string atleast */ 478 void PINT_util_parse_timeval(struct timeval tv, char *str) 479 { 480 time_t now; 481 struct tm *currentTime; 482 483 now = tv.tv_sec; 484 currentTime = localtime(&now); 485 strftime(str, 64, "%m/%d/%Y %H:%M:%S", currentTime); 486 487 return; 488 } 475 489 476 490 PVFS_time PINT_util_mktime_version(PVFS_time time) -
branches/Orange-Branch/src/common/misc/pint-util.h
r8941 r9020 149 149 void PINT_util_get_current_timeval(struct timeval *tv); 150 150 int PINT_util_get_timeval_diff(struct timeval *tv_start, struct timeval *tv_end); 151 void PINT_util_parse_timeval(struct timeval tv, char *str); 151 152 152 153 PVFS_time PINT_util_mktime_version(PVFS_time time); -
branches/Orange-Branch/src/proto/PINT-le-bytefield.c
r8891 r9020 279 279 respsize = extra_size_PVFS_servresp_tree_get_file_size; 280 280 break; 281 case PVFS_SERV_MGMT_GET_UID: 282 resp.u.mgmt_get_uid.uid_info_array_count = 0; 283 respsize = extra_size_PVFS_servresp_mgmt_get_uid; 284 break; 281 285 case PVFS_SERV_NUM_OPS: /** sentinel, should not hit */ 282 286 assert(0); … … 448 452 CASE(PVFS_SERV_LISTEATTR, listeattr); 449 453 CASE(PVFS_SERV_LISTATTR, listattr); 454 CASE(PVFS_SERV_MGMT_GET_UID, mgmt_get_uid); 450 455 451 456 case PVFS_SERV_GETCONFIG: … … 546 551 CASE(PVFS_SERV_LISTATTR, listattr); 547 552 CASE(PVFS_SERV_TREE_GET_FILE_SIZE, tree_get_file_size); 553 CASE(PVFS_SERV_MGMT_GET_UID, mgmt_get_uid); 548 554 549 555 case PVFS_SERV_REMOVE: … … 660 666 CASE(PVFS_SERV_LISTEATTR, listeattr); 661 667 CASE(PVFS_SERV_LISTATTR, listattr); 668 CASE(PVFS_SERV_MGMT_GET_UID, mgmt_get_uid); 662 669 663 670 case PVFS_SERV_GETCONFIG: … … 748 755 CASE(PVFS_SERV_LISTATTR, listattr); 749 756 CASE(PVFS_SERV_TREE_GET_FILE_SIZE, tree_get_file_size); 757 CASE(PVFS_SERV_MGMT_GET_UID, mgmt_get_uid); 750 758 751 759 case PVFS_SERV_REMOVE: … … 914 922 case PVFS_SERV_MGMT_PERF_MON: 915 923 case PVFS_SERV_MGMT_EVENT_MON: 924 case PVFS_SERV_MGMT_GET_UID: 916 925 917 926 case PVFS_SERV_DELEATTR: … … 1052 1061 } 1053 1062 1063 case PVFS_SERV_MGMT_GET_UID: 1064 { 1065 decode_free(resp->u.mgmt_get_uid.uid_info_array); 1066 break; 1067 } 1068 1054 1069 case PVFS_SERV_GETCONFIG: 1055 1070 case PVFS_SERV_REMOVE: -
branches/Orange-Branch/src/proto/pvfs2-req-proto.h
r8941 r9020 19 19 #include "pvfs2-mgmt.h" 20 20 #include "pint-hint.h" 21 #include "pint-uid-mgmt.h" 21 22 22 23 /* update PVFS2_PROTO_MAJOR on wire protocol changes that break backwards … … 28 29 * compatibility (such as adding a new request type) 29 30 */ 30 #define PVFS2_PROTO_MINOR 031 #define PVFS2_PROTO_MINOR 1 31 32 #define PVFS2_PROTO_VERSION ((PVFS2_PROTO_MAJOR*1000)+(PVFS2_PROTO_MINOR)) 32 33 … … 84 85 PVFS_SERV_TREE_REMOVE = 41, 85 86 PVFS_SERV_TREE_GET_FILE_SIZE = 42, 87 PVFS_SERV_MGMT_GET_UID = 43, 86 88 /* leave this entry last */ 87 89 PVFS_SERV_NUM_OPS … … 1917 1919 (PVFS_REQ_LIMIT_EATTR_KEY_LEN * PVFS_REQ_LIMIT_EATTR_LIST) 1918 1920 1921 /* mgmt_get_uid ****************************************************/ 1922 /* retrieves uid managment history from server */ 1923 1924 struct PVFS_servreq_mgmt_get_uid 1925 { 1926 uint32_t history; /* number of seconds we want to go back 1927 when retrieving the uid history */ 1928 }; 1929 endecode_fields_1_struct( 1930 PVFS_servreq_mgmt_get_uid, 1931 uint32_t, history); 1932 1933 #define PINT_SERVREQ_MGMT_GET_UID_FILL(__req, \ 1934 __creds, \ 1935 __history, \ 1936 __hints) \ 1937 do { \ 1938 memset(&(__req), 0, sizeof(__req)); \ 1939 (__req).op = PVFS_SERV_MGMT_GET_UID; \ 1940 (__req).credentials = (__creds); \ 1941 (__req).hints = (__hints); \ 1942 (__req).u.mgmt_get_uid.history = (__history); \ 1943 } while (0) 1944 1945 struct PVFS_servresp_mgmt_get_uid 1946 { 1947 PVFS_uid_info_s *uid_info_array; /* array of uid info */ 1948 uint32_t uid_info_array_count; /* size of above array */ 1949 }; 1950 endecode_fields_1a_struct( 1951 PVFS_servresp_mgmt_get_uid, 1952 skip4,, 1953 uint32_t, uid_info_array_count, 1954 PVFS_uid_info_s, uid_info_array); 1955 1956 #define extra_size_PVFS_servresp_mgmt_get_uid \ 1957 UID_MGMT_MAX_HISTORY * sizeof(PVFS_uid_info_s) 1919 1958 1920 1959 /* server request *********************************************/ … … 1963 2002 struct PVFS_servreq_tree_remove tree_remove; 1964 2003 struct PVFS_servreq_tree_get_file_size tree_get_file_size; 2004 struct PVFS_servreq_mgmt_get_uid mgmt_get_uid; 1965 2005 } u; 1966 2006 }; … … 2018 2058 struct PVFS_servresp_listattr listattr; 2019 2059 struct PVFS_servresp_tree_get_file_size tree_get_file_size; 2060 struct PVFS_servresp_mgmt_get_uid mgmt_get_uid; 2020 2061 } u; 2021 2062 }; -
branches/Orange-Branch/src/server/module.mk.in
r8486 r9020 48 48 $(DIR)/precreate-pool-refiller.c \ 49 49 $(DIR)/unstuff.c \ 50 $(DIR)/tree-communicate.c 50 $(DIR)/tree-communicate.c \ 51 $(DIR)/mgmt-get-uid.c 51 52 52 53 # c files that should be added to server library -
branches/Orange-Branch/src/server/prelude.sm
r8891 r9020 99 99 s_op->access_type = PINT_server_req_get_access_type(s_op->req); 100 100 s_op->sched_policy = PINT_server_req_get_sched_policy(s_op->req); 101 102 /* add the user to the uid mgmt system */ 103 ret = PINT_add_user_to_uid_mgmt(s_op->req->credentials.uid); 104 if (ret != 0) 105 { 106 gossip_debug(GOSSIP_MIRROR_DEBUG, "Unable to add user id to uid" 107 "management interface\n"); 108 } 101 109 102 110 return SM_ACTION_COMPLETE; -
branches/Orange-Branch/src/server/pvfs2-server-req.c
r8098 r9020 52 52 extern struct PINT_server_req_params pvfs2_tree_remove_params; 53 53 extern struct PINT_server_req_params pvfs2_tree_get_file_size_params; 54 extern struct PINT_server_req_params pvfs2_uid_mgmt_params; 54 55 55 56 /* table of incoming request types and associated parameters */ … … 99 100 /* 41 */ {PVFS_SERV_TREE_REMOVE, &pvfs2_tree_remove_params}, 100 101 /* 42 */ {PVFS_SERV_TREE_GET_FILE_SIZE, &pvfs2_tree_get_file_size_params}, 102 /* 43 */ {PVFS_SERV_MGMT_GET_UID, &pvfs2_uid_mgmt_params}, 101 103 }; 102 104 -
branches/Orange-Branch/src/server/pvfs2-server.c
r8985 r9020 47 47 #include "pint-event.h" 48 48 #include "pint-util.h" 49 #include "pint-uid-mgmt.h" 49 50 50 51 #ifndef PVFS2_VERSION … … 1163 1164 #endif 1164 1165 1166 ret = PINT_uid_mgmt_initialize(); 1167 if (ret < 0) 1168 { 1169 gossip_err("Error initializing the uid management interface\n"); 1170 return (ret); 1171 } 1172 1173 *server_status_flag |= SERVER_UID_MGMT_INIT; 1174 1165 1175 ret = precreate_pool_initialize(server_index); 1166 1176 if (ret < 0) … … 1623 1633 gossip_debug(GOSSIP_SERVER_DEBUG, "[-] performance " 1624 1634 "interface [ stopped ]\n"); 1635 } 1636 1637 if (status & SERVER_UID_MGMT_INIT) 1638 { 1639 gossip_debug(GOSSIP_SERVER_DEBUG, "[+] halting uid management " 1640 "interface [ ... ]\n"); 1641 PINT_uid_mgmt_finalize(); 1642 gossip_debug(GOSSIP_SERVER_DEBUG, "[-] uid management " 1643 "interface [ stopped ]\n"); 1644 1625 1645 } 1626 1646 -
branches/Orange-Branch/src/server/pvfs2-server.h
r8941 r9020 210 210 SERVER_CACHED_CONFIG_INIT = (1 << 17), 211 211 SERVER_PRECREATE_INIT = (1 << 18), 212 SERVER_UID_MGMT_INIT = (1 << 19), 212 213 } PINT_server_status_flag; 213 214
