lkml.org 
[lkml]   [2009]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v18 49/80] c/r: support for UTS namespace


Nikita V. Youshchenko wrote:
>> +static struct uts_namespace *do_restore_uts_ns(struct ckpt_ctx *ctx)
>> ...
>> +#ifdef CONFIG_UTS_NS
>> + uts_ns = create_uts_ns();
>> + if (!uts_ns) {
>> + uts_ns = ERR_PTR(-ENOMEM);
>> + goto out;
>> + }
>> + down_read(&uts_sem);
>> + name = &uts_ns->name;
>> + memcpy(name->sysname, h->sysname, sizeof(name->sysname));
>> + memcpy(name->nodename, h->nodename, sizeof(name->nodename));
>> + memcpy(name->release, h->release, sizeof(name->release));
>> + memcpy(name->version, h->version, sizeof(name->version));
>> + memcpy(name->machine, h->machine, sizeof(name->machine));
>> + memcpy(name->domainname, h->domainname, sizeof(name->domainname));
>> + up_read(&uts_sem);
>
> Could you please explain what for is this down_read() / up_read() ?
> You operate only on local objects: 'name' points to just-created
> uts_ns, 'h' is also local data.

Nothing more than symmetry with checkpoint code, and a pedagogical
aspect...

Can be replaced by a suitable comment.

Oren.


\
 
 \ /
  Last update: 2009-09-30 01:03    [W:0.084 / U:1.472 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site