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

CVS commit program cvs at parl.clemson.edu
Mon Apr 7 11:07:47 EDT 2008


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

Modified Files:
      Tag: small-file-branch
	request-scheduler.c request-scheduler.h 
Log Message:
syncing small-file-branch back up with trunk at small-file-branch-point2 tag
(reverse merge)


Index: request-scheduler.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/request-scheduler/request-scheduler.c,v
diff -p -u -r1.65.16.4 -r1.65.16.5
--- request-scheduler.c	21 Feb 2008 02:10:28 -0000	1.65.16.4
+++ request-scheduler.c	7 Apr 2008 15:07:47 -0000	1.65.16.5
@@ -82,8 +82,8 @@ struct req_sched_element
     enum req_sched_states state;	/* state of this element */
     PVFS_handle handle;
     struct timeval tv;			/* used for timer events */
-    int readonly_flag;                  /* indicates a read only operation */
-
+    /* indicates type of access needed by this op */
+    enum PINT_server_req_access_type access_type;
     int mode_change; /* specifies that the element is a mode change */
     enum PVFS_server_mode mode; /* the mode to change to */
 };
@@ -282,10 +282,10 @@ static int PINT_req_sched_schedule_mode_
     /* NOTE: only transitions to admin mode are ever queued */
     if(sched_count == 0 && !qlist_empty(&mode_queue))
     {
-        next_element = qlist_entry(mode_queue.next, struct req_sched_element,
-                                   list_link);
-        next_element->state = REQ_READY_TO_SCHEDULE;
-        qlist_add_tail(&next_element->ready_link, &ready_queue);
+	next_element = qlist_entry(mode_queue.next, struct req_sched_element,
+	    list_link);
+	next_element->state = REQ_READY_TO_SCHEDULE;
+	qlist_add_tail(&next_element->ready_link, &ready_queue);
     }
     return 0;
 }
@@ -306,14 +306,13 @@ static void PINT_req_sched_do_change_mod
  *  \return 1 if request should proceed immediately, 0 if the
  *  request will be scheduled later, and -errno on failure
  */
