lkml.org 
[lkml]   [2020]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 01/10] mmap locking API: initial implementation as rwsem wrappers
On Mon, Apr 20, 2020 at 12:51 PM Davidlohr Bueso <dave@stgolabs.net> wrote:
> With one observation below.
>
> >+static inline void mmap_downgrade_write_lock(struct mm_struct *mm)
> >+{
> >+ downgrade_write(&mm->mmap_sem);
> >+}
>
> Shouldn't this really be just mmap_downgrade_write()? In locking
> normally don't add the _lock at the end as it implies the operation
> of acquiring the lock.

Hmmm, I see your point. Actually here the operation is downgrade, so
arguably the name should be mmap_write_downgrade ? I'm not sure I like
the name though, as it does not make it entirely obvious that the
function is a locking primitive.

--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

\
 
 \ /
  Last update: 2020-04-21 02:48    [W:0.106 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site