X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fllog_reader.c;h=b03d5dfd08b8d754f8ca9749d2b730ef06c8c628;hb=6b8e97b76c472068e7d6bc792e4f202b2f70ca67;hp=c71698c5e0b58c1aa62b7a2f53af86810959eae5;hpb=66dcbd503fd5528f1f000ef6e2e4233f7fa8b567;p=fs%2Flustre-release.git diff --git a/lustre/utils/llog_reader.c b/lustre/utils/llog_reader.c index c71698c..b03d5df 100644 --- a/lustre/utils/llog_reader.c +++ b/lustre/utils/llog_reader.c @@ -886,8 +886,8 @@ void print_update_rec(struct llog_update_record *lur) up_count = __le32_to_cpu(rec->ur_update_count); pm_count = __le32_to_cpu(rec->ur_param_count); printf("updatelog record master_transno:%llu batchid:%llu flags:0x%x u_index:%d u_count:%d p_count:%d\n", - __le64_to_cpu(rec->ur_master_transno), - __le64_to_cpu(rec->ur_batchid), + (unsigned long long)__le64_to_cpu(rec->ur_master_transno), + (unsigned long long)__le64_to_cpu(rec->ur_batchid), __le32_to_cpu(rec->ur_flags), __le32_to_cpu(rec->ur_index), up_count, @@ -916,6 +916,48 @@ void print_update_rec(struct llog_update_record *lur) } +static void print_unlink_rec(struct llog_unlink_rec *lur) +{ + printf("unlink record id:0x%x target %llx:%x:%x\n", + __le32_to_cpu(lur->lur_hdr.lrh_id), + __le64_to_cpu(lur->lur_oid), + __le32_to_cpu(lur->lur_oseq), + __le32_to_cpu(lur->lur_count)); +} + +static void print_unlink64_rec(struct llog_unlink64_rec *lur) +{ + printf("unlink64 record id:0x%x target "DFID"\n", + __le32_to_cpu(lur->lur_hdr.lrh_id), + PFID(&lur->lur_fid)); +} + +static void print_setattr64_rec(struct llog_setattr64_rec *lsr) +{ + printf("setattr64 record id:0x%x target "DFID" valid %llx uid %u:%u gid %u:%u\n", + __le32_to_cpu(lsr->lsr_hdr.lrh_id), + PFID(&lsr->lsr_oi.oi_fid), + __le64_to_cpu(lsr->lsr_valid), + __le32_to_cpu(lsr->lsr_uid_h), + __le32_to_cpu(lsr->lsr_uid), + __le32_to_cpu(lsr->lsr_gid_h), + __le32_to_cpu(lsr->lsr_gid)); +} + +static void print_setattr64_rec_v2(struct llog_setattr64_rec_v2 *lsr) +{ + printf("setattr64 v2 record id:0x%x target "DFID" valid %llx uid %u:%u gid %u:%u prj %u\n", + __le32_to_cpu(lsr->lsr_hdr.lrh_id), + PFID(&lsr->lsr_oi.oi_fid), + __le64_to_cpu(lsr->lsr_valid), + __le32_to_cpu(lsr->lsr_uid_h), + __le32_to_cpu(lsr->lsr_uid), + __le32_to_cpu(lsr->lsr_gid_h), + __le32_to_cpu(lsr->lsr_gid), + __le32_to_cpu(lsr->lsr_projid)); +} + + static void print_records(struct llog_rec_hdr **recs, int rec_number, int is_ext) { @@ -965,6 +1007,22 @@ static void print_records(struct llog_rec_hdr **recs, case UPDATE_REC: print_update_rec((struct llog_update_record *)recs[i]); break; + case MDS_UNLINK_REC: + print_unlink_rec((struct llog_unlink_rec *)recs[i]); + break; + case MDS_UNLINK64_REC: + print_unlink64_rec((struct llog_unlink64_rec *)recs[i]); + break; + case MDS_SETATTR64_REC: + if (__le32_to_cpu(recs[i]->lrh_len) > + sizeof(struct llog_setattr64_rec)) { + print_setattr64_rec_v2( + (struct llog_setattr64_rec_v2 *)recs[i]); + } else { + print_setattr64_rec( + (struct llog_setattr64_rec *)recs[i]); + } + break; default: printf("unknown type %x\n", lopt); break;