Messages in this thread | | | From | Michel Lespinasse <> | Date | Mon, 6 Apr 2020 06:04:16 -0700 | Subject | Re: [PATCH 7/8] mmap locking API: add MMAP_LOCK_INITIALIZER |
| |
On Mon, Apr 6, 2020 at 2:46 AM Laurent Dufour <ldufour@linux.ibm.com> wrote: > > Le 26/03/2020 à 08:02, Michel Lespinasse a écrit : > > Define a new initializer for the mmap locking api. > > Initially this just evaluates to __RWSEM_INITIALIZER as the API > > is defined as wrappers around rwsem. > > I can't see the benefit of this change. > The overall idea is to hide the mmap_sem name. Here the macro > MMAP_LOCK_INITIALIZER() doesn't hide the name.
The idea for the initializer is that it makes it easier to change the underlying implementation - if we do, we can change the initializer without having to change every place where it is used. I actually do that in my other patch series converting the mmap_sem to a range lock.
But you are correct that it does not help with renaming the mmap_sem field - my next commit in this series still has to do that in every place this initializer is used.
| |