Re: [PATCH 4/6] hfsplus: add iomap operations for regular file data

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On Wed, Aug 19, 2026 at 04:27:50PM -0700, Viacheslav Dubeyko wrote:
> Hi Christoph,
> 
> On Fri, 2026-07-24 at 07:32 +0200, Christoph Hellwig wrote:
> 
> 
> > 
> > > +static int hfsplus_file_write_dio_end_io(struct kiocb *iocb,
> > > ssize_t size,
> > > +					 int error, unsigned int
> > > flags)
> > > +{
> > > +	struct inode *inode = file_inode(iocb->ki_filp);
> > > +
> > > +	if (error)
> > > +		return error;
> > > +
> > > +	if (size && i_size_read(inode) < iocb->ki_pos + size) {
> > > +		i_size_write(inode, iocb->ki_pos + size);
> > > +		mark_inode_dirty(inode);
> > > +	}
> > > +
> > > +	return 0;
> > > +}
> > 
> > We've have a copy of this in various places, maye add it to a header?
> > Or even into the core code based on a flag so that these file systems
> > don't need an end_io method?
> 
> I think I need more clarification here. :) By "various places" do you
> mean HFS+ code or Linux kernel as whole?
> 
> I assume that you mean this code block:
> 
> +	if (size && i_size_read(inode) < iocb->ki_pos + size) {
> +		i_size_write(inode, iocb->ki_pos + size);
> +		mark_inode_dirty(inode);
> +	}
> 
> Do you suggest to introduce this logic as a special method that can be
> used in other file systems too? Am I right?

That was the original idea.  But I think what is even better is to
do it when no iomap_dio_ops.end_io method is defined.  I think I did
an audit that there is no such current case for writes, but we should
double check it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.