Print this page
OS-4825 cgroup user agent should be launched from the kernel
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
*** 19,28 ****
--- 19,29 ----
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2016 Joyent, Inc.
*/
/*
* Contracts
* ---------
*** 285,295 ****
ctflags_t flags, proc_t *author, int canfail)
{
avl_index_t where;
klwp_t *curlwp = ttolwp(curthread);
! ASSERT(author == curproc);
mutex_init(&ct->ct_lock, NULL, MUTEX_DEFAULT, NULL);
mutex_init(&ct->ct_reflock, NULL, MUTEX_DEFAULT, NULL);
mutex_init(&ct->ct_evtlock, NULL, MUTEX_DEFAULT, NULL);
ct->ct_id = id_alloc(contract_ids);
--- 286,299 ----
ctflags_t flags, proc_t *author, int canfail)
{
avl_index_t where;
klwp_t *curlwp = ttolwp(curthread);
! /*
! * It's possible that author is not curproc if the zone is creating
! * a new process as a child of zsched.
! */
mutex_init(&ct->ct_lock, NULL, MUTEX_DEFAULT, NULL);
mutex_init(&ct->ct_reflock, NULL, MUTEX_DEFAULT, NULL);
mutex_init(&ct->ct_evtlock, NULL, MUTEX_DEFAULT, NULL);
ct->ct_id = id_alloc(contract_ids);