Whamcloud - gitweb
LU-3335 scrub: OI scrub on OST
[fs/lustre-release.git] / lustre / target / tgt_lastrcvd.c
index b8da83f..5c221aa 100644 (file)
@@ -112,6 +112,9 @@ int tgt_client_data_read(const struct lu_env *env, struct lu_target *tgt,
        if (rc == 0) {
                check_lcd(tgt->lut_obd->obd_name, index, &tti->tti_lcd);
                lcd_le_to_cpu(&tti->tti_lcd, lcd);
+               lcd->lcd_last_result = ptlrpc_status_ntoh(lcd->lcd_last_result);
+               lcd->lcd_last_close_result =
+                       ptlrpc_status_ntoh(lcd->lcd_last_close_result);
        }
 
        CDEBUG(D_INFO, "%s: read lcd @%lld uuid = %s, last_transno = "LPU64
@@ -132,6 +135,9 @@ int tgt_client_data_write(const struct lu_env *env, struct lu_target *tgt,
 {
        struct tgt_thread_info *tti = tgt_th_info(env);
 
+       lcd->lcd_last_result = ptlrpc_status_hton(lcd->lcd_last_result);
+       lcd->lcd_last_close_result =
+               ptlrpc_status_hton(lcd->lcd_last_close_result);
        lcd_cpu_to_le(lcd, &tti->tti_lcd);
        tti_buf_lcd(tti);
 
@@ -455,7 +461,7 @@ int tgt_last_commit_cb_add(struct thandle *th, struct lu_target *tgt,
                OBD_FREE_PTR(ccb);
        }
 
-       if ((exp->exp_connect_flags & OBD_CONNECT_LIGHTWEIGHT) != 0)
+       if (exp_connect_flags(exp) & OBD_CONNECT_LIGHTWEIGHT)
                /* report failure to force synchronous operation */
                return -EPERM;
 
@@ -535,7 +541,7 @@ int tgt_client_new(const struct lu_env *env, struct obd_export *exp)
 
        mutex_init(&ted->ted_lcd_lock);
 
-       if ((exp->exp_connect_flags & OBD_CONNECT_LIGHTWEIGHT) != 0)
+       if (exp_connect_flags(exp) & OBD_CONNECT_LIGHTWEIGHT)
                RETURN(0);
 
        /* the bitmap operations can handle cl_idx > sizeof(long) * 8, so
@@ -599,7 +605,7 @@ int tgt_client_add(const struct lu_env *env,  struct obd_export *exp, int idx)
        LASSERTF(idx >= 0, "%d\n", idx);
 
        if (!strcmp(ted->ted_lcd->lcd_uuid, tgt->lut_obd->obd_uuid.uuid) ||
-           (exp->exp_connect_flags & OBD_CONNECT_LIGHTWEIGHT) != 0)
+           exp_connect_flags(exp) & OBD_CONNECT_LIGHTWEIGHT)
                RETURN(0);
 
        if (test_and_set_bit(idx, tgt->lut_client_bitmap)) {
@@ -636,7 +642,7 @@ int tgt_client_del(const struct lu_env *env, struct obd_export *exp)
        /* XXX if lcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
        if (!strcmp((char *)ted->ted_lcd->lcd_uuid,
                    (char *)tgt->lut_obd->obd_uuid.uuid) ||
-           (exp->exp_connect_flags & OBD_CONNECT_LIGHTWEIGHT) != 0)
+           exp_connect_flags(exp) & OBD_CONNECT_LIGHTWEIGHT)
                RETURN(0);
 
        CDEBUG(D_INFO, "%s: del client at idx %u, off %lld, UUID '%s'\n",