[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <wkdxihiolxnzelu57llc7vealuofie3l42clbsn7tqjbvstxqp@a6d74rhrvcla>
Date: Fri, 7 Mar 2025 23:40:54 +0100
From: Mateusz Guzik <mjguzik@...il.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
David Howells <dhowells@...hat.com>, Oleg Nesterov <oleg@...hat.com>, Jan Kara <jack@...e.cz>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs/pipe.c: merge if statements with identical conditions
On Fri, Mar 07, 2025 at 11:25:00PM +0100, Rasmus Villemoes wrote:
> As 'head' is not updated after head+1 is assigned to pipe->head, the
> condition being tested here is exactly the same as in the big if
> statement just above. Merge the two bodies.
>
> Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
> ---
> fs/pipe.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/pipe.c b/fs/pipe.c
> index 097400cce241..27385e3e5417 100644
> --- a/fs/pipe.c
> +++ b/fs/pipe.c
> @@ -547,10 +547,8 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
>
> if (!iov_iter_count(from))
> break;
> - }
> -
> - if (!pipe_full(head, pipe->tail, pipe->max_usage))
> continue;
> + }
>
> /* Wait for buffer space to become available. */
> if ((filp->f_flags & O_NONBLOCK) ||
I already posted this :)
It is hanging out in the vfs trees (and -next), see
https://lore.kernel.org/linux-fsdevel/20250303230409.452687-2-mjguzik@gmail.com/
Powered by blists - more mailing lists