> -static inline bool xfs_bmap_is_written_extent(struct xfs_bmbt_irec *irec) > +static inline bool xfs_bmap_is_written_extent(const struct xfs_bmbt_irec *irec) This seems entirely unrelated, can you split it into a cleanup patch? > + state |= CRIGHT_CONTIG; > + if ((state & CBOTH_CONTIG) == CBOTH_CONTIG && > + left->br_startblock + curr->br_startblock + > + right->br_startblock > XFS_MAX_BMBT_EXTLEN) Overly long line here (and pretty weird formatting causing it..) > + if ((state & NBOTH_CONTIG) == NBOTH_CONTIG && > + left->br_startblock + new->br_startblock + > + right->br_startblock > XFS_MAX_BMBT_EXTLEN) Same here. > +/* XFS-specific parts of file exchanges */ Well, everything really is XFS-specific :) I'd drop this comment. Otherwise looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>