[CRIU] [PATCH 8/9] tty: Use regular files engine to save paths to the peers, v4
Pavel Emelyanov
xemul at parallels.com
Fri Oct 17 05:19:20 PDT 2014
>>> /*
>>> + * The image might have no reg file record in old CRIU, so
>>> + * lets don't fail for a while. After a couple of releases
>>> + * simply require the record to present.
>>> + */
>>> + info->reg_d = find_file_desc_raw(FD_TYPES__REG, info->tfe->id);
>>> + if (!info->reg_d) {
>>> + info->reg_d = pty_alloc_reg(info, true);
>>> + if (!info->reg_d) {
>>> + pr_err("Can't generate new reg descriptor for id %#x\n",
>>> + info->tfe->id);
>>> + return -1;
>>> + }
>>> + } else {
>>> + info->reg_d = collect_special_file(info->tfe->id);
>>
>> This results in double list lookup.
>
> This gonna be pretty fast, it's hashed list. Look, the old interface should be deprecated
> in a couple of releases I think and I will simply can use collect_special_file
> withouth "try" (because now we can have images where no reg-entries are
> present on disc and if I use collect_special_file now the user will
> get an error message).
Then introduce the __collect_special_file() w/o the message printing.
Thanks,
Pavel
More information about the CRIU
mailing list