[Pvfs2-cvs] commit by mtmoore in pvfs2/src/io/trove: trove-internal.h trove.c trove.h

CVS commit program cvs at parl.clemson.edu
Tue Jul 14 13:19:41 EDT 2009


Update of /projects/cvsroot/pvfs2/src/io/trove
In directory parlweb1:/tmp/cvs-serv2435/src/io/trove

Modified Files:
      Tag: Orange-mtmoore
	trove-internal.h trove.c trove.h 
Log Message:
Initial import of branch supporting keyval attribute/value lookup


Index: trove-internal.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-internal.h,v
diff -p -u -r1.30 -r1.30.24.1
--- trove-internal.h	29 Jan 2009 23:39:52 -0000	1.30
+++ trove-internal.h	14 Jul 2009 17:19:36 -0000	1.30.24.1
@@ -129,7 +129,20 @@ struct TROVE_keyval_ops
 		       TROVE_context_id context_id,
 		       TROVE_op_id *out_op_id_p,
                PVFS_hint hints);
-    
+
+   int (*keyval_read_value)(
+                               TROVE_coll_id coll_id,
+                               TROVE_ds_position* position_p,
+                               PVFS_dirent* dirent_p,
+                               TROVE_keyval_s* key_p,
+                               TROVE_keyval_s* val_p,
+                               TROVE_ds_flags flags,
+                               TROVE_vtag_s* vtag,
+                               void* user_ptr,
+                               TROVE_context_id context_id,
+                               TROVE_op_id* out_op_id_p,
+               PVFS_hint hints);
+
     int (*keyval_write)(
 			TROVE_coll_id coll_id,
 			TROVE_handle handle,

Index: trove.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove.c,v
diff -p -u -r1.14 -r1.14.24.1
--- trove.c	20 Nov 2008 01:17:02 -0000	1.14
+++ trove.c	14 Jul 2009 17:19:36 -0000	1.14.24.1
@@ -343,6 +343,54 @@ int trove_keyval_read(
            hints);
 }
 
+
+/** Initiate read of a single keyword/value pair based on <attr><value>. 
+ * The secondary keyval index is used to perform this lookup.
+ */
+int trove_keyval_read_value(
+    TROVE_coll_id coll_id,
+    TROVE_ds_position *position_p,
+    PVFS_dirent* dirent_p,
+    TROVE_keyval_s* key_p,
+    TROVE_keyval_s* val_p,
+    TROVE_ds_flags flags,
+    TROVE_vtag_s* vtag,
+    void* user_ptr,
+    TROVE_context_id context_id,
+    TROVE_op_id* out_op_id_p,
+    PVFS_hint  hints)
+{
+    TROVE_method_id method_id;
+
+    method_id = global_trove_method_callback(coll_id);
+    if(method_id < 0)
+    {
+	return -TROVE_EINVAL;
+    }
+
+    /* Check arguments */
+    if (key_p->buffer_sz < 2)
+	return -TROVE_EINVAL;
+    if(!(flags & TROVE_BINARY_KEY))
+    {
+        if (((char *)key_p->buffer)[key_p->buffer_sz-1] != 0)
+	    return -TROVE_EINVAL;
+    }
+
+    return keyval_method_table[method_id]->keyval_read_value(
+           coll_id,
+           position_p,
+           dirent_p,
+           key_p,
+           val_p,
+           flags,
+           vtag,
+           user_ptr,
+           context_id,
+           out_op_id_p,
+           hints);
+}
+
 /** Initiate write of a single keyword/value pair.
  *
  *  Expects val_p->buffer to be user allocated and val_p->buffer_sz to

Index: trove.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove.h,v
diff -p -u -r1.45 -r1.45.24.1
--- trove.h	29 Jan 2009 23:39:52 -0000	1.45
+++ trove.h	14 Jul 2009 17:19:38 -0000	1.45.24.1
@@ -264,6 +264,19 @@ int trove_keyval_read(
 		      TROVE_op_id *out_op_id_p,
               PVFS_hint hints);
 
+int trove_keyval_read_value(
+		      TROVE_coll_id coll_id,
+                      TROVE_ds_position *position_p,
+                      PVFS_dirent *dirent_p,
+		      TROVE_keyval_s *key_p,
+		      TROVE_keyval_s *val_p,
+		      TROVE_ds_flags flags,
+		      TROVE_vtag_s *vtag, 
+		      void *user_ptr,
+		      TROVE_context_id context_id,
+		      TROVE_op_id *out_op_id_p,
+              PVFS_hint hints);
+
 int trove_keyval_write(
 		       TROVE_coll_id coll_id,
 		       TROVE_handle handle,



More information about the Pvfs2-cvs mailing list