(empty log message)
@@ -1265,7 +1265,7 @@ | ||
1265 | 1265 | static unsigned int ccs_log_count; |
1266 | 1266 | |
1267 | 1267 | /* Counter for number of updates. */ |
1268 | -static unsigned int ccs_stat_updated[CCS_MAX_POLICY_STAT]; | |
1268 | +static atomic_t ccs_stat_updated[CCS_MAX_POLICY_STAT]; | |
1269 | 1269 | |
1270 | 1270 | /* Timestamp counter for last updated. */ |
1271 | 1271 | #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) |
@@ -5151,10 +5151,7 @@ | ||
5151 | 5151 | struct timeval tv; |
5152 | 5152 | #endif |
5153 | 5153 | |
5154 | - /* | |
5155 | - * I don't use atomic operations because race condition is not fatal. | |
5156 | - */ | |
5157 | - ccs_stat_updated[index]++; | |
5154 | + atomic_inc(&ccs_stat_updated[index]); | |
5158 | 5155 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) |
5159 | 5156 | do_gettimeofday(&tv); |
5160 | 5157 | ccs_stat_modified[index] = tv.tv_sec; |
@@ -5180,7 +5177,7 @@ | ||
5180 | 5177 | return; |
5181 | 5178 | for (i = 0; i < CCS_MAX_POLICY_STAT; i++) { |
5182 | 5179 | ccs_io_printf(head, "Policy %-30s %10u", ccs_policy_headers[i], |
5183 | - ccs_stat_updated[i]); | |
5180 | + atomic_read(&ccs_stat_updated[i])); | |
5184 | 5181 | if (ccs_stat_modified[i]) { |
5185 | 5182 | struct ccs_time stamp; |
5186 | 5183 | ccs_convert_time(ccs_stat_modified[i], &stamp); |