On Thu, Apr 25, 2019 at 10:32:52AM +0200, Jan Kara wrote: > Also just looking at the code I was wondering about the following. E.g. in > iomap_write_end() we have code like: > > if (iomap->type == IOMAP_INLINE) { > foo > } else if (iomap->flags & IOMAP_F_BUFFER_HEAD) { > bar > } else { > baz > } > > if (iomap->page_done) > iomap->page_done(...); > > And now something very similar is in iomap_write_begin(). So won't it be > more natural to just mandate ->page_prepare() and ->page_done() callbacks > and each filesystem would set it to a helper function it needs? Probably we > could get rid of IOMAP_F_BUFFER_HEAD flag that way... I don't want pointless indirect calls for the default, non-buffer head case. Also inline really is a special case independent of what the caller could pass in as flags or callbacks. We could try to hide the buffer_head stuff in there, but then again I'd rather kill that off sooner than later.