[PVFS2-CVS] commit by neill in pvfs2/src/io/trove/trove-dbpf: dbpf-bstream.c dbpf-dspace.c dbpf-keyval.c dbpf-mgmt.c

CVS commit program cvs at parl.clemson.edu
Mon Sep 13 13:17:53 EDT 2004


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

Modified Files:
	dbpf-bstream.c dbpf-dspace.c dbpf-keyval.c dbpf-mgmt.c 
Log Message:
- remove sync calls on readonly trove operations
- some cleanups


Index: dbpf-bstream.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-bstream.c,v
diff -p -u -r1.43 -r1.44
--- dbpf-bstream.c	3 Sep 2004 19:11:26 -0000	1.43
+++ dbpf-bstream.c	13 Sep 2004 16:17:53 -0000	1.44
@@ -128,8 +128,12 @@ static void aio_progress_notification(si
         gossip_debug(GOSSIP_TROVE_DEBUG, " aio_progress_notification: "
                      "op completed\n");
 
-        DBPF_AIO_SYNC_IF_NECESSARY(
-            op_p, op_p->u.b_rw_list.fd, ret, error_code);
+        if ((op_p->type == BSTREAM_WRITE_AT) ||
+            (op_p->type == BSTREAM_WRITE_LIST))
+        {
+            DBPF_AIO_SYNC_IF_NECESSARY(
+                op_p, op_p->u.b_rw_list.fd, ret, error_code);
+        }
 
         dbpf_open_cache_put(&op_p->u.b_rw_list.open_ref);
         op_p->u.b_rw_list.fd = -1;
@@ -145,8 +149,8 @@ static void aio_progress_notification(si
                      "(state is %d)\n",op_p->u.b_rw_list.list_proc_state);
 
         /* no operations currently in progress; convert and post some more */
-        op_p->u.b_rw_list.aiocb_array_count  = AIOCB_ARRAY_SZ;
-        op_p->u.b_rw_list.aiocb_array        = aiocb_p;
+        op_p->u.b_rw_list.aiocb_array_count = AIOCB_ARRAY_SZ;
+        op_p->u.b_rw_list.aiocb_array = aiocb_p;
 
         /* convert listio arguments into aiocb structures */
         aiocb_inuse_count = op_p->u.b_rw_list.aiocb_array_count;
@@ -285,8 +289,6 @@ static int dbpf_bstream_read_at_op_svc(s
         goto return_error;
     }
     
-    DBPF_ERROR_SYNC_IF_NECESSARY(op_p, tmp_ref.fd);
-
     dbpf_open_cache_put(&tmp_ref);
 
     gossip_debug(GOSSIP_TROVE_DEBUG, "read %d bytes.\n", ret);
@@ -425,11 +427,7 @@ static int dbpf_bstream_flush(TROVE_coll
                         flags,
                         context_id);
     
-    /* initialize the op-specific members */
-    /* there are none for flush */
-   
     *out_op_id_p = dbpf_queued_op_queue(q_op_p);
-    
     return 0;
 }
 
@@ -842,7 +840,6 @@ static inline int dbpf_bstream_rw_list(T
                  "(handle %Lu) and returned %d\n", q_op_p,
                  Lu(handle), ret);
 #endif
-
     return 0;
 }
 
@@ -911,13 +908,13 @@ static int dbpf_bstream_rw_list_op_svc(s
         memset(aiocb_p, 0, AIOCB_ARRAY_SZ*sizeof(struct aiocb));
         for (i=0; i < AIOCB_ARRAY_SZ; i++)
         {
-            aiocb_p[i].aio_lio_opcode            = LIO_NOP;
+            aiocb_p[i].aio_lio_opcode = LIO_NOP;
             aiocb_p[i].aio_sigevent.sigev_notify = SIGEV_NONE;
         }
 
-        op_p->u.b_rw_list.aiocb_array_count  = AIOCB_ARRAY_SZ;
-        op_p->u.b_rw_list.aiocb_array        = aiocb_p;
-        op_p->u.b_rw_list.list_proc_state    = LIST_PROC_INPROGRESS;
+        op_p->u.b_rw_list.aiocb_array_count = AIOCB_ARRAY_SZ;
+        op_p->u.b_rw_list.aiocb_array = aiocb_p;
+        op_p->u.b_rw_list.list_proc_state = LIST_PROC_INPROGRESS;
         op_p->u.b_rw_list.sigev.sigev_notify = SIGEV_NONE;
     }
     else
