mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
time: use ns_common_init()
Don't cargo-cult the same thing over and over. Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -88,22 +88,19 @@ static struct time_namespace *clone_time_ns(struct user_namespace *user_ns,
|
||||
goto fail;
|
||||
|
||||
err = -ENOMEM;
|
||||
ns = kmalloc(sizeof(*ns), GFP_KERNEL_ACCOUNT);
|
||||
ns = kzalloc(sizeof(*ns), GFP_KERNEL_ACCOUNT);
|
||||
if (!ns)
|
||||
goto fail_dec;
|
||||
|
||||
refcount_set(&ns->ns.count, 1);
|
||||
|
||||
ns->vvar_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
|
||||
if (!ns->vvar_page)
|
||||
goto fail_free;
|
||||
|
||||
err = ns_alloc_inum(&ns->ns);
|
||||
err = ns_common_init(&ns->ns, &timens_operations, true);
|
||||
if (err)
|
||||
goto fail_free_page;
|
||||
|
||||
ns->ucounts = ucounts;
|
||||
ns->ns.ops = &timens_operations;
|
||||
ns->user_ns = get_user_ns(user_ns);
|
||||
ns->offsets = old_ns->offsets;
|
||||
ns->frozen_offsets = false;
|
||||
|
||||
Reference in New Issue
Block a user