diff options
-rw-r--r-- | src/cursor/cur_stat.c | 16 | ||||
-rw-r--r-- | src/include/cursor.h | 7 |
2 files changed, 10 insertions, 13 deletions
diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c index 82568401319..da9838292d6 100644 --- a/src/cursor/cur_stat.c +++ b/src/cursor/cur_stat.c @@ -113,12 +113,12 @@ __curstat_get_value(WT_CURSOR *cursor, ...) if (F_ISSET(cursor, WT_CURSTD_RAW)) { WT_ERR(__wt_struct_size(session, &size, cursor->value_format, - cst->stats_first[WT_STAT_KEY_OFFSET(cst)].desc, + cst->stats[WT_STAT_KEY_OFFSET(cst)].desc, cst->pv.data, cst->v)); WT_ERR(__wt_buf_initsize(session, &cursor->value, size)); WT_ERR(__wt_struct_pack(session, cursor->value.mem, size, cursor->value_format, - cst->stats_first[WT_STAT_KEY_OFFSET(cst)].desc, + cst->stats[WT_STAT_KEY_OFFSET(cst)].desc, cst->pv.data, cst->v)); item = va_arg(ap, WT_ITEM *); @@ -130,7 +130,7 @@ __curstat_get_value(WT_CURSOR *cursor, ...) * pointer support isn't documented, but it's a cheap test. */ if ((p = va_arg(ap, const char **)) != NULL) - *p = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].desc; + *p = cst->stats[WT_STAT_KEY_OFFSET(cst)].desc; if ((p = va_arg(ap, const char **)) != NULL) *p = cst->pv.data; if ((v = va_arg(ap, uint64_t *)) != NULL) @@ -215,7 +215,7 @@ __curstat_next(WT_CURSOR *cursor) F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET); WT_ERR(WT_NOTFOUND); } - cst->v = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].v; + cst->v = cst->stats[WT_STAT_KEY_OFFSET(cst)].v; WT_ERR(__curstat_print_value(session, cst->v, &cst->pv)); F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT); @@ -254,7 +254,7 @@ __curstat_prev(WT_CURSOR *cursor) WT_ERR(WT_NOTFOUND); } - cst->v = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].v; + cst->v = cst->stats[WT_STAT_KEY_OFFSET(cst)].v; WT_ERR(__curstat_print_value(session, cst->v, &cst->pv)); F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT); @@ -308,7 +308,7 @@ __curstat_search(WT_CURSOR *cursor) if (cst->key < WT_STAT_KEY_MIN(cst) || cst->key > WT_STAT_KEY_MAX(cst)) WT_ERR(WT_NOTFOUND); - cst->v = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].v; + cst->v = cst->stats[WT_STAT_KEY_OFFSET(cst)].v; WT_ERR(__curstat_print_value(session, cst->v, &cst->pv)); F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT); @@ -358,7 +358,7 @@ __curstat_conn_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst) if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) __wt_stat_refresh_connection_stats(&conn->stats); - cst->stats_first = cst->stats = (WT_STATS *)&cst->u.conn_stats; + cst->stats = (WT_STATS *)&cst->u.conn_stats; cst->stats_base = WT_CONNECTION_STATS_BASE; cst->stats_count = sizeof(WT_CONNECTION_STATS) / sizeof(WT_STATS); } @@ -418,7 +418,7 @@ void __wt_curstat_dsrc_final(WT_CURSOR_STAT *cst) { - cst->stats_first = cst->stats = (WT_STATS *)&cst->u.dsrc_stats; + cst->stats = (WT_STATS *)&cst->u.dsrc_stats; cst->stats_base = WT_DSRC_STATS_BASE; cst->stats_count = sizeof(WT_DSRC_STATS) / sizeof(WT_STATS); } diff --git a/src/include/cursor.h b/src/include/cursor.h index 36f36f2c46c..c53c5d762d5 100644 --- a/src/include/cursor.h +++ b/src/include/cursor.h @@ -304,7 +304,6 @@ struct __wt_cursor_stat { int notpositioned; /* Cursor not positioned */ WT_STATS *stats; /* Stats owned by the cursor */ - WT_STATS *stats_first; /* First stats reference */ int stats_base; /* Base statistics value */ int stats_count; /* Count of stats elements */ @@ -325,12 +324,10 @@ struct __wt_cursor_stat { /* * WT_CURSOR_STATS -- - * Return a reference to a statistic cursor's stats structures; use the - * WT_CURSOR.stats_first field instead of WT_CURSOR.stats because the latter - * is NULL when non-cursor memory is used to hold the statistics. + * Return a reference to a statistic cursor's stats structures. */ #define WT_CURSOR_STATS(cursor) \ - (((WT_CURSOR_STAT *)cursor)->stats_first) + (((WT_CURSOR_STAT *)cursor)->stats) struct __wt_cursor_table { WT_CURSOR iface; |