-int PINT_req_sched_post(
-    enum PVFS_server_op op,
-    PVFS_fs_id fs_id,
-    PVFS_handle handle,
-    int readonly_flag,
-    int schedule,
-    void *in_user_ptr,
-    req_sched_id * out_id)
+int PINT_req_sched_post(enum PVFS_server_op op,
+                        PVFS_fs_id fs_id,
+                        PVFS_handle handle,
+                        enum PINT_server_req_access_type access_type,
+                        enum PINT_server_sched_policy sched_policy,
+			void *in_user_ptr,
+			req_sched_id * out_id)
 {
     struct qlist_head *hash_link;
     int ret = -1;
@@ -325,9 +324,9 @@ int PINT_req_sched_post(
     struct qlist_head *iterator;
     int tmp_flag;
 
-    if(!schedule)
+    if(sched_policy == PINT_SERVER_REQ_BYPASS)
     {
-        if(!readonly_flag && !PVFS_SERV_IS_MGMT_OP(op))
+        if(access_type == PINT_SERVER_REQ_MODIFY && !PVFS_SERV_IS_MGMT_OP(op))
         {
             /* if this requests modifies the file system, we have to check
              * to see if we are in admin mode or about to enter admin mode
@@ -364,10 +363,10 @@ int PINT_req_sched_post(
     tmp_element->state = REQ_QUEUED;
     tmp_element->handle = handle;
     tmp_element->list_head = NULL;
-    tmp_element->readonly_flag = readonly_flag;
+    tmp_element->access_type = access_type;
     tmp_element->mode_change = 0;
 
-    if(!readonly_flag && !PVFS_SERV_IS_MGMT_OP(op))
+    if(access_type == PINT_SERVER_REQ_MODIFY && !PVFS_SERV_IS_MGMT_OP(op))
     {
         if(PINT_req_sched_in_admin_mode())
         {
@@ -408,7 +407,9 @@ int PINT_req_sched_post(
     /* return 1 if the list is empty before we add this entry */
     ret = qlist_empty(&(tmp_list->req_list));
     if (ret == 1)
+    {
 	tmp_element->state = REQ_SCHEDULED;
+    }
     else
     {
         /* check queue to see if we can apply any optimizations */
@@ -455,7 +456,7 @@ int PINT_req_sched_post(
                 ret = 0;
             }
 	}
-	else if (readonly_flag &&
+	else if (access_type == PINT_SERVER_REQ_READONLY &&
 	    next_element->state == REQ_SCHEDULED &&
 	    last_element->state == REQ_SCHEDULED)
         {
@@ -468,7 +469,7 @@ int PINT_req_sched_post(
             {
                 tmp_element2 = qlist_entry(iterator, struct req_sched_element,
                     list_link);
-                if(!tmp_element2->readonly_flag)
+                if(tmp_element2->access_type == PINT_SERVER_REQ_MODIFY)
                 {
                     tmp_flag = 1;
                     break;
@@ -498,7 +499,7 @@ int PINT_req_sched_post(
              * dirent request to proceed.
              */
             tmp_element->state = REQ_SCHEDULED;
-            tmp_element->readonly_flag = 1;
+            tmp_element->access_type = PINT_SERVER_REQ_READONLY;
             gossip_debug(GOSSIP_REQ_SCHED_DEBUG, "REQ SCHED allowing "
                          "concurrent dirent op, handle: %llu\n", 
                          llu(handle));
@@ -812,13 +813,13 @@ int PINT_req_sched_release(
                         }
                     }
                 }
-                else if(next_element->readonly_flag)
+                else if(next_element->access_type == PINT_SERVER_REQ_READONLY)
                 {
                     /* keep going as long as the operations are read only;
                      * we let these all go concurrently
                      */
                     while (next_element &&
-                           (next_element->readonly_flag) &&
+                           (next_element->access_type == PINT_SERVER_REQ_READONLY) &&
                            (next_element->list_link.next != &(tmp_list->req_list)))
                     {
                         next_element =
@@ -826,7 +827,7 @@ int PINT_req_sched_release(
                                         struct req_sched_element,
                                         list_link);
                         if (next_element &&
-                            (next_element->readonly_flag))
+                            (next_element->access_type == PINT_SERVER_REQ_READONLY))
                         {
                             gossip_debug(
                                 GOSSIP_REQ_SCHED_DEBUG,

Index: request-scheduler.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/request-scheduler/request-scheduler.h,v
diff -p -u -r1.15.66.1 -r1.15.66.2
--- request-scheduler.h	21 Feb 2008 02:10:28 -0000	1.15.66.1
+++ request-scheduler.h	7 Apr 2008 15:07:47 -0000	1.15.66.2
@@ -24,6 +24,16 @@
 
 typedef PVFS_id_gen_t req_sched_id;
 typedef int req_sched_error_code;
+enum PINT_server_req_access_type
+{
+    PINT_SERVER_REQ_READONLY = 0,
+    PINT_SERVER_REQ_MODIFY
+};
+enum PINT_server_sched_policy
+{
+    PINT_SERVER_REQ_BYPASS = 0,
+    PINT_SERVER_REQ_SCHEDULE
+};
 
 /* setup and teardown */
 int PINT_req_sched_initialize(
@@ -37,8 +47,8 @@ int PINT_req_sched_finalize(
 int PINT_req_sched_post(enum PVFS_server_op op,
                         PVFS_fs_id fs_id,
                         PVFS_handle handle,
-                        int read_only_flag,
-                        int schedule,
+                        enum PINT_server_req_access_type access_type,
+                        enum PINT_server_sched_policy sched_policy,
 			void *in_user_ptr,
 			req_sched_id * out_id);
 



More information about the Pvfs2-cvs mailing list