[Pvfs2-cvs] commit by kunkel in pvfs2/src/server/request-scheduler: request-scheduler.c

CVS commit program cvs at parl.clemson.edu
Sat Feb 17 06:17:16 EST 2007


Update of /projects/cvsroot/pvfs2/src/server/request-scheduler
In directory parlweb1:/tmp/cvs-serv2872/src/server/request-scheduler

Modified Files:
      Tag: kunkel-migration-branch
	request-scheduler.c 
Log Message:
Update migration branch to current CVS version


Index: request-scheduler.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/request-scheduler/request-scheduler.c,v
diff -p -u -r1.63.4.1 -r1.63.4.2
--- request-scheduler.c	8 Sep 2006 11:51:23 -0000	1.63.4.1
+++ request-scheduler.c	17 Feb 2007 11:17:16 -0000	1.63.4.2
@@ -39,6 +39,16 @@
 #include "id-generator.h"
 #include "pvfs2-internal.h"
 
+/* we need the server header because it defines the operations that
+ * we use to determine whether to schedule or queue.  
+ *
+ * TODO: To make the request scheduler more generic we 
+ * should probably have callbacks that get defined in 
+ * the server code that determine whether to queue or 
+ * schedule, print the operation name, etc.
+ */
+#include "src/server/pvfs2-server.h"
+
 /** request states */
 enum req_sched_states
 {
@@ -293,6 +303,11 @@ int PINT_req_sched_target_handle(
 	*handle = req->u.flush.handle;
 	*fs_id = req->u.flush.fs_id;
 	return (0);
+    case PVFS_SERV_LISTATTR:
+        *readonly_flag = 1;
+        *fs_id = req->u.listattr.fs_id;
+	*handle = PVFS_HANDLE_NULL;
+        return 0;
     case PVFS_SERV_MGMT_NOOP:
 	return (1);
     case PVFS_SERV_MGMT_PERF_MON:
@@ -619,34 +634,14 @@ int PINT_req_sched_post(
             /* possible dirent optimization: see if all scheduled ops for this
              * handle are for crdirent or rmdirent.  
              * If so, we can allow another concurrent
-             * dirent request to proceed 
+             * dirent request to proceed.
              */
-            tmp_flag = 0;
-            qlist_for_each(iterator, &tmp_list->req_list)
-            {
-                tmp_element2 = qlist_entry(iterator, struct req_sched_element,
-                    list_link);
-                if(tmp_element2->req_ptr->op != PVFS_SERV_CRDIRENT && 
-                   tmp_element2->req_ptr->op != PVFS_SERV_RMDIRENT)
-                {
-                    tmp_flag = 1;
-                    break;
-                }
-            }
-
-            if(!tmp_flag)
-            {
-                tmp_element->state = REQ_SCHEDULED;
-                ret = 1;
-                gossip_debug(GOSSIP_REQ_SCHED_DEBUG, "REQ SCHED allowing "
-                             "concurrent dirent op, handle: %llu\n", 
-                             llu(handle));
-            }
-            else
-            {
-                tmp_element->state = REQ_QUEUED;
-                ret = 0;
-            }
+            tmp_element->state = REQ_SCHEDULED;
+            tmp_element->readonly_flag = 1;
+            gossip_debug(GOSSIP_REQ_SCHED_DEBUG, "REQ SCHED allowing "
+                         "concurrent dirent op, handle: %llu\n", 
+                         llu(handle));
+            ret = 1;
         }
 	else
 	{
@@ -661,7 +656,7 @@ int PINT_req_sched_post(
 
     gossip_debug(GOSSIP_REQ_SCHED_DEBUG,
 		 "REQ SCHED POSTING, handle: %llu, queue_element: %p\n",
-		 llu(handle), tmp_element);
+                 llu(handle), tmp_element);
 
     if (ret == 1)
     {
@@ -1272,7 +1267,8 @@ int PINT_req_sched_testworld(
 	tmp_element->state = REQ_SCHEDULED;
 	(*inout_count_p)++;
 	gossip_debug(GOSSIP_REQ_SCHED_DEBUG,
-		     "REQ SCHED SCHEDULING, handle: %llu, queue_element: %p\n",
+		     "REQ SCHED SCHEDULING, "
+                     "handle: %llu, queue_element: %p\n",
 		     llu(tmp_element->handle), tmp_element);
 	/* if this is a mode change, then transition now */
 	if(tmp_element->req_ptr->op == PVFS_SERV_MGMT_SETPARAM &&



More information about the Pvfs2-cvs mailing list