On Tue, Jun 24, 2025 at 12:16:32PM +1000, Dave Chinner wrote: > Hence I think that the ring should remain immutable and the > log->l_iclog pointer retained to index the first object in the ring. > This means we don't need a list head in the struct xlog for the > iclog ring, we can have the ring simply contain just the iclogs as > they currently do. Alternatively do away with the list entirely and replace it with an array of pointers, i.e. struct xlog { ... struct xlog_in_core *l_iclog; struct xlog_in_core *l_iclogs[XLOG_MAX_ICLOGS]; }; static inline struct xlog_in_core * xlog_next_iclog( struct xlog_in_core *iclog) { if (iclog == iclog->ic_log->l_iclogs[log->l_iclog_bufs - 1]) return iclog->ic_log->l_iclogs[0]; return iclog + 1; } and the typical loop become something like: struct xlog_in_core *iclog = log->l_iclog; do { ... } while ((iclog = xlog_next_iclog(iclog)) != log->l_iclog);