All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>,
	Jeff Layton <jlayton@kernel.org>,
	 Josef Bacik <josef@toxicpanda.com>,
	Christoph Hellwig <hch@lst.de>,
	David Howells <dhowells@redhat.com>,
	 Jens Axboe <axboe@kernel.dk>, Miklos Szeredi <miklos@szeredi.hu>,
	Al Viro <viro@zeniv.linux.org.uk>,
	 linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] splice: return type ssize_t from all helpers
Date: Mon, 11 Dec 2023 17:17:03 +0200	[thread overview]
Message-ID: <CAOQ4uxgxqjju=FAtKBJhX9cK1sOSkMOwZjVYutTmWs9Kjzd5pQ@mail.gmail.com> (raw)
In-Reply-To: <20231211143923.fviipywixaqm2es4@quack3>

On Mon, Dec 11, 2023 at 4:39 PM Jan Kara <jack@suse.cz> wrote:
>
> On Sun 10-12-23 16:18:57, Amir Goldstein wrote:
> > Not sure why some splice helpers return long, maybe historic reasons.
> > Change them all to return ssize_t to conform to the splice methods and
> > to the rest of the helpers.
> >
> > Suggested-by: Christian Brauner <brauner@kernel.org>
> > Link: https://lore.kernel.org/r/20231208-horchen-helium-d3ec1535ede5@brauner/
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
>
> > @@ -955,9 +955,9 @@ static void do_splice_eof(struct splice_desc *sd)
> >   * Callers already called rw_verify_area() on the entire range.
> >   * No need to call it for sub ranges.
> >   */
> > -static long do_splice_read(struct file *in, loff_t *ppos,
> > -                        struct pipe_inode_info *pipe, size_t len,
> > -                        unsigned int flags)
> > +static size_t do_splice_read(struct file *in, loff_t *ppos,
>           ^^^ ssize_t here?
>
> > +                          struct pipe_inode_info *pipe, size_t len,
> > +                          unsigned int flags)
> >  {
> >       unsigned int p_space;
> >
> > @@ -1030,7 +1030,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
> >                              splice_direct_actor *actor)
> >  {
> >       struct pipe_inode_info *pipe;
> > -     long ret, bytes;
> > +     size_t ret, bytes;
>         ^^^^ ssize_t here?
>

Yap, I had more than one miss...

> >       size_t len;
> >       int i, flags, more;
> >
> ...
> > @@ -1962,7 +1962,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
> >   * The 'flags' used are the SPLICE_F_* variants, currently the only
> >   * applicable one is SPLICE_F_NONBLOCK.
> >   */
>
> Actually link_pipe() should also return ssize_t instead of int, shouldn't
> it?

Wouldn't hurt.
I also see that I missed the vmsplice_ helpers.

I see v3 in my future...

Thanks,
Amir.

  reply	other threads:[~2023-12-11 15:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-10 14:18 [PATCH v2 0/5] Prepare for fsnotify pre-content permission events Amir Goldstein
2023-12-10 14:18 ` [PATCH v2 1/5] splice: return type ssize_t from all helpers Amir Goldstein
2023-12-11  6:57   ` Amir Goldstein
2023-12-11 14:39   ` Jan Kara
2023-12-11 15:17     ` Amir Goldstein [this message]
2023-12-10 14:18 ` [PATCH v2 2/5] fs: use splice_copy_file_range() inline helper Amir Goldstein
2023-12-11 14:45   ` Jan Kara
2023-12-10 14:18 ` [PATCH v2 3/5] fsnotify: split fsnotify_perm() into two hooks Amir Goldstein
2023-12-10 14:19 ` [PATCH v2 4/5] fsnotify: assert that file_start_write() is not held in permission hooks Amir Goldstein
2023-12-10 14:19 ` [PATCH v2 5/5] fsnotify: optionally pass access range in file " Amir Goldstein
2023-12-11 15:20   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOQ4uxgxqjju=FAtKBJhX9cK1sOSkMOwZjVYutTmWs9Kjzd5pQ@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.