* [PATCH] 2.5.19 : drivers/mtd/nftlcore.c
@ 2002-05-30 23:52 Frank Davis
2002-05-31 7:14 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Frank Davis @ 2002-05-30 23:52 UTC (permalink / raw)
To: linux-kernel; +Cc: fdavis
Hello all,
The following patch addresses a few compile warnings and an error (for
blk_init_queue) . Please review. The only thing I don't particularly like
is casting req->cmd to an int for WRITE .
Regards,
Frank
--- drivers/mtd/nftlcore.c.old Thu May 30 19:08:35 2002
+++ drivers/mtd/nftlcore.c Thu May 30 19:44:59 2002
@@ -846,11 +846,11 @@
/* We can do this because the generic code knows not to
touch the request at the head of the queue */
- spin_unlock_irq(&QUEUE->queue_lock);
+ spin_unlock_irq(QUEUE->queue_lock);
DEBUG(MTD_DEBUG_LEVEL2, "NFTL_request\n");
DEBUG(MTD_DEBUG_LEVEL3,
- "NFTL %s request, from sector 0x%04lx for 0x%04lx sectors\n",
+ "NFTL %s request, from sector 0x%04lx for %d sectors\n",
(req->cmd == READ) ? "Read " : "Write",
req->sector, req->current_nr_sectors);
@@ -899,7 +899,7 @@
DEBUG(MTD_DEBUG_LEVEL2,"NFTL read request completed OK\n");
up(&nftl->mutex);
goto repeat;
- } else if (req->cmd == WRITE) {
+ } else if ((int)req->cmd == WRITE) {
DEBUG(MTD_DEBUG_LEVEL2, "NFTL write request of 0x%x sectors @ %x "
"(req->nr_sectors == %lx)\n", nsect, block,
req->nr_sectors);
@@ -927,7 +927,7 @@
}
repeat:
DEBUG(MTD_DEBUG_LEVEL3, "end_request(%d)\n", res);
- spin_lock_irq(&QUEUE->queue_lock);
+ spin_lock_irq(QUEUE->queue_lock);
end_request(res);
}
}
@@ -1015,10 +1015,11 @@
};
extern char nftlmountrev[];
+static spinlock_t nftl_lock = SPIN_LOCK_UNLOCKED;
int __init init_nftl(void)
{
- int i;
+spin_lock_init(&nftl_lock);
#ifdef PRERELEASE
printk(KERN_INFO "NFTL driver: nftlcore.c $Revision: 1.82 $, nftlmount.c %s\n", nftlmountrev);
@@ -1028,7 +1029,7 @@
printk("unable to register NFTL block device on major %d\n", MAJOR_NR);
return -EBUSY;
} else {
- blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), &nftl_request);
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), &nftl_request, &nftl_lock);
add_gendisk(&nftl_gendisk);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] 2.5.19 : drivers/mtd/nftlcore.c
2002-05-30 23:52 [PATCH] 2.5.19 : drivers/mtd/nftlcore.c Frank Davis
@ 2002-05-31 7:14 ` Jens Axboe
0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2002-05-31 7:14 UTC (permalink / raw)
To: Frank Davis; +Cc: linux-kernel
On Thu, May 30 2002, Frank Davis wrote:
> @@ -899,7 +899,7 @@
> DEBUG(MTD_DEBUG_LEVEL2,"NFTL read request completed OK\n");
> up(&nftl->mutex);
> goto repeat;
> - } else if (req->cmd == WRITE) {
> + } else if ((int)req->cmd == WRITE) {
Irk, this is very wrong :-)
} else if (rq_data_dir(rq) == WRITE) {
should work.
> @@ -1015,10 +1015,11 @@
> };
>
> extern char nftlmountrev[];
> +static spinlock_t nftl_lock = SPIN_LOCK_UNLOCKED;
>
> int __init init_nftl(void)
> {
> - int i;
> +spin_lock_init(&nftl_lock);
You don't need the spin_lock_init(), you just set it SPIN_LOCK_UNLOCKED
above.
The rest looks ok.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] 2.5.19 : drivers/mtd/nftlcore.c
@ 2002-05-31 12:53 Frank Davis
0 siblings, 0 replies; 3+ messages in thread
From: Frank Davis @ 2002-05-31 12:53 UTC (permalink / raw)
To: linux-kernel; +Cc: fdavis, torvalds
Hello all,
The following patch fixes a few compiler warnings, as well as provides
blk_init_queue() with the appropriate arguments. Please review for
inclusion. Thanks to Jens Axboe for fixing the casting hack in
the previous version of this patch.
Regards,
Frank
--- drivers/mtd/nftlcore.c.old Thu May 30 19:08:35 2002
+++ drivers/mtd/nftlcore.c Fri May 31 08:45:08 2002
@@ -846,11 +846,11 @@
/* We can do this because the generic code knows not to
touch the request at the head of the queue */
- spin_unlock_irq(&QUEUE->queue_lock);
+ spin_unlock_irq(QUEUE->queue_lock);
DEBUG(MTD_DEBUG_LEVEL2, "NFTL_request\n");
DEBUG(MTD_DEBUG_LEVEL3,
- "NFTL %s request, from sector 0x%04lx for 0x%04lx sectors\n",
+ "NFTL %s request, from sector 0x%04lx for %d sectors\n",
(req->cmd == READ) ? "Read " : "Write",
req->sector, req->current_nr_sectors);
@@ -899,7 +899,7 @@
DEBUG(MTD_DEBUG_LEVEL2,"NFTL read request completed OK\n");
up(&nftl->mutex);
goto repeat;
- } else if (req->cmd == WRITE) {
+ } else if (rq_data_dir(req) == WRITE) {
DEBUG(MTD_DEBUG_LEVEL2, "NFTL write request of 0x%x sectors @ %x "
"(req->nr_sectors == %lx)\n", nsect, block,
req->nr_sectors);
@@ -927,7 +927,7 @@
}
repeat:
DEBUG(MTD_DEBUG_LEVEL3, "end_request(%d)\n", res);
- spin_lock_irq(&QUEUE->queue_lock);
+ spin_lock_irq(QUEUE->queue_lock);
end_request(res);
}
}
@@ -1015,10 +1015,10 @@
};
extern char nftlmountrev[];
+static spinlock_t nftl_lock = SPIN_LOCK_UNLOCKED;
int __init init_nftl(void)
{
- int i;
#ifdef PRERELEASE
printk(KERN_INFO "NFTL driver: nftlcore.c $Revision: 1.82 $, nftlmount.c %s\n", nftlmountrev);
@@ -1028,7 +1028,7 @@
printk("unable to register NFTL block device on major %d\n", MAJOR_NR);
return -EBUSY;
} else {
- blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), &nftl_request);
+ blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), &nftl_request, &nftl_lock);
add_gendisk(&nftl_gendisk);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-31 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-30 23:52 [PATCH] 2.5.19 : drivers/mtd/nftlcore.c Frank Davis
2002-05-31 7:14 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2002-05-31 12:53 Frank Davis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox