# Re: \[PATCH v4\] module: replace module\_layout with module\_memory

- From: Peter Zijlstra \<peterz@infradead.org\>
- Date: 2023-01-31 11:26:36 
- List: linux-modules
- Page: https://ratatoskr.run/linux-modules/2023/01/2085722
- Thread: https://ratatoskr.run/linux-modules/2023/01/2084740/t.md

```text
On Mon, Jan 30, 2023 at 10:21:09AM -0800, Song Liu wrote:
> +	if (type == MOD_DATA || type == MOD_RODATA ||
> +	    type == MOD_RO_AFTER_INIT) {

> +static bool mod_mem_use_vmalloc(enum mod_mem_type type)
> +{
> +	return type == MOD_DATA || type == MOD_RODATA || type == MOD_RO_AFTER_INIT;
> +}

perhaps a mod_mem_type_is_data() helper?
```
