X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Fllog_reader.c;h=dc2ef05127226b8ad0fb4df8171301de570eb6b5;hp=1f574c05305b271b8d651db7505a2985f245c631;hb=6d74b759634355e7f6647ccaefef519a1ff208e2;hpb=ee4b50278e4471b7c64e619e13699c560502b81e diff --git a/lustre/utils/llog_reader.c b/lustre/utils/llog_reader.c index 1f574c0..dc2ef05 100644 --- a/lustre/utils/llog_reader.c +++ b/lustre/utils/llog_reader.c @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef HAVE_ENDIAN_H # include #endif @@ -876,6 +877,12 @@ char *buf2str(void *buf, unsigned int size) return string; } +static inline size_t +object_update_param_size(const struct object_update_param *param) +{ + return roundup(sizeof(*param) + param->oup_len, sizeof(__u64)); +} + void print_update_rec(struct llog_update_record *lur) { struct update_records *rec = &lur->lur_update_rec; @@ -909,8 +916,8 @@ void print_update_rec(struct llog_update_record *lur) for (i = 0; i < pm_count; i++) { printf("\tp_%d - %d/%s\n", i, pm->oup_len, buf2str(pm->oup_buf, pm->oup_len)); - pm = (struct object_update_param *)((char *)(pm + 1) + - pm->oup_len); + pm = (struct object_update_param *)((char *)pm + + object_update_param_size(pm)); } printf("\n");