Re: [PATCH v10 1/4] cgroups: use bitmask to filter for_each_subsys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ooh, just one more thing.

On Sun, Apr 19, 2015 at 10:22:31PM +1000, Aleksa Sarai wrote:
> +/**
> + * for_each_subsys_which - filter for_each_subsys with a bitmask
> + * @ss_mask: the bitmask
> + * @ss: the iteration cursor
> + * @ssid: the index of @ss, CGROUP_SUBSYS_COUNT after reaching the end
> + *
> + * The block will only run for cases where the ssid-th bit (1 << ssid) of
> + * mask is set to 1.
> + */
> +#define for_each_subsys_which(ss_mask, ss, ssid) \
> +	for_each_subsys((ss), (ssid)) \
> +		if ((ss_mask) & (1 << (ssid)))
> +

This isn't completely consistent but we tend to put the cursors in
front of what's being iterated.  e.g.

	for_each_css(css, ssid, cgrp)
	for_each_set_bit(bit, addr, size)

Following the pattern, for_each_subsys_which() prolly should do

	for_each_subsys_which(ss, ssid, ss_mask)

rather than the other way around.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux