On 05.02.20 20:56, Murilo Opsfelder Araújo wrote:
> Hello, David.
> 
> On 2/3/20 3:31 PM, David Hildenbrand wrote:
>> We want to populate memory within a reserved memory region. Let's factor
>> that out.
>>
>> Cc: "Michael S. Tsirkin" <m...@redhat.com>
>> Cc: Greg Kurz <gr...@kaod.org>
>> Cc: Murilo Opsfelder Araujo <muri...@linux.ibm.com>
>> Cc: Eduardo Habkost <ehabk...@redhat.com>
>> Cc: "Dr. David Alan Gilbert" <dgilb...@redhat.com>
>> Signed-off-by: David Hildenbrand <da...@redhat.com>
>> ---
> 
> Acked-by: Murilo Opsfelder Araujo <muri...@linux.ibm.com>
> 
> A minor comment below.
> 
>>   util/mmap-alloc.c | 89 +++++++++++++++++++++++++----------------------
>>   1 file changed, 47 insertions(+), 42 deletions(-)
>>
>> diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
>> index 43a26f38a8..f043ccb0ab 100644
>> --- a/util/mmap-alloc.c
>> +++ b/util/mmap-alloc.c
>> @@ -114,6 +114,50 @@ static void *mmap_reserve(size_t size, int fd)
>>       return mmap(0, size, PROT_NONE, flags, fd, 0);
>>   }
>>
>> +/*
>> + * Populate memory in a reserved region from the given fd (if any).
>> + */
>> +static void *mmap_populate(void *ptr, size_t size, int fd, bool shared,
>> +                           bool is_pmem)
>> +{
>> +    int map_sync_flags = 0;
>> +    int flags = MAP_FIXED;
>> +    void *new_ptr;
> 
> Do you think another name would be welcome here, e.g.: "populated_ptr" or
> "populated_memptr" or just "populated"?

I'll go with populated_ptr - thanks!


-- 
Thanks,

David / dhildenb


Reply via email to