[CRIU] [PATCH 2/9] files: Add ability to use read link in dump_one_reg_file
Pavel Emelyanov
xemul at parallels.com
Fri May 17 09:59:20 EDT 2013
On 05/17/2013 05:58 PM, Cyrill Gorcunov wrote:
> On Fri, May 17, 2013 at 05:43:41PM +0400, Pavel Emelyanov wrote:
>>
>>> + if (!p->link) {
>>> + if (fill_fdlink(lfd, (struct fd_parms *)p, &_link, false))
>>
>> What is this cast for? To facilitate the fill_fdlink prototype?
>> Plz, remove this ugly bool assign and always assign it there.
>
> Sigh. I can't. We call for fill_fdlink in two places
>
> - dump_one_file
> struct fd_link link;
> if (fill_fdlink(lfd, &p, &link, true))
>
> here fd_parms is not constant
>
> - dump_one_reg_file
> if (fill_fdlink(lfd, (struct fd_parms *)p, &_link, false))
>
> here fd_parms is a const pointer, and if I assign
> pointer inside fill_fdlink the result is bogus,
> i think gcc has special paths for const optimisations
Then remove const from dump_one_reg_file and above. You do cast ANYWAY
and screws all this beauty up.
> .
>
More information about the CRIU
mailing list