lkml.org 
[lkml]   [2015]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 1/4] cgroups: use bitmask to filter for_each_subsys
Hello,

On Mon, Apr 27, 2015 at 02:05:47AM +1000, Aleksa Sarai wrote:
> In addition, there are a bunch of cgroup_* functions that use unsigned
> ints for bitops (cgroup_calc_child_subsys_mask, rebind_subsystems,
> cgroup_print_ss_mask). Is there a better solution to this problem, or
> should I just switch back to my naive solution?

Hmmmm... You can either convert all masks to ulong (which is fine) or
do something like the following.

#define for_each_subsys_which(ss_mask, ss, ssid) \
unsigned long __tmp_mask = (ss_mask); \
for_each_set_bit(ssid, &__tmp_mask, CGROUP_SUBSYS_COUNT)\
if ((ss) = group_subsys[ssid] && false) \
; \
else

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-04-26 18:41    [W:1.094 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site