[Pvfs2-cvs] commit by aching in pvfs2-1/src/server: lock.sm

CVS commit program cvs at parl.clemson.edu
Wed Jan 31 00:12:50 EST 2007


Update of /projects/cvsroot/pvfs2-1/src/server
In directory parlweb1:/tmp/cvs-serv10947/server

Modified Files:
      Tag: version-lock-actual-branch
	lock.sm 
Log Message:

More functionality...untested.


Index: lock.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/Attic/lock.sm,v
diff -p -u -r1.1.2.1 -r1.1.2.2
--- lock.sm	28 Sep 2006 20:54:46 -0000	1.1.2.1
+++ lock.sm	31 Jan 2007 05:12:50 -0000	1.1.2.2
@@ -66,6 +66,7 @@ machine pvfs2_lock_sm(
 static int lock_change_lock(
     PINT_server_op *s_op, job_status_s* js_p)
 {
+    int ret = -1;
     PVFS_object_ref object_ref;
     PINT_request_file_data fdata;
     memset(&s_op->resp.u.lock, 0, sizeof(struct PVFS_servresp_lock));
@@ -82,26 +83,42 @@ static int lock_change_lock(
     fdata.fsize = s_op->ds_attr.b_size;
     fdata.extend_flag = 1;
 
-    /* print_lock_file_table_all_info(); */
     if (s_op->req->u.lock.lock_type == PVFS_ACQUIRE)
     {
-	add_lock_req(&object_ref,
-		     s_op->req->u.lock.io_type,
-		     s_op->req->u.lock.file_req,
-		     s_op->req->u.lock.file_req_offset,
-		     &fdata,
-		     s_op->req->u.lock.aggregate_size,
-		     0,
-		     s_op->req->u.lock.aggregate_size,
-		     &(s_op->resp.u.lock.lock_id),
-		     &(s_op->resp.u.lock.granted_bytes));
+	lock_req_t *lock_req_p;
+	
+	ret = add_lock_req(&object_ref,
+			   s_op->req->u.lock.io_type,
+			   s_op->req->u.lock.file_req,
+			   s_op->req->u.lock.file_req_offset,
+			   &fdata,
+			   s_op->req->u.lock.nonblock_size,
+			   s_op->req->u.lock.block_size,
+			   s_op->req->u.lock.aggregate_size,
+			   &(s_op->resp.u.lock.lock_id),
+			   &(s_op->resp.u.lock.granted_bytes),
+			   &lock_req_p);
+	/* Set this to NULL so that it isn't killed at the end of the
+	 * operation. */
+	s_op->req->u.lock.file_req = NULL;
+	if (ret == 0)
+	{
+	    int err = -1;
+	    
+	    gossip_debug(GOSSIP_LOCK_DEBUG, 
+			 "lock_change_lock: starting job\n");
+	    
+	    err = job_lock_wait_block_bytes(s_op,
+					    lock_req_p);
+	    return err;
+	}
     }
     else
     {
-	del_lock_req(&object_ref,
-		     s_op->req->u.lock.file_req_offset,
-		     s_op->req->u.lock.aggregate_size,
-		     &(s_op->resp.u.lock.granted_bytes));
+	revise_lock_req(&object_ref,
+			s_op->req->u.lock.lock_id,
+			s_op->req->u.lock.block_size,
+			&(s_op->resp.u.lock.granted_bytes));
     }
 #if 0
     print_lock_file_table_all_info();



More information about the Pvfs2-cvs mailing list