static int smq_walk_mappings(struct dm_cache_policy *p, policy_walk_fn fn,
			     void *context)
{
	struct smq_policy *mq = to_smq_policy(p);
	int r = 0;

	/*
	 * We don't need to lock here since this method is only called once
	 * the IO has stopped.
	 */
	r = smq_save_hints(mq, &mq->clean, fn, context);
	if (!r)
		r = smq_save_hints(mq, &mq->dirty, fn, context);

	return r;
}
예제 #2
0
static int smq_walk_mappings(struct dm_cache_policy *p, policy_walk_fn fn,
			     void *context)
{
	struct smq_policy *mq = to_smq_policy(p);
	int r = 0;

	mutex_lock(&mq->lock);

	r = smq_save_hints(mq, &mq->clean, fn, context);
	if (!r)
		r = smq_save_hints(mq, &mq->dirty, fn, context);

	mutex_unlock(&mq->lock);

	return r;
}