Re: [PATCH v4 7/7] hfsplus: switch address_space_operations on iomap-based support
From: Viacheslav Dubeyko
Date: Fri Sep 25 2026 - 18:35:44 EST
On Fri, 2026-09-18 at 15:57 +0200, Christoph Hellwig wrote:
> On Mon, Sep 14, 2026 at 04:39:41PM -0700, Viacheslav Dubeyko wrote:
> > /* Compare two extents keys, returns 0 on same, pos/neg for
> > difference */
> > int hfsplus_ext_cmp_key(const hfsplus_btree_key *k1,
> > @@ -275,6 +276,8 @@ int hfsplus_map_extent(struct inode *inode, u32
> > ablock, int create,
> > *max_blocks = hfsplus_ext_find_block(hip-
> > >first_extents,
> > ablock,
> > dblock);
> > + if (!*max_blocks)
> > + return -EIO;
>
> What is this for? It feels like something that should go into a
> well-documented prep patch.
>
> > @@ -342,7 +348,7 @@ int hfsplus_get_block(struct inode *inode,
> > sector_t iblock,
> >
> > if (create) {
> > set_buffer_new(bh_result);
> > - hip->phys_size += sb->s_blocksize;
> > + hip->phys_size = (loff_t)(iblock + 1) << sb-
> > >s_blocksize_bits;
>
> How is this change related to iomap?
>
> > if (inode->i_size > hip->phys_size) {
> > - struct address_space *mapping = inode->i_mapping;
> > - struct folio *folio;
> > - void *fsdata = NULL;
> > - loff_t size = inode->i_size;
> > + if (S_ISREG(inode->i_mode)) {
> > + res = hfsplus_iomap_cont_expand(inode,
> > hip->phys_size,
> > + inode-
> > >i_size);
> > + if (res)
> > + return;
> > +
> > + mark_inode_dirty(inode);
> > + } else {
> > + struct address_space *mapping = inode-
> > >i_mapping;
> > + struct folio *folio;
> > + void *fsdata = NULL;
> > +
> > + res = hfsplus_write_begin(NULL, mapping,
> > + inode->i_size,
> > 0,
> > + &folio,
> > &fsdata);
> > + if (res)
> > + return;
> > +
> > + res = generic_write_end(NULL, mapping,
> > + inode->i_size, 0,
> > 0,
> > + folio, fsdata);
> > + if (res < 0)
> > + return;
> > +
> > + mark_inode_dirty(inode);
> > + }
>
> Is this for symlinks? Any reason you can't pull in
>
> iomap: add iomap_symlink_write
>
> that has been posted on fsdevel and use iomap for symlinks as well?
Does it landed into some branch or is it still only on fsdevel list?
Otherwise, I need to wait when this patch will be in some release.
Thanks,
Slava.