From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCH 03/33] blkcg: implement blkg_for_each_descendant_post() Date: Mon, 6 May 2013 15:45:42 -0700 Message-ID: <1367880372-28312-4-git-send-email-tj@kernel.org> References: <1367880372-28312-1-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=9oUklS3jgpJjAFjS0BplkhQsf9+nNOc3gQQqbVUsmJQ=; b=J4F3J09ymKfRBs7YgWrD/ARuLSEN5F35WGpX7fuNcgQ8LOViPnvOy8CF1zHjTsKHMa cHXsaC+9J6qYjGoxiLinBUwgP9x4vx5zVUrczUofX+gtOSz8uD/CIsq5LMOXmKVbC+OS iYk+BFJoixDXm7F9cyFEGo/TnVfAX0gTS81P+Apnaib+sDxaEsIIxmzT+lil8nSJpDmP 6DGZ5dDegXleNZL8haT+Q5uggSZEKl7DDHDT42wLwg8Oi1aXbXauqC7Z/xNQ9wRSHMz9 fEo9uC7oKjlKwokX21UnyKIOHmhI8eP6oR7827cUu1TSeA8HTTmS789/3R+iL7aeWxkt ec9Q== In-Reply-To: <1367880372-28312-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tejun Heo , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org This will be used by blk-throttle hierarchy support. Signed-off-by: Tejun Heo --- block/blk-cgroup.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 11f5b92..e15f731 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -303,6 +303,20 @@ struct blkcg_gq *__blkg_lookup(struct blkcg *blkcg, struct request_queue *q, (p_blkg)->q, false))) /** + * blkg_for_each_descendant_post - post-order walk of a blkg's descendants + * @d_blkg: loop cursor pointing to the current descendant + * @pos_cgrp: used for iteration + * @p_blkg: target blkg to walk descendants of + * + * Similar to blkg_for_each_descendant_pre() but performs post-order + * traversal instead. Synchronization rules are the same. + */ +#define blkg_for_each_descendant_post(d_blkg, pos_cgrp, p_blkg) \ + cgroup_for_each_descendant_post((pos_cgrp), (p_blkg)->blkcg->css.cgroup) \ + if (((d_blkg) = __blkg_lookup(cgroup_to_blkcg(pos_cgrp), \ + (p_blkg)->q, false))) + +/** * blk_get_rl - get request_list to use * @q: request_queue of interest * @bio: bio which will be attached to the allocated request (may be %NULL) -- 1.8.1.4