Whamcloud - gitweb
LU-5061 obd: add lnb_ prefix to members of struct niobuf_local
[fs/lustre-release.git] / lustre / obdecho / echo_client.c
index b893534..6905ce6 100644 (file)
@@ -2289,8 +2289,12 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
 
 static void echo_put_object(struct echo_object *eco)
 {
-        if (cl_echo_object_put(eco))
-                CERROR("echo client: drop an object failed");
+       int rc;
+
+       rc = cl_echo_object_put(eco);
+       if (rc)
+               CERROR("%s: echo client drop an object failed: rc = %d\n",
+                      eco->eo_dev->ed_ec->ec_exp->exp_obd->obd_name, rc);
 }
 
 static void
@@ -2543,14 +2547,14 @@ static int echo_client_prep_commit(const struct lu_env *env,
                 LASSERT(lpages == npages);
 
                 for (i = 0; i < lpages; i++) {
-                       struct page *page = lnb[i].page;
+                       struct page *page = lnb[i].lnb_page;
 
-                        /* read past eof? */
-                        if (page == NULL && lnb[i].rc == 0)
-                                continue;
+                       /* read past eof? */
+                       if (page == NULL && lnb[i].lnb_rc == 0)
+                               continue;
 
-                        if (async)
-                                lnb[i].flags |= OBD_BRW_ASYNC;
+                       if (async)
+                               lnb[i].lnb_flags |= OBD_BRW_ASYNC;
 
                        if (ostid_id(&oa->o_oi) == ECHO_PERSISTENT_OBJID ||
                            (oa->o_valid & OBD_MD_FLFLAGS) == 0 ||
@@ -2601,7 +2605,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
         struct obdo *oa = &data->ioc_obdo1;
         struct echo_object *eco;
         int rc;
-        int async = 1;
+        int async = 0;
         long test_mode;
         ENTRY;
 
@@ -2615,14 +2619,14 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
 
        /* OFD/obdfilter works only via prep/commit */
         test_mode = (long)data->ioc_pbuf1;
-        if (test_mode == 1)
-                async = 0;
-
         if (ed->ed_next == NULL && test_mode != 3) {
                 test_mode = 3;
                 data->ioc_plen1 = data->ioc_count;
         }
 
+       if (test_mode == 3)
+               async = 1;
+
         /* Truncate batch size to maximum */
         if (data->ioc_plen1 > PTLRPC_MAX_BRW_SIZE)
                 data->ioc_plen1 = PTLRPC_MAX_BRW_SIZE;