On Tue, Apr 28, 2020 at 03:41:32PM -0700, Darrick J. Wong wrote: > On Sat, Apr 25, 2020 at 11:28:01AM -0700, Christoph Hellwig wrote: > > On Tue, Apr 21, 2020 at 07:07:13PM -0700, Darrick J. Wong wrote: > > > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > > > > > Move the extent free intent and intent-done log recovery code into the > > > per-item source code files and use dispatch functions to call them. We > > > do these one at a time because there's a lot of code to move. No > > > functional changes. > > > > What is the reason for splitting xlog_recover_item_type vs > > xlog_recover_intent_type? To me it would seem more logical to have > > one operation vector, with some ops only set for intents. > > Partly because I started by refactoring only the intent items, and then > decided to prepend a series to do everything; and partly to be stingy > with bytes. :P > > That said, I like your suggestion of every XFS_LI_* code gets its own > xlog_recover_item_type so I'll go do that. Aha, now I remember why those two are separate types -- the process_intent and cancel_intent functions operate on the xfs_log_item that gets created from the xlog_recover_item that we pulled out of the log, whereas the other functions are called directly on the xlog_recovery_item. There's no direct link between the log item and the recovery log item, nor is there a good way to link through their dispatch functions. The recover_intent and recover_done functions can certainly become commit_pass2 functions of various xlog_recover_item_type structures, but that doesn't totally eliminate the need for xlog_recover_intent_type. --D > --D