public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch?: linux-2.5.1-pre7/drivers/block/xd.c compilation fixes
@ 2001-12-08  6:08 Adam J. Richter
  2001-12-08  9:06 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Adam J. Richter @ 2001-12-08  6:08 UTC (permalink / raw)
  To: linux-kernel, pat, tfries, ankry; +Cc: torvalds

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

	I do not know the whole new block IO interface, but here
is my attempt at making linux-2.4.17-pre7/drivers/block/xd.c compile.
If I got any of this wrong, I would appreciate someone telling me,
because I may start tring to fix some of the other 90+ drivers that
do not compile in 2.4.1-pre7 later this weekend.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

[-- Attachment #2: xd.patch --]
[-- Type: text/plain, Size: 1225 bytes --]

--- linux-2.5.1-pre7/drivers/block/xd.c	Fri Dec  7 19:37:41 2001
+++ linux/drivers/block/xd.c	Fri Dec  7 21:11:11 2001
@@ -121,7 +121,6 @@
 static struct hd_struct xd_struct[XD_MAXDRIVES << 6];
 static int xd_sizes[XD_MAXDRIVES << 6], xd_access[XD_MAXDRIVES];
 static int xd_blocksizes[XD_MAXDRIVES << 6];
-static int xd_maxsect[XD_MAXDRIVES << 6];
 
 extern struct block_device_operations xd_fops;
 
@@ -246,8 +245,7 @@
 	}
 
 	/* xd_maxsectors depends on controller - so set after detection */
-	for(i=0; i<(XD_MAXDRIVES << 6); i++) xd_maxsect[i] = xd_maxsectors;
-	max_sectors[MAJOR_NR] = xd_maxsect;
+	blk_queue_max_sectors(BLK_DEFAULT_QUEUE(MAJOR_NR), xd_maxsectors);
 
 	for (i = 0; i < xd_drives; i++) {
 		xd_valid[i] = 1;
@@ -294,11 +292,11 @@
 			block = CURRENT->sector;
 			count = CURRENT->nr_sectors;
 
-			switch (CURRENT->cmd) {
+			switch (rq_data_dir(CURRENT)) {
 				case READ:
 				case WRITE:
 					for (retry = 0; (retry < XD_RETRIES) && !code; retry++)
-						code = xd_readwrite(CURRENT->cmd,CURRENT_DEV,CURRENT->buffer,block,count);
+						code = xd_readwrite(rq_data_dir(CURRENT),CURRENT_DEV,CURRENT->buffer,block,count);
 					break;
 				default:
 					printk("do_xd_request: unknown request\n");

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch?: linux-2.5.1-pre7/drivers/block/xd.c compilation fixes
  2001-12-08  6:08 Patch?: linux-2.5.1-pre7/drivers/block/xd.c compilation fixes Adam J. Richter
@ 2001-12-08  9:06 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2001-12-08  9:06 UTC (permalink / raw)
  To: Adam J. Richter; +Cc: linux-kernel, pat, tfries, ankry, torvalds

On Fri, Dec 07 2001, Adam J. Richter wrote:
> 	I do not know the whole new block IO interface, but here
> is my attempt at making linux-2.4.17-pre7/drivers/block/xd.c compile.
> If I got any of this wrong, I would appreciate someone telling me,
> because I may start tring to fix some of the other 90+ drivers that
> do not compile in 2.4.1-pre7 later this weekend.

That would be great! The fix looks good -- what you want to add in
addition is checking that this is a rw request. So before your switch,
do something ala

	/*
	 * we don't support special requests
	 */
	if (!(CURRENT->flags & REQ_CMD)) {
		blkdev_dequeue_request(CURRENT);
		end_that_request_first(CURRENT, 0, CURRENT->nr_sectors);
		end_that_request_last(CURRENT);
		continue;
	}

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-12-08  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-08  6:08 Patch?: linux-2.5.1-pre7/drivers/block/xd.c compilation fixes Adam J. Richter
2001-12-08  9:06 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox