Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()

2023-01-29 Thread Juan Quintela
Peter Xu wrote: > Add a helper to do mmap() for a ramblock based on the cached informations. > > A trivial thing to mention is we need to move ramblock->fd setup to be > earlier, before the ramblock_file_map() call, because it'll need to > reference the fd being mapped. However that should not be

Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()

2023-01-25 Thread Peter Xu
On Wed, Jan 25, 2023 at 09:24:24AM +, Dr. David Alan Gilbert wrote: > > > > static void *file_ram_alloc(RAMBlock *block, > > > > int fd, > > > > bool truncate, > > > > off_t offset, > > > >

Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()

2023-01-25 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > On Tue, Jan 24, 2023 at 10:06:48AM +, Dr. David Alan Gilbert wrote: > > * Peter Xu (pet...@redhat.com) wrote: > > > Add a helper to do mmap() for a ramblock based on the cached informations. > > > > > > A trivial thing to mention is we need to move rambl

Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()

2023-01-24 Thread Peter Xu
On Tue, Jan 24, 2023 at 10:06:48AM +, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > Add a helper to do mmap() for a ramblock based on the cached informations. > > > > A trivial thing to mention is we need to move ramblock->fd setup to be > > earlier, before the ramb

Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()

2023-01-24 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Add a helper to do mmap() for a ramblock based on the cached informations. > > A trivial thing to mention is we need to move ramblock->fd setup to be > earlier, before the ramblock_file_map() call, because it'll need to > reference the fd being mapped. Howe

[PATCH RFC 10/21] ramblock: Add ramblock_file_map()

2023-01-17 Thread Peter Xu
Add a helper to do mmap() for a ramblock based on the cached informations. A trivial thing to mention is we need to move ramblock->fd setup to be earlier, before the ramblock_file_map() call, because it'll need to reference the fd being mapped. However that should not be a problem at all, majorly