diff options
Diffstat (limited to 'include/linux/dm-kcopyd.h')
-rw-r--r-- | include/linux/dm-kcopyd.h | 25 |
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 | ||
24 | struct 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) \ | ||
42 | static struct dm_kcopyd_throttle dm_kcopyd_throttle = { 100, 0, 0, 0, 0 }; \ | ||
43 | module_param_named(name, dm_kcopyd_throttle.throttle, uint, 0644); \ | ||
44 | MODULE_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 | */ |
27 | struct dm_kcopyd_client; | 50 | struct dm_kcopyd_client; |
28 | struct dm_kcopyd_client *dm_kcopyd_client_create(void); | 51 | struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *throttle); |
29 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); | 52 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); |
30 | 53 | ||
31 | /* | 54 | /* |