> +struct buffered_write_operations { > + int (*write_begin)(struct file *, struct address_space *mapping, > + loff_t pos, size_t len, struct folio **foliop, > + void **fsdata); > + int (*write_end)(struct file *, struct address_space *mapping, > + loff_t pos, size_t len, size_t copied, > + struct folio *folio, void **fsdata); > +}; Should write_begin simply return the folio or an ERR_PTR instead of the return by reference? I also wonder if the fsdata paramter should go away - if a fs needs to pass forth and back fsdata, generic/filemap_perform_write is probably the wrong abstraction for it. Otherwise this looks sane to me.