Re: [PATCH v2 05/16] splice: remove permission hook from iter_file_splice_write()

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

 



On Thu, Nov 23, 2023 at 9:47 AM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> > +ssize_t __kernel_write_iter(struct file *file, struct iov_iter *from,
> > +                         loff_t *pos);
> > +ssize_t do_iter_writev(struct file *file, struct iov_iter *iter, loff_t *ppos,
> > +                    rwf_t flags);
>
> So I first stumbled on the name because I kinda hate do_* functions,
> especially if they are not static, and then went down a little rathole:
>
>
>  - first obviously the name, based on the other functions it probably
>    should be in the __kernel_* namespace unless I'm missing something.

Not sure about the best name.
I just derived the name from do_iter_readv_writev(), which would be the
name of this helper if we split up do_iter_readv_writev() as you suggested.

>  - second can you add a little comment when it is to be used?  Our
>    maze of read and write helpers is becoming a little too confusing
>    even for someone who thought he knew the code (and wrote some if it).

I could try, but I can't say that I know how to document the maze.
I was trying to make small changes that make the maze a bit
more consistent - after my series, in most cases we have:
 vfs_XXX()
    rw_verify_area()
    file_start_write()
    do_XXX()

But obviously, there is still a wide variety of do_* helpers
with different conventions.

>  - can we just split do_iter_readv_writev instead of adding a wrapper
>    Yes, that'll duplicate a little boiler plate code, but it'll make
>    things much easier to follow.
> (- same probably for do_loop_readv_writev, although not directly
>    relevant to this series)
>

We can do that, it's easy, but I also got opposite comments from
Christian about opportunities to factor out more common code, so
I will do it if there is consensus.

Thanks,
Amir.





[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