@@ -974,6 +971,13 @@ static int dbpf_bstream_rw_list_op_svc(s
         ret = 1;
 
       final_aio_cleanup:
+        if ((op_p->type == BSTREAM_WRITE_AT) ||
+            (op_p->type == BSTREAM_WRITE_LIST))
+        {
+            DBPF_AIO_SYNC_IF_NECESSARY(
+                op_p, op_p->u.b_rw_list.fd, ret, error_code);
+        }
+
         dbpf_open_cache_put(&op_p->u.b_rw_list.open_ref);
         op_p->u.b_rw_list.fd = -1;
 

Index: dbpf-dspace.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-dspace.c,v
diff -p -u -r1.113 -r1.114
--- dbpf-dspace.c	31 Aug 2004 17:47:34 -0000	1.113
+++ dbpf-dspace.c	13 Sep 2004 16:17:53 -0000	1.114
@@ -275,7 +275,7 @@ static int dbpf_dspace_create_op_svc(str
     /* add retrieved ds_attr to dbpf_attr cache here */
     ref.handle = new_handle;
     dbpf_attr_cache_insert(ref, &attr);
-    
+
     DBPF_DB_SYNC_IF_NECESSARY(op_p, tmp_ref.db_p);
 
     *op_p->u.d_create.out_handle_p = new_handle;
@@ -538,7 +538,7 @@ static int dbpf_dspace_iterate_handles_o
         }
     }
 
-return_ok:
+  return_ok:
     if (ret == DB_NOTFOUND)
     {
         /* if we ran off the end of the database, return TROVE_ITERATE_END */
@@ -576,8 +576,6 @@ return_ok:
 
     *op_p->u.d_iterate_handles.count_p = i;
 
-    DBPF_DB_SYNC_IF_NECESSARY(op_p, tmp_ref.db_p);
- 
     if(dbc_p)
     {
         dbc_p->c_close(dbc_p);
@@ -691,8 +689,6 @@ static int dbpf_dspace_verify_op_svc(str
     /* copy type value back into user's memory */
     *op_p->u.d_verify.type_p = s_attr.type;
 
-    DBPF_DB_SYNC_IF_NECESSARY(op_p, tmp_ref.db_p);
-
     dbpf_open_cache_attr_put(&tmp_ref);
     return 1;
 
@@ -991,8 +987,6 @@ static int dbpf_dspace_getattr_op_svc(st
 
     /* add retrieved ds_attr to dbpf_attr cache here */
     dbpf_attr_cache_insert(ref, attr);
-
-    DBPF_DB_SYNC_IF_NECESSARY(op_p, attr_ref.db_p);
 
     if (got_db)
     {

Index: dbpf-keyval.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-keyval.c,v
diff -p -u -r1.43 -r1.44
--- dbpf-keyval.c	1 Sep 2004 17:32:02 -0000	1.43
+++ dbpf-keyval.c	13 Sep 2004 16:17:53 -0000	1.44
@@ -164,8 +164,6 @@ static int dbpf_keyval_read_op_svc(struc
             (char *)op_p->u.k_read.key.buffer);
     }
 
-    DBPF_DB_SYNC_IF_NECESSARY(op_p, tmp_ref.db_p);
-
     dbpf_open_cache_put(&tmp_ref);
     return 1;
 
@@ -456,14 +454,15 @@ static int dbpf_keyval_iterate(TROVE_col
  * position of the last read keyval.
  *
  * If position is TROVE_ITERATE_END, then we hit the end previously,
- * so we just return that we are done and that there are 0 things read.
+ * so we just return that we are done and that there are 0 things
+ * read.
  *
  * Otherwise we read and return the position of the last read keyval.
  *
- * In all cases we read using DB_NEXT.  This is ok because it behaves like
- * DB_FIRST (read the first record) when called with an uninitialized
- * cursor (so we just don't initialize the cursor in the TROVE_ITERATE_START
- * case).
+ * In all cases we read using DB_NEXT.  This is ok because it behaves
+ * like DB_FIRST (read the first record) when called with an
+ * uninitialized cursor (so we just don't initialize the cursor in the
+ * TROVE_ITERATE_START case).
  *
  */
 static int dbpf_keyval_iterate_op_svc(struct dbpf_op *op_p)
@@ -634,8 +633,6 @@ return_ok:
 
     *op_p->u.k_iterate.count_p = i;
 
-    DBPF_DB_SYNC_IF_NECESSARY(op_p, tmp_ref.db_p);
-
     /* free the cursor */
     ret = dbc_p->c_close(dbc_p);
     if (ret != 0)
@@ -764,8 +761,6 @@ static int dbpf_keyval_read_list_op_svc(
 
         op_p->u.k_read_list.val_array[i].read_sz = data.size;
     }
-
-    DBPF_DB_SYNC_IF_NECESSARY(op_p, tmp_ref.db_p);
 
     dbpf_open_cache_put(&tmp_ref);
     return 1;

Index: dbpf-mgmt.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-mgmt.c,v
diff -p -u -r1.52 -r1.53
--- dbpf-mgmt.c	2 Aug 2004 17:29:23 -0000	1.52
+++ dbpf-mgmt.c	13 Sep 2004 16:17:53 -0000	1.53
@@ -923,15 +923,6 @@ static int dbpf_collection_iterate(TROVE
 
     *inout_count_p = i;
 
-    if (flags & TROVE_SYNC)
-    {
-        if ((ret = db_p->sync(db_p, 0)) != 0)
-        {
-	    error = -dbpf_db_error_to_trove_error(ret);
-	    goto return_error;
-        }
-    }
-
     ret = dbc_p->c_close(dbc_p);
     if (ret != 0)
     {



More information about the PVFS2-CVS mailing list