summaryrefslogtreecommitdiffstats
path: root/src/spdk/ocf/inc/ocf_cleaner.h
blob: 43d6a30ccbbe85e94e86e9a126cb71bf9edc0a02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright(c) 2012-2018 Intel Corporation
 * SPDX-License-Identifier: BSD-3-Clause-Clear
 */

#ifndef OCF_CLEANER_H_
#define OCF_CLEANER_H_

/**
 * @file
 * @brief OCF cleaner API for synchronization dirty data
 *
 */

/**
 * @brief OCF Cleaner completion
 *
 * @note Completion function for cleaner
 *
 * @param[in] cleaner Cleaner instance
 * @param[in] interval Time to sleep before next cleaner iteration
 */
typedef void (*ocf_cleaner_end_t)(ocf_cleaner_t cleaner, uint32_t interval);

/**
 * @brief Set cleaner completion function
 *
 * @param[in] cleaner Cleaner instance
 * @param[in] fn Completion function
 */
void ocf_cleaner_set_cmpl(ocf_cleaner_t cleaner, ocf_cleaner_end_t fn);

/**
 * @brief Run cleaner
 *
 * @param[in] c Cleaner instance to run
 * @param[in] queue IO queue handle
 */
void ocf_cleaner_run(ocf_cleaner_t c, ocf_queue_t queue);

/**
 * @brief Set cleaner private data
 *
 * @param[in] c Cleaner handle
 * @param[in] priv Private data
 */
void ocf_cleaner_set_priv(ocf_cleaner_t c, void *priv);

/**
 * @brief Get cleaner private data
 *
 * @param[in] c Cleaner handle
 *
 * @retval Cleaner private data
 */
void *ocf_cleaner_get_priv(ocf_cleaner_t c);

/**
 * @brief Get cache instance to which cleaner belongs
 *
 * @param[in] c Cleaner handle
 *
 * @retval Cache instance
 */
ocf_cache_t ocf_cleaner_get_cache(ocf_cleaner_t c);

#endif