[PVFS2-CVS] commit by neill in pvfs2/include: pvfs2-mgmt.h pvfs2-sysint.h pvfs2-util.h

CVS commit program cvs at parl.clemson.edu
Thu May 20 14:27:46 EDT 2004


Update of /projects/cvsroot/pvfs2/include
In directory parlweb:/tmp/cvs-serv11755/include

Modified Files:
	pvfs2-mgmt.h pvfs2-sysint.h pvfs2-util.h 
Log Message:
- implement non-blocking operations for all sysint and mgmt operations
- refactor blocking operations in terms of non-blocking operations
- change all sysint credential arguments to credential references
- memory leaks, bug fixes, cleanups

NOTE: this is a non-blocking first draft, updates are sure to come


Index: pvfs2-mgmt.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/include/pvfs2-mgmt.h,v
diff -p -u -r1.35 -r1.36
--- pvfs2-mgmt.h	28 Apr 2004 23:22:21 -0000	1.35
+++ pvfs2-mgmt.h	20 May 2004 17:27:46 -0000	1.36
@@ -96,31 +96,31 @@ enum
 
 int PVFS_mgmt_count_servers(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     int server_type,
     int* count);
 
 int PVFS_mgmt_get_server_array(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     int server_type,
     PVFS_BMI_addr_t *addr_array,
     int* inout_count_p);
 
 int PVFS_mgmt_noop(
     PVFS_fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     PVFS_BMI_addr_t addr);
 
 const char* PVFS_mgmt_map_addr(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     PVFS_BMI_addr_t addr,
     int* server_type);
 
 int PVFS_mgmt_setparam_list(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     enum PVFS_server_param param,
     int64_t value,
     PVFS_BMI_addr_t *addr_array,
@@ -130,7 +130,7 @@ int PVFS_mgmt_setparam_list(
 
 int PVFS_mgmt_setparam_all(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     enum PVFS_server_param param,
     int64_t value,
     int64_t* old_value_array,
@@ -138,7 +138,7 @@ int PVFS_mgmt_setparam_all(
 
 int PVFS_mgmt_statfs_list(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     struct PVFS_mgmt_server_stat *stat_array,
     PVFS_BMI_addr_t *addr_array,
     int count,
@@ -146,14 +146,14 @@ int PVFS_mgmt_statfs_list(
 
 int PVFS_mgmt_statfs_all(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     struct PVFS_mgmt_server_stat *stat_array,
     int* inout_count_p,
     PVFS_error_details *details);
 
 int PVFS_mgmt_perf_mon_list(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     struct PVFS_mgmt_perf_stat** perf_matrix,
     uint64_t* end_time_ms_array,
     PVFS_BMI_addr_t *addr_array,
@@ -164,7 +164,7 @@ int PVFS_mgmt_perf_mon_list(
 
 int PVFS_mgmt_event_mon_list(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     struct PVFS_mgmt_event **event_matrix,
     PVFS_BMI_addr_t *addr_array,
     int server_count,
@@ -172,12 +172,12 @@ int PVFS_mgmt_event_mon_list(
     PVFS_error_details *details);
 
 int PVFS_mgmt_toggle_admin_mode(
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     int on_flag);
 
 int PVFS_mgmt_iterate_handles_list(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     PVFS_handle **handle_matrix,
     int* handle_count_array,
     PVFS_ds_position *position_array,
@@ -187,7 +187,7 @@ int PVFS_mgmt_iterate_handles_list(
 
 int PVFS_mgmt_get_dfile_array(
     PVFS_object_ref ref,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     PVFS_handle *dfile_array,
     int dfile_count);
 

Index: pvfs2-sysint.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/include/pvfs2-sysint.h,v
diff -p -u -r1.36 -r1.37
--- pvfs2-sysint.h	17 May 2004 16:03:21 -0000	1.36
+++ pvfs2-sysint.h	20 May 2004 17:27:46 -0000	1.37
@@ -15,9 +15,13 @@
 
 #include "pvfs2-types.h"
 #include "pvfs2-request.h"
+#include "id-generator.h"
 
-/* non-blocking operation handle */
-typedef PVFS_id_gen_t sysint_op_id_t;
+/* non-blocking sysint operation handle */
+typedef PVFS_id_gen_t PVFS_sys_op_id;
+
+/* non-blocking mgmt operation handle */
+typedef PVFS_id_gen_t PVFS_mgmt_op_id;
 
 /* attributes */
 struct PVFS_sys_attr_s
@@ -183,78 +187,155 @@ int PVFS_sys_finalize(
 #define PVFS2_LOOKUP_LINK_NO_FOLLOW 0
 #define PVFS2_LOOKUP_LINK_FOLLOW    1
 
+int PVFS_sys_iref_lookup(
+    PVFS_fs_id fs_id,
+    char *relative_pathname,
+    PVFS_object_ref parent_ref,
+    PVFS_credentials *credentials,
+    PVFS_sysresp_lookup * resp,
+    int follow_link,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
+
 int PVFS_sys_ref_lookup(
     PVFS_fs_id fs_id,
     char *relative_pathname,
     PVFS_object_ref parent_ref,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     PVFS_sysresp_lookup * resp,
     int follow_link);
 
 int PVFS_sys_lookup(
     PVFS_fs_id fs_id,
     char *name,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     PVFS_sysresp_lookup * resp,
     int follow_link);
 
+int PVFS_isys_getattr(
+    PVFS_object_ref ref,
+    uint32_t attrmask,
+    PVFS_credentials *credentials,
+    PVFS_sysresp_getattr *resp,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
+
 int PVFS_sys_getattr(
     PVFS_object_ref ref,
     uint32_t attrmask,
-    PVFS_credentials credentials,
-    PVFS_sysresp_getattr * resp);
+    PVFS_credentials *credentials,
+    PVFS_sysresp_getattr *resp);
+
+int PVFS_isys_setattr(
+    PVFS_object_ref ref,
+    PVFS_sys_attr attr,
+    PVFS_credentials *credentials,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_setattr(
     PVFS_object_ref ref,
     PVFS_sys_attr attr,
-    PVFS_credentials credentials);
+    PVFS_credentials *credentials);
+
+int PVFS_isys_mkdir(
+    char *entry_name,
+    PVFS_object_ref parent_ref,
+    PVFS_sys_attr attr,
+    PVFS_credentials *credentials,
+    PVFS_sysresp_mkdir *resp,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_mkdir(
     char *entry_name,
     PVFS_object_ref parent_ref,
     PVFS_sys_attr attr,
-    PVFS_credentials credentials,
-    PVFS_sysresp_mkdir * resp);
+    PVFS_credentials *credentials,
+    PVFS_sysresp_mkdir *resp);
+
+int PVFS_isys_readdir(
+    PVFS_object_ref ref,
+    PVFS_ds_position token,
+    int pvfs_dirent_incount,
+    PVFS_credentials *credentials,
+    PVFS_sysresp_readdir *resp,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_readdir(
     PVFS_object_ref ref,
     PVFS_ds_position token,
     int pvfs_dirent_incount,
-    PVFS_credentials credentials,
-    PVFS_sysresp_readdir * resp);
+    PVFS_credentials *credentials,
+    PVFS_sysresp_readdir *resp);
+
+int PVFS_isys_create(
+    char *entry_name,
+    PVFS_object_ref ref,
+    PVFS_sys_attr attr,
+    PVFS_credentials *credentials,
+    PVFS_sys_dist *dist,
+    PVFS_sysresp_create *resp,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_create(
     char *entry_name,
     PVFS_object_ref ref,
     PVFS_sys_attr attr,
-    PVFS_credentials credentials,
-    PVFS_sys_dist* dist,
-    PVFS_sysresp_create * resp);
+    PVFS_credentials *credentials,
+    PVFS_sys_dist *dist,
+    PVFS_sysresp_create *resp);
+
+int PVFS_isys_remove(
+    char *entry_name,
+    PVFS_object_ref ref,
+    PVFS_credentials *credentials,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_remove(
     char *entry_name,
     PVFS_object_ref ref,
-    PVFS_credentials credentials);
+    PVFS_credentials *credentials);
 
 int PVFS_sys_rename(
     char *old_entry,
     PVFS_object_ref old_parent_ref,
     char *new_entry,
     PVFS_object_ref new_parent_ref,
-    PVFS_credentials credentials);
+    PVFS_credentials *credentials);
+
+int PVFS_isys_symlink(
+    char *entry_name,
+    PVFS_object_ref parent_ref,
+    char *target,
+    PVFS_sys_attr attr,
+    PVFS_credentials *credentials,
+    PVFS_sysresp_symlink *resp,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_symlink(
     char *entry_name,
     PVFS_object_ref parent_ref,
     char *target,
     PVFS_sys_attr attr,
-    PVFS_credentials credentials,
-    PVFS_sysresp_symlink * resp);
+    PVFS_credentials *credentials,
+    PVFS_sysresp_symlink *resp);
 
-int PVFS_sys_readlink(
+int PVFS_isys_io(
     PVFS_object_ref ref,
-    PVFS_credentials credentials,
-    PVFS_sysresp_readlink * resp);
+    PVFS_Request file_req,
+    PVFS_offset file_req_offset,
+    void *buffer,
+    PVFS_Request mem_req,
+    PVFS_credentials *credentials,
+    PVFS_sysresp_io *resp,
+    enum PVFS_io_type type,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_io(
     PVFS_object_ref ref,
@@ -262,8 +343,8 @@ int PVFS_sys_io(
     PVFS_offset file_req_offset,
     void *buffer,
     PVFS_Request mem_req,
-    PVFS_credentials credentials,
-    PVFS_sysresp_io * resp,
+    PVFS_credentials *credentials,
+    PVFS_sysresp_io *resp,
     enum PVFS_io_type type);
 
 #define PVFS_sys_read(x1,x2,x3,x4,x5,x6,y) \
@@ -272,35 +353,49 @@ PVFS_sys_io(x1,x2,x3,x4,x5,x6,y,PVFS_IO_
 #define PVFS_sys_write(x1,x2,x3,x4,x5,x6,y) \
 PVFS_sys_io(x1,x2,x3,x4,x5,x6,y,PVFS_IO_WRITE)
 
+int PVFS_isys_truncate(
+    PVFS_object_ref ref,
+    PVFS_size size,
+    PVFS_credentials *credentials,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
+
 int PVFS_sys_truncate(
     PVFS_object_ref ref,
     PVFS_size size,
-    PVFS_credentials credentials);
+    PVFS_credentials *credentials);
 
 int PVFS_sys_getparent(
     PVFS_fs_id fs_id,
     char *entry_name,
-    PVFS_credentials credentials,
-    PVFS_sysresp_getparent * resp);
+    PVFS_credentials *credentials,
+    PVFS_sysresp_getparent *resp);
+
+int PVFS_isys_flush(
+    PVFS_object_ref ref,
+    PVFS_credentials *credentials,
+    PVFS_sys_op_id *op_id,
+    void *user_ptr);
 
 int PVFS_sys_flush(
     PVFS_object_ref ref,
-    PVFS_credentials credentials);
+    PVFS_credentials *credentials);
 
 int PVFS_sys_statfs(
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
-    PVFS_sysresp_statfs* resp);
+    PVFS_credentials *credentials,
+    PVFS_sysresp_statfs *resp);
 
-PVFS_sys_dist* PVFS_sys_dist_lookup(const char* dist_identifier);
+PVFS_sys_dist* PVFS_sys_dist_lookup(
+    const char* dist_identifier);
 
-int PVFS_sys_dist_free(PVFS_sys_dist* dist);
+int PVFS_sys_dist_free(
+    PVFS_sys_dist* dist);
 
 int PVFS_sys_dist_setparam(
     PVFS_sys_dist* dist,
     const char* param,
     void* value);
-
 
 #endif
 

Index: pvfs2-util.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/include/pvfs2-util.h,v
diff -p -u -r1.21 -r1.22
--- pvfs2-util.h	14 Apr 2004 15:15:47 -0000	1.21
+++ pvfs2-util.h	20 May 2004 17:27:46 -0000	1.22
@@ -25,6 +25,7 @@ typedef struct PVFS_util_tab_s PVFS_util
 /* client side default credential generation */
 void PVFS_util_gen_credentials(
     PVFS_credentials *credentials);
+PVFS_credentials *PVFS_util_alloc_credentials(void);
 
 /* client side config file / option management */
 const PVFS_util_tab* PVFS_util_parse_pvfstab(
@@ -49,7 +50,7 @@ void PVFS_sys_free_mntent(
 int PVFS_util_lookup_parent(
     char *filename,
     PVFS_fs_id fs_id,
-    PVFS_credentials credentials,
+    PVFS_credentials *credentials,
     PVFS_handle * handle);
 int PVFS_util_remove_base_dir(
     char *pathname,



More information about the PVFS2-CVS mailing list