Whamcloud - gitweb
b=21647 add support for async journal commit in echo client
authorOleg Drokin <oleg.drokin@oracle.com>
Fri, 21 May 2010 20:48:45 +0000 (22:48 +0200)
committerJohann Lombardi <johann@sun.com>
Fri, 21 May 2010 20:48:45 +0000 (22:48 +0200)
i=johann
i=andrew

lustre/ChangeLog
lustre/obdecho/echo_client.c
lustre/obdfilter/filter_io.c

index 5eee896..b5852fe 100644 (file)
@@ -40,6 +40,10 @@ Severity   : enhancement
 Bugzilla   : 22402
 Description: add new OBDFILTER_SURVEY test suite
 
+Severity   : enhancement
+Bugzilla   : 21647
+Description: add support for async journal commit in echo client
+
 Severity   : normal
 Bugzilla   : 22610
 Description: a race condition could lead to SIGBUS being sent to an
index 500488d..ab3169f 100644 (file)
@@ -528,6 +528,7 @@ static int echo_client_kbrw(struct obd_device *obd, int rw, struct obdo *oa,
         int                     rc;
         int                     verify;
         int                     gfp_mask;
+        int                     brw_flags = 0;
 
         verify = ((oa->o_id) != ECHO_PERSISTENT_OBJID &&
                   (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
@@ -543,6 +544,9 @@ static int echo_client_kbrw(struct obd_device *obd, int rw, struct obdo *oa,
             (count & (~CFS_PAGE_MASK)) != 0)
                 return (-EINVAL);
 
+        if (rw == OBD_BRW_WRITE)
+                brw_flags = OBD_BRW_ASYNC;
+
         set =  ptlrpc_prep_set();
         if (set == NULL)
                 RETURN(-ENOMEM);
@@ -567,7 +571,7 @@ static int echo_client_kbrw(struct obd_device *obd, int rw, struct obdo *oa,
 
                 pgp->count = CFS_PAGE_SIZE;
                 pgp->off = off;
-                pgp->flag = 0;
+                pgp->flag = brw_flags;
 
                 if (verify)
                         echo_client_page_debug_setup(lsm, pgp->pg, rw,
@@ -715,6 +719,7 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
         struct echo_async_state *eas;
         int rc = 0;
         struct echo_async_page **aps = NULL;
+        int brw_flags = 0;
 
         ENTRY;
 #if 0
@@ -743,6 +748,9 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
         if (NULL == eas)
                 return(-ENOMEM);
 
+        if (rw == OBD_BRW_WRITE)
+                brw_flags = OBD_BRW_ASYNC;
+
         memcpy(&eas->eas_oa, oa, sizeof(*oa));
         eas->eas_next_offset = offset;
         eas->eas_end_offset = offset + count;
@@ -828,7 +836,7 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
 
                 /* always asserts urgent, which isn't quite right */
                 rc = obd_queue_async_io(exp, lsm, NULL, eap->eap_cookie,
-                                        rw, 0, CFS_PAGE_SIZE, 0,
+                                        rw, 0, CFS_PAGE_SIZE, brw_flags,
                                         ASYNC_READY | ASYNC_URGENT |
                                         ASYNC_COUNT_STABLE);
                 spin_lock(&eas->eas_lock);
index cedc414..a147076 100644 (file)
@@ -1002,6 +1002,7 @@ int filter_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
                 lnb[i].page = pga[i].pg;
                 rnb[i].offset = pga[i].off;
                 rnb[i].len = pga[i].count;
+                lnb[i].flags = rnb[i].flags = pga[i].flag;
         }
 
         obdo_to_ioobj(oinfo->oi_oa, &ioo);