[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/server: iterate-handles.sm

CVS commit program cvs at parl.clemson.edu
Thu Jul 31 10:58:49 EDT 2008


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

Modified Files:
      Tag: small-file-branch
	iterate-handles.sm 
Log Message:
Added flag to mgmt iterate handles function to allow it to request reserved
handle values.  Will be used to get a list of known precreated handle values
so that they can be accounted for in fsck and validate tools.  Untested.


Index: iterate-handles.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/iterate-handles.sm,v
diff -p -u -r1.10.6.1 -r1.10.6.2
--- iterate-handles.sm	21 Feb 2008 02:10:21 -0000	1.10.6.1
+++ iterate-handles.sm	31 Jul 2008 14:58:48 -0000	1.10.6.2
@@ -90,18 +90,47 @@ static PINT_sm_action iterate_handles_do
     s_op->resp.u.mgmt_iterate_handles.position
 	= s_op->req->u.mgmt_iterate_handles.position;
 
-    ret = job_trove_dspace_iterate_handles(
-	s_op->req->u.mgmt_iterate_handles.fs_id,
-	s_op->resp.u.mgmt_iterate_handles.position,
-	s_op->resp.u.mgmt_iterate_handles.handle_array,
-	s_op->req->u.mgmt_iterate_handles.handle_count,
-	0,
-	NULL,
-	smcb,
-	0,
-	js_p,
-	&tmp_id,
-	server_job_context);
+    if(s_op->req->u.mgmt_iterate_handles.flags == PVFS_MGMT_RESERVED)
+    {
+        /* for now the only special case reserved handles are those that are
+         * allocated by precreate
+         */
+        ret = job_precreate_pool_iterate_handles(
+            s_op->req->u.mgmt_iterate_handles.fs_id,
+            s_op->resp.u.mgmt_iterate_handles.position,
+            s_op->resp.u.mgmt_iterate_handles.handle_array,
+            s_op->req->u.mgmt_iterate_handles.handle_count,
+            0,
+            NULL,
+            smcb,
+            0,
+            js_p,
+            &tmp_id,
+            server_job_context);
+    }
+    else if(s_op->req->u.mgmt_iterate_handles.flags == 0)
+    {
+        ret = job_trove_dspace_iterate_handles(
+            s_op->req->u.mgmt_iterate_handles.fs_id,
+            s_op->resp.u.mgmt_iterate_handles.position,
+            s_op->resp.u.mgmt_iterate_handles.handle_array,
+            s_op->req->u.mgmt_iterate_handles.handle_count,
+            0,
+            NULL,
+            smcb,
+            0,
+            js_p,
+            &tmp_id,
+            server_job_context);
+    }
+    else
+    {
+        gossip_err("Error: unsupported mgmt_iterate_handles flags: %d\n",
+            s_op->req->u.mgmt_iterate_handles.flags);
+        js_p->error_code = -PVFS_EINVAL;
+        return SM_ACTION_COMPLETE;
+    }
+
     if (ret < 0)
         return ret;  /* error */
     if (ret == 1)



More information about the Pvfs2-cvs mailing list