FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 06-02-2011, 07:18 PM
Mikulas Patocka
 
Default dm-kcopyd: remove nr_pages field from job structure

dm-kcopyd: remove nr_pages field from job structure

This field is never used, except temporarily in function "run_pages_job"
to count the number of required pages. We can use local variable instead.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm-kcopyd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6.39-fast/drivers/md/dm-kcopyd.c
================================================== =================
--- linux-2.6.39-fast.orig/drivers/md/dm-kcopyd.c 2011-06-02 21:08:03.000000000 +0200
+++ linux-2.6.39-fast/drivers/md/dm-kcopyd.c 2011-06-02 21:08:39.000000000 +0200
@@ -309,7 +309,6 @@ struct kcopyd_job {
unsigned int num_dests;
struct dm_io_region dests[DM_KCOPYD_MAX_REGIONS];

- unsigned int nr_pages;
struct page_list *pages;

/*
@@ -482,9 +481,9 @@ static int run_io_job(struct kcopyd_job
static int run_pages_job(struct kcopyd_job *job)
{
int r;
+ unsigned nr_pages = dm_div_up(job->dests[0].count, PAGE_SIZE >> 9);

- job->nr_pages = dm_div_up(job->dests[0].count, PAGE_SIZE >> 9);
- r = kcopyd_get_pages(job->kc, job->nr_pages, &job->pages);
+ r = kcopyd_get_pages(job->kc, nr_pages, &job->pages);
if (!r) {
/* this job is ready for io */
push(&job->kc->io_jobs, job);
@@ -687,7 +686,6 @@ int dm_kcopyd_copy(struct dm_kcopyd_clie
job->num_dests = num_dests;
memcpy(&job->dests, dests, sizeof(*dests) * num_dests);

- job->nr_pages = 0;
job->pages = NULL;

job->fn = fn;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 06:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org