[CRIU] [PATCH 1/5] bfd: File-descriptors based buffered read

Pavel Emelyanov xemul at parallels.com
Fri Sep 19 07:04:13 PDT 2014


On 09/19/2014 05:57 PM, Ruslan Kuprieiev wrote:
> On 19.09.2014 16:30, Pavel Emelyanov wrote:
>> +/*
>> + * XXX currently CRIU doesn't open several files
>> + * at once, so we can have just one buffer.
>> + */
>> +static char *buf;
>> +static bool buf_busy;
>> +
> 
> Why not just store flags(like buf_busy) and buffers inside xbuf structure?

Because if some other call to bfdopen() comes and asks us for a buffer,
we here should know that the buffer pointed by this static variable is
busy (and we need to mmap a new one) not some xbuf that we was before.



More information about the CRIU mailing list