Re: [PATCH 4/6] hfsplus: add iomap operations for regular file data
Viacheslav Dubeyko <[email protected]>
| Newsgroups | org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <[email protected]> |
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?
Thanks,
Slava.