2003-08-09 09:21:13

by Vinay K Nallamothu

[permalink] [raw]
Subject: [PATCH 2.6.0-test3] compile fix for driver/block/paride/pd.c

This patch removes the extra argument to blk_init_queue which prevents
the module from compiling.


--- linux-2.6.0-test3/drivers/block/paride/pd.c 2003-07-28 10:43:52.000000000 +0530
+++ linux-2.6.0-test3-nvk/drivers/block/paride/pd.c 2003-08-09 15:02:19.000000000 +0530
@@ -893,7 +893,7 @@
if (register_blkdev(major, name))
return -1;

- blk_init_queue(&pd_queue, do_pd_request, &pd_lock);
+ blk_init_queue(do_pd_request, &pd_lock);
blk_queue_max_sectors(&pd_queue, cluster);

printk("%s: %s version %s, major %d, cluster %d, nice %d\n",




2003-08-09 09:29:53

by Nick Piggin

[permalink] [raw]
Subject: Re: [PATCH 2.6.0-test3] compile fix for driver/block/paride/pd.c

blk_init_queue now returns a request queue, so this
patch will not work properly. See the changes in
test2 -> test3 for how to do it correctly.

Vinay K Nallamothu wrote:

>This patch removes the extra argument to blk_init_queue which prevents
>the module from compiling.
>
>
>--- linux-2.6.0-test3/drivers/block/paride/pd.c 2003-07-28 10:43:52.000000000 +0530
>+++ linux-2.6.0-test3-nvk/drivers/block/paride/pd.c 2003-08-09 15:02:19.000000000 +0530
>@@ -893,7 +893,7 @@
> if (register_blkdev(major, name))
> return -1;
>
>- blk_init_queue(&pd_queue, do_pd_request, &pd_lock);
>+ blk_init_queue(do_pd_request, &pd_lock);
> blk_queue_max_sectors(&pd_queue, cluster);
>
> printk("%s: %s version %s, major %d, cluster %d, nice %d\n",
>
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
>
>

2003-08-09 10:15:37

by Vinay K Nallamothu

[permalink] [raw]
Subject: Re: [PATCH 2.6.0-test3] compile fix for driver/block/paride/pd.c

Hi Nick,

On Sat, 2003-08-09 at 14:58, Nick Piggin wrote:
> blk_init_queue now returns a request queue, so this
> patch will not work properly. See the changes in
> test2 -> test3 for how to do it correctly.

Thanks for pointing out. Here is the one with proper fixes. Compiles
fine though not tested.


This patch modifies the code to use the new blk_init_queue.

pd.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)

diff -urN linux-2.6.0-test3/drivers/block/paride/pd.c linux-2.6.0-test3-nvk/drivers/block/paride/pd.c
--- linux-2.6.0-test3/drivers/block/paride/pd.c 2003-07-28 10:43:52.000000000 +0530
+++ linux-2.6.0-test3-nvk/drivers/block/paride/pd.c 2003-08-09 15:58:56.000000000 +0530
@@ -654,7 +654,7 @@
return pd_identify(disk);
}

-static struct request_queue pd_queue;
+static struct request_queue* pd_queue;

static int pd_detect(void)
{
@@ -704,7 +704,7 @@
set_capacity(p, disk->capacity);
disk->gd = p;
p->private_data = disk;
- p->queue = &pd_queue;
+ p->queue = pd_queue;
add_disk(p);
}
}
@@ -782,7 +782,7 @@
spin_lock_irqsave(&pd_lock, saved_flags);
end_request(pd_req, success);
pd_busy = 0;
- do_pd_request(&pd_queue);
+ do_pd_request(pd_queue);
spin_unlock_irqrestore(&pd_lock, saved_flags);
}

@@ -893,13 +893,18 @@
if (register_blkdev(major, name))
return -1;

- blk_init_queue(&pd_queue, do_pd_request, &pd_lock);
- blk_queue_max_sectors(&pd_queue, cluster);
+ pd_queue = blk_init_queue(do_pd_request, &pd_lock);
+ if (!pd_queue)
+ goto error;
+
+ blk_queue_max_sectors(pd_queue, cluster);

printk("%s: %s version %s, major %d, cluster %d, nice %d\n",
name, name, PD_VERSION, major, cluster, nice);
pd_init_units();
if (!pd_detect()) {
+ blk_put_queue(pd_queue);
+error:
unregister_blkdev(major, name);
return -1;
}
@@ -920,7 +925,7 @@
pi_release(disk->pi);
}
}
- blk_cleanup_queue(&pd_queue);
+ blk_put_queue(pd_queue);
}

MODULE_LICENSE("GPL");