> + *((int *)&iomap->private) = sequence; > +static bool > +xfs_buffered_write_iomap_valid( > + struct inode *inode, > + const struct iomap *iomap) > +{ > + int seq = *((int *)&iomap->private); I really hate this stuffing of the sequence into the private pointer. The iomap structure isn't so size constrained that we have to do that, so we can just add a sequence number field directly to it. I don't think that is a layering violation, as the concept of a sequence numebr is pretty generic and we'll probably need it for all file systems eventually. > + > + if (seq != READ_ONCE(XFS_I(inode)->i_df.if_seq)) > + return false; Which makes me wonder if we could do away with the callback entirely by adding an option sequence number pointer to the iomap_iter. If set the core code compares it against iomap->seq and we get rid of the per-folio indirect call, and boilerplate code that would need to be implemented in every file system.