[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yi10WZi2TfyvClaG@zeniv-ca.linux.org.uk>
Date: Sun, 13 Mar 2022 04:34:33 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Matthew Wilcox <willy@...radead.org>
Cc: Max Kellermann <max.kellermann@...il.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] pipe_fs_i.h: add pipe_buf_init()
On Sun, Mar 13, 2022 at 02:48:10AM +0000, Matthew Wilcox wrote:
> That's not equivalent. I think the better option here is to always
> initialise flags to 0 (and not have a parameter for it):
>
> pipe_buf_init(buf, page, 0, 0, &anon_pipe_buf_ops);
> if (is_packetized(filp))
> buf->flags = PIPE_BUF_FLAG_PACKET;
> else
> buf->flags = PIPE_BUF_FLAG_CAN_MERGE;
Not equivalent in which sense? IDGI... Your variant is basically
X = 0;
if (Y == constant)
X = 1;
else
X = 2;
If gcc can optimize that to
X = (Y == constant) ? 1 : 2;
it should be able to do the same to
X = 1;
if (Y != constant)
X = 2;
What obstacles are there, besides a (false) assumption that
X might alias Y? Which would apply to both variants... Granted, I'm
half-asleep right now, so I might be missing something obvious...
Powered by blists - more mailing lists