[PVFS2-CVS] commit by slang in pvfs2/src/io/trove: pvfs2-storage.h trove.c trove.h

CVS commit program cvs at parl.clemson.edu
Thu Aug 25 17:38:28 EDT 2005


Update of /projects/cvsroot/pvfs2/src/io/trove
In directory parlweb:/tmp/cvs-serv7520/src/io/trove

Modified Files:
      Tag: slang-event-changes-branch
	pvfs2-storage.h trove.c trove.h 
Log Message:
updates to my event changes to bring them inline with trunk


Index: pvfs2-storage.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/pvfs2-storage.h,v
diff -p -u -r1.9 -r1.9.2.1
--- pvfs2-storage.h	25 May 2005 18:35:25 -0000	1.9
+++ pvfs2-storage.h	25 Aug 2005 20:38:28 -0000	1.9.2.1
@@ -19,6 +19,8 @@ enum PVFS_coll_getinfo_options_e
 };
 typedef enum PVFS_coll_getinfo_options_e PVFS_coll_getinfo_options;
 
+/* key/value descriptor definition moved to include/pvfs2-types.h */
+#if 0
 /* key/value descriptors */
 struct PVFS_ds_keyval_s
 {
@@ -30,6 +32,7 @@ struct PVFS_ds_keyval_s
 };
 
 typedef struct PVFS_ds_keyval_s PVFS_ds_keyval;
+#endif
 
 /* vtag; contents not yet defined */
 struct PVFS_vtag_s

Index: trove.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove.c,v
diff -p -u -r1.2 -r1.2.6.1
--- trove.c	21 Dec 2004 17:52:19 -0000	1.2
+++ trove.c	25 Aug 2005 20:38:28 -0000	1.2.6.1
@@ -276,6 +276,13 @@ int trove_keyval_read(
 {
     int method_id;
 
+	 /* Check arguments */
+	 if (key_p->buffer_sz < 2)
+		 return -TROVE_EINVAL;
+	 if (((char *)key_p->buffer)[key_p->buffer_sz-1] != 0)
+		 return -TROVE_EINVAL;
+
+	 /* Look up collection id */
     method_id = map_coll_id_to_method(coll_id);
     if (method_id < 0) {
         return -1; /* NEED STATUS TYPE FOR THIS */
@@ -293,6 +300,11 @@ int trove_keyval_read(
 }
 
 /** Initiate write of a single keyword/value pair.
+ *
+ *  Expects val_p->buffer to be user allocated and val_p->buffer_sz to
+ *  be size of buffer allocated.
+ *  If data is too large for buffer, returns error (Cannot allocate
+ *  Memory) and returns needed size in val_p->read_sz
  */
 int trove_keyval_write(
     TROVE_coll_id coll_id,
@@ -307,6 +319,13 @@ int trove_keyval_write(
 {
     int method_id;
 
+	 /* Check arguments */
+	 if (key_p->buffer_sz < 2)
+		 return -TROVE_EINVAL;
+	 if (((char *)key_p->buffer)[key_p->buffer_sz-1] != 0)
+		 return -TROVE_EINVAL;
+
+	 /* Look up collection id */
     method_id = map_coll_id_to_method(coll_id);
     if (method_id < 0) {
         return -1; /* NEED STATUS TYPE FOR THIS */
@@ -457,7 +476,18 @@ int trove_keyval_read_list(
     TROVE_op_id* out_op_id_p)
 {
     int method_id;
+	 int i;
 
+	 /* Check arguments */
+	 for (i = 0; i < count; i++)
+	 {
+	 	if (key_array[i].buffer_sz < 2)
+		 	return -TROVE_EINVAL;
+	 	if (((char *)key_array[i].buffer)[key_array[i].buffer_sz-1] != 0)
+		 	return -TROVE_EINVAL;
+	 }
+
+	 /* Look up collection id */
     method_id = map_coll_id_to_method(coll_id);
     if (method_id < 0) {
         return -1; /* NEED STATUS TYPE FOR THIS */
@@ -491,7 +521,18 @@ int trove_keyval_write_list(
     TROVE_op_id* out_op_id_p)
 {
     int method_id;
+	 int i;
+
+	 /* Check arguments */
+	 for (i = 0; i < count; i++)
+	 {
+	 	if (key_array[i].buffer_sz < 2)
+		 	return -TROVE_EINVAL;
+	 	if (((char *)key_array[i].buffer)[key_array[i].buffer_sz-1] != 0)
+		 	return -TROVE_EINVAL;
+	 }
 
+	 /* Look up collection id */
     method_id = map_coll_id_to_method(coll_id);
     if (method_id < 0) {
         return -1; /* NEED STATUS TYPE FOR THIS */

Index: trove.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove.h,v
diff -p -u -r1.26 -r1.26.6.1
--- trove.h	21 Dec 2004 17:52:19 -0000	1.26
+++ trove.h	25 Aug 2005 20:38:28 -0000	1.26.6.1
@@ -45,12 +45,15 @@ enum
     TROVE_DIR,
 };
 
+/* TROVE_ds_flags */
 /* TROVE operation flags */
 enum
 {
     TROVE_SYNC = 1,
     TROVE_ATOMIC = 2,
-    TROVE_FORCE_REQUESTED_HANDLE = 4
+    TROVE_FORCE_REQUESTED_HANDLE = 4,
+    TROVE_NOOVERWRITE = 8, /* keyval_write and keyval_write_list */
+    TROVE_ONLYOVERWRITE = 16, /* keyval_write and keyval_write_list */
 };
 
 /* get/setinfo option flags */



More information about the PVFS2-CVS mailing list