5 |
* |
* |
6 |
* Copyright (C) 2005-2008 NTT DATA CORPORATION |
* Copyright (C) 2005-2008 NTT DATA CORPORATION |
7 |
* |
* |
8 |
* Version: 1.6.5-pre 2008/10/07 |
* Version: 1.6.5-pre 2008/10/11 |
9 |
* |
* |
10 |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
* This file is applicable to both 2.4.30 and 2.6.11 and later. |
11 |
* See README.ccs for ChangeLog. |
* See README.ccs for ChangeLog. |
37 |
|
|
38 |
#ifdef CONFIG_TOMOYO |
#ifdef CONFIG_TOMOYO |
39 |
|
|
|
/* Lock for appending domain's ACL. */ |
|
|
DEFINE_MUTEX(domain_acl_lock); |
|
|
|
|
40 |
/* Domain creation lock. */ |
/* Domain creation lock. */ |
41 |
static DEFINE_MUTEX(new_domain_assign_lock); |
static DEFINE_MUTEX(new_domain_assign_lock); |
42 |
|
|
122 |
*/ |
*/ |
123 |
int ccs_add_domain_acl(struct domain_info *domain, struct acl_info *acl) |
int ccs_add_domain_acl(struct domain_info *domain, struct acl_info *acl) |
124 |
{ |
{ |
125 |
if (domain) |
if (domain) { |
126 |
|
/* |
127 |
|
* We need to serialize because this function is called by |
128 |
|
* various update functions. |
129 |
|
*/ |
130 |
|
static DEFINE_SPINLOCK(lock); |
131 |
|
/***** CRITICAL SECTION START *****/ |
132 |
|
spin_lock(&lock); |
133 |
list1_add_tail_mb(&acl->list, &domain->acl_info_list); |
list1_add_tail_mb(&acl->list, &domain->acl_info_list); |
134 |
else |
spin_unlock(&lock); |
135 |
|
/***** CRITICAL SECTION END *****/ |
136 |
|
} else { |
137 |
acl->type &= ~ACL_DELETED; |
acl->type &= ~ACL_DELETED; |
138 |
|
} |
139 |
ccs_update_counter(CCS_UPDATES_COUNTER_DOMAIN_POLICY); |
ccs_update_counter(CCS_UPDATES_COUNTER_DOMAIN_POLICY); |
140 |
return 0; |
return 0; |
141 |
} |
} |