Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252804
b: refs/heads/master
c: 5f43ba2
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed May 29, 2011
1 parent bfb232c commit ec7fc03
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bda8efec5c706a672e0714d341a342e811f0262a
refs/heads/master: 5f43ba2950414dc0abf4ac44c397d88069056746
6 changes: 3 additions & 3 deletions trunk/drivers/md/dm-kcopyd.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define SUB_JOB_SIZE 128
#define SPLIT_COUNT 8
#define MIN_JOBS 8
#define RESERVE_PAGES (DIV_ROUND_UP(SUB_JOB_SIZE << SECTOR_SHIFT, PAGE_SIZE))

/*-----------------------------------------------------------------
* Each kcopyd client has its own little pool of preallocated
Expand Down Expand Up @@ -636,8 +637,7 @@ int kcopyd_cancel(struct kcopyd_job *job, int block)
/*-----------------------------------------------------------------
* Client setup
*---------------------------------------------------------------*/
int dm_kcopyd_client_create(unsigned min_pages,
struct dm_kcopyd_client **result)
int dm_kcopyd_client_create(struct dm_kcopyd_client **result)
{
int r = -ENOMEM;
struct dm_kcopyd_client *kc;
Expand All @@ -663,7 +663,7 @@ int dm_kcopyd_client_create(unsigned min_pages,

kc->pages = NULL;
kc->nr_reserved_pages = kc->nr_free_pages = 0;
r = client_reserve_pages(kc, min_pages);
r = client_reserve_pages(kc, RESERVE_PAGES);
if (r)
goto bad_client_pages;

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define DM_MSG_PREFIX "raid1"

#define MAX_RECOVERY 1 /* Maximum number of regions recovered in parallel. */
#define DM_KCOPYD_PAGES 64

#define DM_RAID1_HANDLE_ERRORS 0x01
#define errors_handled(p) ((p)->features & DM_RAID1_HANDLE_ERRORS)
Expand Down Expand Up @@ -1116,7 +1115,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto err_destroy_wq;
}

r = dm_kcopyd_client_create(DM_KCOPYD_PAGES, &ms->kcopyd_client);
r = dm_kcopyd_client_create(&ms->kcopyd_client);
if (r)
goto err_destroy_wq;

Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ static const char dm_snapshot_merge_target_name[] = "snapshot-merge";
*/
#define SNAPSHOT_COPY_PRIORITY 2

/*
* Reserve 1MB for each snapshot initially (with minimum of 1 page).
*/
#define SNAPSHOT_PAGES (((1UL << 20) >> PAGE_SHIFT) ? : 1)

/*
* The size of the mempool used to track chunks in use.
*/
Expand Down Expand Up @@ -1116,7 +1111,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad_hash_tables;
}

r = dm_kcopyd_client_create(SNAPSHOT_PAGES, &s->kcopyd_client);
r = dm_kcopyd_client_create(&s->kcopyd_client);
if (r) {
ti->error = "Could not create kcopyd client";
goto bad_kcopyd;
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/dm-kcopyd.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
* To use kcopyd you must first create a dm_kcopyd_client object.
*/
struct dm_kcopyd_client;
int dm_kcopyd_client_create(unsigned num_pages,
struct dm_kcopyd_client **result);
int dm_kcopyd_client_create(struct dm_kcopyd_client **result);
void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc);

/*
Expand Down

0 comments on commit ec7fc03

Please sign in to comment.