[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YDF6Z8QHh3yw7es9@zeniv-ca.linux.org.uk>
Date: Sat, 20 Feb 2021 21:08:55 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Denis Kirjanov <kda@...ux-powerpc.org>,
Christoph Hellwig <hch@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Jakub Kicinski <kuba@...nel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 1/8] af_unix: take address assignment/hash insertion into
a new helper
On Sat, Feb 20, 2021 at 12:31:49PM -0800, Cong Wang wrote:
> Because it does not lock the lock, just compare:
>
> lock();
> __unix_set_addr();
> unlock();
>
> to:
>
> lock();
> __unix_set_addr();
>
> Clearly the former is more readable and less error-prone. Even
> if you really want to do unlock, pick a name which explicitly says
> it, for example, __unix_set_addr_unlock().
*shrug*
If anything, __unix_complete_bind() might make a better name for that,
with dropping ->bindlock also pulled in, but TBH I don't have sufficiently
strong preferences - might as well leave dropping the lock to caller.
I'll post that series to netdev tonight.
Powered by blists - more mailing lists