Re: [PATCH v5 10/10] mmap locking API: rename mmap_sem to mmap_lock

From: Michel Lespinasse
Date: Wed Apr 22 2020 - 18:54:48 EST


On Tue, Apr 21, 2020 at 6:58 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> On Tue, Apr 21, 2020 at 05:14:22PM -0700, Michel Lespinasse wrote:
> > Rename the mmap_sem field to mmap_lock. Any new uses of this lock
>
> Shouldn't some of these be folded into the previous patch?

So, I didn't do it because previous patch only handled rwsem_is_locked
call sites. I leaned towards adding as few new API functions as
possible until we figure out exactly what is required.

That said, I agree it seems reasonable to split mmap_assert_locked()
into mmap_assert_read_locked() and mmap_assert_write_locked(), and
convert the lockdep asserts to use these instead.
I'm not sure we need to do it right away though; we are at least not
losing any test coverage with the existing version of the patchset...