# Re: \[PATCH v2 3/6\] mm: replace vma-\>vm\_flags direct modifications with modifier calls

- From: Sebastian Reichel \<hidden\>
- Date: 2023-01-26 17:07:56 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2023/01/242451
- Thread: https://ratatoskr.run/linux-mm/2023/01/242241/t.md

```text
Hi,

On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote:
> Replace direct modifications to vma->vm_flags with calls to modifier
> functions to be able to track flag changes and to keep vma locking
> correctness.
> 
> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> ---
> [...]
>  drivers/hsi/clients/cmt_speech.c                   |  2 +-
>  120 files changed, 188 insertions(+), 199 deletions(-)
> [...]
> diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c
> index 8069f795c864..952a31e742a1 100644
> --- a/drivers/hsi/clients/cmt_speech.c
> +++ b/drivers/hsi/clients/cmt_speech.c
> @@ -1264,7 +1264,7 @@ static int cs_char_mmap(struct file *file, struct vm_area_struct *vma)
>  	if (vma_pages(vma) != 1)
>  		return -EINVAL;
>  
> -	vma->vm_flags |= VM_IO | VM_DONTDUMP | VM_DONTEXPAND;
> +	set_vm_flags(vma, VM_IO | VM_DONTDUMP | VM_DONTEXPAND);
>  	vma->vm_ops = &cs_char_vm_ops;
>  	vma->vm_private_data = file->private_data;
>  

Acked-by: Sebastian Reichel <redacted>

-- Sebastian
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-fbdev/2023/01/242451/attachment/0) (application/pgp-signature, 833 bytes)
