On Thu, 20 Aug 2026 at 14:36, Jimmy Zuber <[email protected]> wrote:

> +void fuse_zero_partial_eof_folio(struct inode *inode, loff_t from, loff_t to)
> +{
> +       struct folio *folio;
> +       size_t offset, end;
> +
> +       if (from >= to)
> +               return;
> +
> +       folio = filemap_lock_folio(inode->i_mapping, from >> PAGE_SHIFT);

How about:
truncate_pagecache_range(inode, from, to - 1);
?

The mkclean/mark_dirty magic is only needed by filesystems using
buffer heads, as Jan pointed out.  The other parts of the zeroing are
done by the above helper.

Thanks,
Miklos

Reply via email to