Skip to content

Commit

Permalink
cfq-iosched: separate out cfqg_stats_reset() from cfq_pd_reset_stats()
Browse files Browse the repository at this point in the history
Separate out cfqg_stats_reset() which takes struct cfqg_stats * from
cfq_pd_reset_stats() and move the latter to where other pd methods are
defined.  cfqg_stats_reset() will be used to implement hierarchical
stats.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
  • Loading branch information
Tejun Heo committed Jan 9, 2013
1 parent 810ecfa commit 689665a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,9 @@ static inline void cfqg_stats_update_completion(struct cfq_group *cfqg,
io_start_time - start_time);
}

static void cfq_pd_reset_stats(struct blkcg_gq *blkg)
/* @stats = 0 */
static void cfqg_stats_reset(struct cfqg_stats *stats)
{
struct cfq_group *cfqg = blkg_to_cfqg(blkg);
struct cfqg_stats *stats = &cfqg->stats;

/* queued stats shouldn't be cleared */
blkg_rwstat_reset(&stats->service_bytes);
blkg_rwstat_reset(&stats->serviced);
Expand Down Expand Up @@ -1477,6 +1475,13 @@ static void cfq_pd_init(struct blkcg_gq *blkg)
cfqg->leaf_weight = blkg->blkcg->cfq_leaf_weight;
}

static void cfq_pd_reset_stats(struct blkcg_gq *blkg)
{
struct cfq_group *cfqg = blkg_to_cfqg(blkg);

cfqg_stats_reset(&cfqg->stats);
}

/*
* Search for the cfq group current task belongs to. request_queue lock must
* be held.
Expand Down

0 comments on commit 689665a

Please sign in to comment.