On Tue, Jun 24, 2025 at 03:57:40PM +0200, Christoph Hellwig wrote: > 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]; > }; Thanks for the tip hch, but wouldn't this break the mount option? So far the user can specify how many iclogs will be in memory, by allocating a fixed array, we essentially lock it to 8 iclogs, no? Cheers, and thanks again for the review. > > 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); > > >