aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dm-kcopyd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dm-kcopyd.h')
-rw-r--r--include/linux/dm-kcopyd.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h
index 47d9d376e4e7..f486d636b82e 100644
--- a/include/linux/dm-kcopyd.h
+++ b/include/linux/dm-kcopyd.h
@@ -21,11 +21,34 @@
21 21
22#define DM_KCOPYD_IGNORE_ERROR 1 22#define DM_KCOPYD_IGNORE_ERROR 1
23 23
24struct dm_kcopyd_throttle {
25 unsigned throttle;
26 unsigned num_io_jobs;
27 unsigned io_period;
28 unsigned total_period;
29 unsigned last_jiffies;
30};
31
32/*
33 * kcopyd clients that want to support throttling must pass an initialised
34 * dm_kcopyd_throttle struct into dm_kcopyd_client_create().
35 * Two or more clients may share the same instance of this struct between
36 * them if they wish to be throttled as a group.
37 *
38 * This macro also creates a corresponding module parameter to configure
39 * the amount of throttling.
40 */
41#define DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(name, description) \
42static struct dm_kcopyd_throttle dm_kcopyd_throttle = { 100, 0, 0, 0, 0 }; \
43module_param_named(name, dm_kcopyd_throttle.throttle, uint, 0644); \
44MODULE_PARM_DESC(name, description)
45
24/* 46/*
25 * To use kcopyd you must first create a dm_kcopyd_client object. 47 * To use kcopyd you must first create a dm_kcopyd_client object.
48 * throttle can be NULL if you don't want any throttling.
26 */ 49 */
27struct dm_kcopyd_client; 50struct dm_kcopyd_client;
28struct dm_kcopyd_client *dm_kcopyd_client_create(void); 51struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *throttle);
29void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); 52void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc);
30 53
31/* 54/*