X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftarget%2Fupdate_trans.c;h=f9dc367b0be086498c2fc64c0d2780251d2cc110;hb=1ca1da79a9e6b2af9f89a6c237d40b0333f64965;hp=36ab33192e1ff58cde35f8430af24c33c6eed076;hpb=92bbd06e4ddd2505fceaada9cda4bb0974733204;p=fs%2Flustre-release.git diff --git a/lustre/target/update_trans.c b/lustre/target/update_trans.c index 36ab331..f9dc367 100644 --- a/lustre/target/update_trans.c +++ b/lustre/target/update_trans.c @@ -20,7 +20,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2015, 2016, Intel Corporation. + * Copyright (c) 2015, 2017, Intel Corporation. */ /* * lustre/target/update_trans.c @@ -201,7 +201,17 @@ static int sub_updates_write(const struct lu_env *env, "lrh_len %u record_size %zu\n", record->lur_hdr.lrh_len, llog_update_record_size(record)); - if (likely(record->lur_hdr.lrh_len <= ctxt->loc_chunk_size)) { + /* + * If its size > llog chunk_size, then write current chunk to the update + * llog, NB the padding should >= LLOG_MIN_REC_SIZE. + * + * So check padding length is either >= LLOG_MIN_REC_SIZE or is 0 + * (record length just matches the chunk size). + */ + + reclen = record->lur_hdr.lrh_len; + if (reclen + LLOG_MIN_REC_SIZE <= ctxt->loc_chunk_size || + reclen == ctxt->loc_chunk_size) { OBD_ALLOC_PTR(stc); if (stc == NULL) GOTO(llog_put, rc = -ENOMEM); @@ -245,13 +255,6 @@ static int sub_updates_write(const struct lu_env *env, else eof = true; - /* - * If its size > llog chunk_size, then write current chunk to - * the update llog, NB the padding should >= LLOG_MIN_REC_SIZE. - * - * So check padding length is either >= LLOG_MIN_REC_SIZE or is - * 0 (record length just matches the chunk size). - */ reclen = __llog_update_record_size( __update_records_size(next - start)); if ((reclen + LLOG_MIN_REC_SIZE <= ctxt->loc_chunk_size || @@ -612,8 +615,6 @@ top_trans_create(const struct lu_env *env, struct dt_device *master_dev) child_th->th_top = &top_th->tt_super; child_th->th_wait_submit = 1; top_th->tt_master_sub_thandle = child_th; - - top_th->tt_super.th_tags |= child_th->th_tags; } return &top_th->tt_super; } @@ -792,7 +793,6 @@ int top_trans_start(const struct lu_env *env, struct dt_device *master_dev, top_th->tt_master_sub_thandle->th_sync = th->th_sync; if (th->th_local) top_th->tt_master_sub_thandle->th_local = th->th_local; - top_th->tt_master_sub_thandle->th_tags = th->th_tags; rc = dt_trans_start(env, top_th->tt_master_sub_thandle->th_dev, top_th->tt_master_sub_thandle); RETURN(rc); @@ -810,7 +810,6 @@ int top_trans_start(const struct lu_env *env, struct dt_device *master_dev, st->st_sub_th->th_sync = th->th_sync; if (th->th_local) st->st_sub_th->th_local = th->th_local; - st->st_sub_th->th_tags = th->th_tags; rc = dt_trans_start(env, st->st_sub_th->th_dev, st->st_sub_th); if (rc != 0) @@ -948,7 +947,6 @@ int top_trans_stop(const struct lu_env *env, struct dt_device *master_dev, top_th->tt_master_sub_thandle->th_sync = th->th_sync; if (th->th_local) top_th->tt_master_sub_thandle->th_local = th->th_local; - top_th->tt_master_sub_thandle->th_tags = th->th_tags; rc = dt_trans_stop(env, master_dev, top_th->tt_master_sub_thandle); OBD_FREE_PTR(top_th); @@ -1008,7 +1006,6 @@ stop_master_trans: master_st->st_sub_th->th_local = th->th_local; if (th->th_sync) master_st->st_sub_th->th_sync = th->th_sync; - master_st->st_sub_th->th_tags = th->th_tags; master_st->st_sub_th->th_result = th->th_result; rc = dt_trans_stop(env, master_st->st_dt, master_st->st_sub_th); /* If it does not write_updates, then we call submit callback @@ -1072,7 +1069,6 @@ stop_other_trans: st->st_sub_th->th_sync = th->th_sync; if (th->th_local) st->st_sub_th->th_local = th->th_local; - st->st_sub_th->th_tags = th->th_tags; st->st_sub_th->th_result = th->th_result; rc = dt_trans_stop(env, st->st_sub_th->th_dev, st->st_sub_th);