aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-kcopyd.c6
-rw-r--r--drivers/md/dm-raid1.c3
-rw-r--r--drivers/md/dm-snap.c7
-rw-r--r--include/linux/dm-kcopyd.h3
4 files changed, 6 insertions, 13 deletions
diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
index 719693340d1d..579647f8b4d2 100644
--- a/drivers/md/dm-kcopyd.c
+++ b/drivers/md/dm-kcopyd.c
@@ -30,6 +30,7 @@
30#define SUB_JOB_SIZE 128 30#define SUB_JOB_SIZE 128
31#define SPLIT_COUNT 8 31#define SPLIT_COUNT 8
32#define MIN_JOBS 8 32#define MIN_JOBS 8
33#define RESERVE_PAGES (DIV_ROUND_UP(SUB_JOB_SIZE << SECTOR_SHIFT, PAGE_SIZE))
33 34
34/*----------------------------------------------------------------- 35/*-----------------------------------------------------------------
35 * Each kcopyd client has its own little pool of preallocated 36 * Each kcopyd client has its own little pool of preallocated
@@ -636,8 +637,7 @@ int kcopyd_cancel(struct kcopyd_job *job, int block)
636/*----------------------------------------------------------------- 637/*-----------------------------------------------------------------
637 * Client setup 638 * Client setup
638 *---------------------------------------------------------------*/ 639 *---------------------------------------------------------------*/
639int dm_kcopyd_client_create(unsigned min_pages, 640int dm_kcopyd_client_create(struct dm_kcopyd_client **result)
640 struct dm_kcopyd_client **result)
641{ 641{
642 int r = -ENOMEM; 642 int r = -ENOMEM;
643 struct dm_kcopyd_client *kc; 643 struct dm_kcopyd_client *kc;
@@ -663,7 +663,7 @@ int dm_kcopyd_client_create(unsigned min_pages,
663 663
664 kc->pages = NULL; 664 kc->pages = NULL;
665 kc->nr_reserved_pages = kc->nr_free_pages = 0; 665 kc->nr_reserved_pages = kc->nr_free_pages = 0;
666 r = client_reserve_pages(kc, min_pages); 666 r = client_reserve_pages(kc, RESERVE_PAGES);
667 if (r) 667 if (r)
668 goto bad_client_pages; 668 goto bad_client_pages;
669 669
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 53089aa11387..9defad045418 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -22,7 +22,6 @@
22#define DM_MSG_PREFIX "raid1" 22#define DM_MSG_PREFIX "raid1"
23 23
24#define MAX_RECOVERY 1 /* Maximum number of regions recovered in parallel. */ 24#define MAX_RECOVERY 1 /* Maximum number of regions recovered in parallel. */
25#define DM_KCOPYD_PAGES 64
26 25
27#define DM_RAID1_HANDLE_ERRORS 0x01 26#define DM_RAID1_HANDLE_ERRORS 0x01
28#define errors_handled(p) ((p)->features & DM_RAID1_HANDLE_ERRORS) 27#define errors_handled(p) ((p)->features & DM_RAID1_HANDLE_ERRORS)
@@ -1116,7 +1115,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1116 goto err_destroy_wq; 1115 goto err_destroy_wq;
1117 } 1116 }
1118 1117
1119 r = dm_kcopyd_client_create(DM_KCOPYD_PAGES, &ms->kcopyd_client); 1118 r = dm_kcopyd_client_create(&ms->kcopyd_client);
1120 if (r) 1119 if (r)
1121 goto err_destroy_wq; 1120 goto err_destroy_wq;
1122 1121
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index a2d330942cb2..5a2296de84a3 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -40,11 +40,6 @@ static const char dm_snapshot_merge_target_name[] = "snapshot-merge";
40#define SNAPSHOT_COPY_PRIORITY 2 40#define SNAPSHOT_COPY_PRIORITY 2
41 41
42/* 42/*
43 * Reserve 1MB for each snapshot initially (with minimum of 1 page).
44 */
45#define SNAPSHOT_PAGES (((1UL << 20) >> PAGE_SHIFT) ? : 1)
46
47/*
48 * The size of the mempool used to track chunks in use. 43 * The size of the mempool used to track chunks in use.
49 */ 44 */
50#define MIN_IOS 256 45#define MIN_IOS 256
@@ -1116,7 +1111,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1116 goto bad_hash_tables; 1111 goto bad_hash_tables;
1117 } 1112 }
1118 1113
1119 r = dm_kcopyd_client_create(SNAPSHOT_PAGES, &s->kcopyd_client); 1114 r = dm_kcopyd_client_create(&s->kcopyd_client);
1120 if (r) { 1115 if (r) {
1121 ti->error = "Could not create kcopyd client"; 1116 ti->error = "Could not create kcopyd client";
1122 goto bad_kcopyd; 1117 goto bad_kcopyd;
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h
index 5db216311695..312513d4741a 100644
--- a/include/linux/dm-kcopyd.h
+++ b/include/linux/dm-kcopyd.h
@@ -25,8 +25,7 @@
25 * To use kcopyd you must first create a dm_kcopyd_client object. 25 * To use kcopyd you must first create a dm_kcopyd_client object.
26 */ 26 */
27struct dm_kcopyd_client; 27struct dm_kcopyd_client;
28int dm_kcopyd_client_create(unsigned num_pages, 28int dm_kcopyd_client_create(struct dm_kcopyd_client **result);
29 struct dm_kcopyd_client **result);
30void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); 29void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc);
31 30
32/* 31/*