Re: [PATCH 10/11] iomap: replace iomap_folio_ops with iomap_write_ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 17, 2025 at 3:55 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
>  ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from,
> -               const struct iomap_ops *ops, void *private);
> +               const struct iomap_ops *ops,
> +               const struct iomap_write_ops *write_ops, void *private);
>  int iomap_read_folio(struct folio *folio, const struct iomap_ops *ops);
>  void iomap_readahead(struct readahead_control *, const struct iomap_ops *ops);
>  bool iomap_is_partially_uptodate(struct folio *, size_t from, size_t count);
> @@ -344,11 +337,14 @@ bool iomap_release_folio(struct folio *folio, gfp_t gfp_flags);
>  void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len);
>  bool iomap_dirty_folio(struct address_space *mapping, struct folio *folio);
>  int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len,
> -               const struct iomap_ops *ops);
> +               const struct iomap_ops *ops,
> +               const struct iomap_write_ops *write_ops);
>  int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len,
> -               bool *did_zero, const struct iomap_ops *ops, void *private);
> +               bool *did_zero, const struct iomap_ops *ops,
> +               const struct iomap_write_ops *write_ops, void *private);
>  int iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
> -               const struct iomap_ops *ops, void *private);
> +               const struct iomap_ops *ops,
> +               const struct iomap_write_ops *write_ops, void *private);
>  vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops,
>                 void *private);

Maybe you'll hate this idea but what about just embedding struct
iomap_ops inside iomap_write_ops?

eg
 struct iomap_write_ops {
        struct iomap_ops iomap_ops;
        struct folio *(*get_folio)(struct iomap_iter *iter, loff_t pos,
                        unsigned len);
       ...
}

and then only having to pass in iomap_write_ops?





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux