[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4125892.1676624401@warthog.procyon.org.uk>
Date: Fri, 17 Feb 2023 09:00:01 +0000
From: David Howells <dhowells@...hat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: dhowells@...hat.com, Steve French <smfrench@...il.com>,
Jens Axboe <axboe@...nel.dk>,
Al Viro <viro@...iv.linux.org.uk>,
Shyam Prasad N <nspmangalore@...il.com>,
Rohith Surabattula <rohiths.msft@...il.com>,
Tom Talpey <tom@...pey.com>,
Stefan Metzmacher <metze@...ba.org>,
Christoph Hellwig <hch@...radead.org>,
Matthew Wilcox <willy@...radead.org>,
Jeff Layton <jlayton@...nel.org>, linux-cifs@...r.kernel.org,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
syzbot+a440341a59e3b7142895@...kaller.appspotmail.com,
Christoph Hellwig <hch@....de>,
David Hildenbrand <david@...hat.com>,
John Hubbard <jhubbard@...dia.com>
Subject: Re: [PATCH 03/17] splice: Add a func to do a splice from an O_DIRECT file without ITER_PIPE
David Howells <dhowells@...hat.com> wrote:
> diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
> index 6cb65df3e3ba..d2c3f16cf6b1 100644
> --- a/include/linux/pipe_fs_i.h
> +++ b/include/linux/pipe_fs_i.h
> @@ -156,6 +156,26 @@ static inline bool pipe_full(unsigned int head, unsigned int tail,
> return pipe_occupancy(head, tail) >= limit;
> }
>
> +/**
> + * pipe_buf - Return the pipe buffer for the specified slot in the pipe ring
> + * @pipe: The pipe to access
> + * @slot: The slot of interest
> + */
> +static inline struct pipe_buffer *pipe_buf(const struct pipe_inode_info *pipe,
> + unsigned int slot)
> +{
> + return &pipe->bufs[slot & (pipe->ring_size - 1)];
> +}
> +
> +/**
> + * pipe_head_buf - Return the pipe buffer at the head of the pipe ring
> + * @pipe: The pipe to access
> + */
> +static inline struct pipe_buffer *pipe_head_buf(const struct pipe_inode_info *pipe)
> +{
> + return pipe_buf(pipe, pipe->head);
> +}
> +
> /**
> * pipe_buf_get - get a reference to a pipe_buffer
> * @pipe: the pipe that the buffer belongs to
> diff --git a/lib/iov_iter.c b/lib/iov_iter.c
> index f9a3ff37ecd1..47c484551c59 100644
> --- a/lib/iov_iter.c
> +++ b/lib/iov_iter.c
> @@ -186,12 +186,6 @@ static int copyin(void *to, const void __user *from, size_t n)
> return res;
> }
>
> -static inline struct pipe_buffer *pipe_buf(const struct pipe_inode_info *pipe,
> - unsigned int slot)
> -{
> - return &pipe->bufs[slot & (pipe->ring_size - 1)];
> -}
> -
> #ifdef PIPE_PARANOIA
> static bool sanity(const struct iov_iter *i)
> {
This needs moving to the previous patch, but no code change overall.
David
Powered by blists - more mailing lists